Roy, Bart,
I have contributed several things to the focus algorithms and to the HFR calculations in
KStars over the past year, and have actually given this issue some thought, though have
not tried to make any changes ti this particular issue, nor do I have a clear idea about what
should be done. However, here are some thoughts:
Background
Note: I have never used the 'Autofocus if HFR > X' check, but I just looked at the code, and,
as I thought, it doesn't appear to work as Roy describes.
How (I believe) things currently work.
Before every light-image (sub) capture, if the 'Autofocus if HFR > X pixels' checkbox is enabled,
the capture module asks the focus module to take a new single image (using the focus tab's
parameters -- though I assume with the capture frame's filter) and to run the focus tab's HFR
calculation. If the "focus HFR" computed is worse than the threshold X, then the focus module
will initiate a full autofocus sequence. Otherwise control goes back to the Capture module which
starts the capture for the light frame.
WHAT IT DOES NOT DO: It doesn't use the previously captured light images's HFR value to make any decisions.
So, I imagine that the design intended the user to be aware of HFR values that focus was
calculating, come up with a threshold, and ask for refocus if the threshold is exceeded.
My thoughts on the above.
HFR is tricky. Ideally its value would be a measurement totally dependent on focus that one
could use to decide if an image was in focus or not. However, in my experience, it is (sometimes
strongly) affected by other non-focus-related variables such as exposure time, sky brightness,
filter used, guiding, .... I haven't (yet) been scientific about the above (it would be nice to really
do an experiment where I make these changes and see their effects on HFR--and I welcome your
data if you want to do it), but this is what I expect. So, I think you would likely not get the same
HFR from a 5-second "focus exposure" as a 5-minute sub exposure. Therefore, to both your points,
I wouldn't expect Focus and Capture to give the same HFR values unless they were using similar
exposure times. That's likely why I don't use the feature--I shoot with a monochrome camera and with
various filters, changing filters every 30-60 minutes, and always autofocus on filter change.
Further, a rise in HFR might be due to guiding, and not to focus at all.
All that said, it really would be nice to perform some check on the light image's HFR.
That's why I added HFR to the Analyze graph. To start to get some better intuition about all this.
In addition to all the above, at this moment in development, with StellarSolver just being integrated into KStars,
I believe that Capture and Focus default to different star extraction parameters (and hence this is more reason
why the HFR values might differ). This is something I intend to look into and hopefully fix, so that at least they
extract stars in the same way by default.
I'm not sure what, if anything, should be done to further improve the situation. Feel free to let me know your thoughts.
Hy