Autofocus after HFR drops

I know that, there is no possibility to trigger autofocus routine after HFR drop by % or at absolute value of HFR (btw. which will be a great option in the future).

But… is there a possibility to “make” such an option using scrpits?
I will be gratefull for any opinion.

Best wishes and clear skies.

Why is it not possible?

It is a function I am waiting too…

You could probably create something that reads the HFR from somewhere, not sure if it’s written in the logfile? If not you would most likely measure it from the FITS files.
A script could be used to trigger a macro to click the run autofocus button, it would of course have to be made failsafe to make sure it’s actually ran.
This can be done by using color detection in macro software.

Yes, that is exactly what i have in mind. I hoped that API has command similar to HFRValue.
i must study the logs to check if HFR is written there.

as far as i know there is API command to start focusing sequence, so there is no problerm with that. I must find HFR value and “read” it from log or elsewhere.

Thank you for feedback.

Because this funcion is so obivous and needed (much more then refocusing after few frames), if there was a possibility to implment it - it would be done long ago.


Because this function is so obvious and needed (much more then refocusing after few frames), if there was a possibility to implement it - it would be done long ago.

I really don’t think there is a technical reason to implement it… NINA has it…
I think its is not implement cause there are not enough user request…like many other useful features that never has been done

HFR can change for focus as well as seeing. If you’re waiting on it to change due to focus then you’re going to be throwing out some amount of frames. If you’re waiting on it to change due to seeing then you’re not going to achieve any better focus.

Short story is that triggering a focus based on HFR is not really that great of an idea. It seems like it is on the surface but using temperature is a MUCH better idea as temperature is actually what causes focus to shift by a meaningful amount.

The potential exception to this would be an SCT that his mirror flop. And then it would be better to focus based on slewing rather than wasting whatever your exposure time is to know that your HFR has changed.


1 Like

I understand your point Jared, but I will give you an example when the temperature change is not useful.

I sometimes experience very quick AIR temperature changes of up to 2degrees in 15minutes or less. This automatically triggers my autofocus even when the OTA hasn’t even noticed the temperature change and I could go on imaging with the same HFR value for a while. So the autofocus routine has been triggered for nothing.
I know, I could measure the OTA temperature but almost every motorfocus control has a sensor to measure AIR temperature and not OTA temperature. There 2 exceptions (Teleskop Austria and forgot the other) but I don’t like the package.

And to clarify, we are NOT talking about triggering autofocus above a certain absolute HFR value, we want to trigger autofocus with a HFR CHANGE, this if for example (Last HFR) - (average of N previous HFR) > X%. So if your HFR value changed above X% it will autofocus ONE time until it changes again. I do not understand why this NOT a good idea…


Thanks Martin, that is exactly what I have in mind.

That is where we don’t agree. Apart from what Martin said earlier, my scope has a different thermal reaction when temperature drops from +20C to +18C (i have 2C autofocus trigger) than from 0 to -2C.
What about situation when temperature drops by 1.8* - HFR changes to worse but autofocus routine will no be launched. Ok - i can set from 2* diff to 1,5 or 1* diff but then autofocus will start for nothing (sometimes) and waste time.

When AF will be triggered by ACTUAL HFR drop (like Martin said - % diff from average from x frames) then we will be sure that this AF is needend and it is not triggered by cold wind, sudden temperature drop (scope will not feel it at all) and many other relative conditions.

I ask myself this: Do I refocus when i see temperature drop? No… I refocus when i see that stars are out of focus and my FWHM/HFR/HFD drops (not once, but continuously).

I hope I made myself clear :slight_smile:

Best wishes and clear skies to all :slight_smile:

I asked (among others) for this years ago. I got the same response you got. It’s never going to happen. I see this as a valuable option.
I think NINA has it.

“HFR drop” -> HFR increase

We can’t be sure, unfortunately. I agree with Jared that it is not as easy as it seems. We can treat the measured HFR values as samples from a random variable that has a variance depending on factors such as seeing, focus quality, the number of stars in the estimate, mount movement, etc. As such, comparing a single (noisy) HFR measure (the latest value) against the mean of the previous values will sometimes result in false-positive autofocus triggers. For large fields of view with a statistically robust sample of stars the HFR measures should be reasonably accurate but for narrower fields of view with few stars the measures will be quite noisy and thus autofocus triggers will occur even if the image is at best focus.

I’m not arguing that an “autofocus after % change in HFR” option would not be useful to have in SGP, but the problem of false-positive triggers needs to be carefully considered before implementing it. Perhaps something like comparing the last X HFR measures to the last Y measures, where X << Y, may help reduce any false-positive triggers.

ASTAP can be easily called to measure and return HFD and number of detected stars for the latest image download, so it should be easy to easily “roll-your-own” AF trigger if you can find a way to programmatically press the SGP autofocus button.



Thanks for reply @Ross_Walker .
I agree with you that this method sometimes will trigger false positive AF routine… but
temerature method does it too… when chill wind comes, temperature drops on the sensor for a minute, AF will be trigger.

It is crucial that this “HFR drops/inrease” routine must be optional, like AF after a few frames or temperature drops. When somebody don’t want to use this method, then simply don’t use it.

again - when somebody want to use this method, then must accept some false-positive readings. Thants all.

I know that NINA has this funcion, but I love SGP and I want to use every option available to stay with SGP - that’s why I wrote here.

In my opinion, when @Jared will say that he will not add this funcion it will close this topic.