===================================
PRILIMINARY CAVEAT:
All the following conclusions are clearly based on my hardware and the specific piece of sky that these were taken at. The central bright star was just a mag 6 star that I centered on intending to use my new GoldFocus mask (which I did not get to, instead testing the focus routine).
However, that being said, I believe most imagers will be imaging targets from time to time with similar characteristics as this target.
And my hardware is not that unusual.
I think the key reason that many users who commented here that the routine worked perfectly for them is:
- they did not stray too far from decent focus. Some may differ with this statement. If so it would be instructive to see if they were as far out of focus as my following examples (unless they used larger minimum star sizes, which is problematical).
- they have tuned the Mininum Star Size to produce good results.
I can do both of the above and get excellent results on my refractor, and reasonable results on my RC12.
The big problem with trying to tune the Mininum Star Size with the current routine is it needs small values (2 to 6) to work well if the starting focus is close to good focus, and it needs large values (say 10 to 14) if the start is way off focus.
Clearly the actual value ranges are likely to be different for different people, and perhaps even different for different targets, which is a really big problem. And perhaps equally problematic is the optimum (or even usable) Minimum Star Size is likely to be highly dependent on how far out of focus the initial position is.
I must emphasize here that all these results are using my Stellarvue 102mm refractor which of course gives beautiful V curves and never gets into donut land like my RC and other obstructed scopes, so long as the range is not too large.
However, out of focus refactors also produce very large stars which produce the same difficulties for the AF routine as do obstructed scopes.
======AT PERFECT FOCUS======= (arrived at using step = 50, MinStarSize = 2)

This table shows star count and HRF for Mininum Star Sizes from 2 through 14.
This image is at the perfect focus position established with the nice prior run (above) with good V curve, using step=50, so the stars never got big enough to enter the problem zone.
Min Star
Size____SCnt__HFR
_2…300___1.80
_4…300___1.88
_6…300___1.90
_8…108___2.32
10…_29___2.93
12…_13___3.64
14…__3___5.89
These results are partly what one would expect. Increasing the min star size would progressively eliminate the smaller stars, and this image contains thousands of small stars with an image FOV of 1.8 degrees. The true HFR for this image is around 1.8 to 1.9. I have not noticed any bogus stars from hot pixels, although that is probably why going from 2 to 4 increases the HFR from 1.80 to 1.88. Certainly an insignificant hot pixel issue. This is why on most of my runs I have just used min star size of 2, since I never see a significant number of bogus stars.
The real problem this points out is that the most accurate results come from using SMALL star sizes when close to focus, but as the following table shows, the current AF routine progressively quits finding stars the further out of focus you get.
Therefore, to get any usable results when way out of focus, you must use LARGE minimum star sizes.
The requirements for getting good results both in focus and out of focus are therefore incompatible.
Conclusions for my personal setup:
- To get an accurate HFR with the 2.5.1.6 AF routine it is important to keep the min star size between 2 and 6. If I keep the step size to 50 or less so not too outside of focus, I get excellent results.
- If I want to use a larger step size of 80 or more (or more importantly, if my staring position is out of focus), I must use a step size around 12, and it is very sensitive to this number and many vary by target. Doing so reduces the star count from 300 (actually thousands are available) to small numbers from 0 to 100.
Intuitively it makes sense that you would always use the smallest Minimum Star Size that does not make hot pixels into stars. The reason larger Minimum Star Sizes work for some configurations with the current routine is that it requires larger values to find any stars when fairly out of focus.
The following table shows results using 2.6.1.6 on my last AFPack_10 which ended way out of focus, having started from the prior position of perfect focus, shown above.
The step size was 80, which gets a lot more out of focus that the above good run with step size 50.
======FOLLOWING BAD RUN======= (my results for Minimum Star Size = 2, using step = 80)
Starting from the prior position of perfect focus.
Note these actual results when I ran this at MinStarSize=2 are very close to results in following table using MinStarSize=6.

This table shows the results for the final 14 images of the series for both MinStarSize = 6 and 12.
There were 4 images in the inital phase of the run that were closest to the starting perfect focus position, after which it erroneously concluded that better focus was to be found further out.
________-------6-------…------12------- <---- Minimum Star Size
Img#____SCnt__HFR…SCnt__HFR
0…__0______0…_10___16.79
_1…__0______0…12___14.83
2…1.50…_11___15.24
_3…__0______0…14___13.45
4…1.71…_15___13.44
_5…__3___3.93…_20___11.72
_6…_27___9.87…_29___10.00
_7…_28___9.73…_30____9.86
_8…_24___7.90…_45____8.30
_9…_86___6.44…_86____6.47
10…158___4.74…140____4.93
11…300___3.16…_57____4.17
12…300___2.15…_17____3.76
13…300___1.80…__9____4.25
This clearly demostrates that for out of focus images, small minimum star sizes are a complete bust, finding only 3 stars at MinStarSize = 5.
And as Ken pointed out, using MinStarSize = 12 give the following very good curve:

My recommedations for how to fix this:
- cap Minimum star size to 6, or just hardwire it internally to 4 or 6, and work on adjusting the routine to find enough stars in the out of focus regions.
Seems to me it is a real problem having a critical (and sensitive) parameter for the user to adjust. Particularly when it may vary by target, and by how far out of focus the starting position is.
- Try hard to use the same set of stars (or very close to the same set of stars) for all frames in the run.
In the next post I will present some additional ideas on how this might be accomplished. For now I have to get on to other stuff, having spent 3 hours putting all this together. (OK, so I’m slow, comes with age)