Single-line autofocus summary in SGP log file

Please consider an easy “feature” update: summarize the autofocus data on a single line in the log file so that analysis programs can easily extract them.

What I need from every successful autofocus:
focus position, temperature, filter, HFD

Please label the line in the log file clearly as "SUCCESSFUL AUTOFOCUS"

Rationale:

As many people have pointed out over the years, temperature compensation and filter offsets can be hard to nail down due to one-off events (clouds, fast temp shifts, nonlinear behavior).

In a couple of years of testing, I’ve found that combining data from dozens or hundreds of autofocus results allows robust extraction of temperature compensation and focus offsets, especially if focus is sampled over a large range of temperatures (wider than typically seen on a given night). The idea is to collect data from periodic autofocus over a period of weeks or months, then analyze the focus system behavior using a statistically representative data set.

Even better would be to write these data to a separate text file that accumulates data over time, and to build in the temp comp and filter offset analysis logic to work with the focus system in SGP. This way the focus compensation would improve over time without having to edit the coefficients directly in the Control Panel or Equipment Profile.

Please see the attached plot for an example of the kind of analysis we can easily do if we could just grep the relevant lines from the log file.

Thank you!
Scott Denning

1 Like

+1. Excellent suggestion.

This is a wonderful suggestion.
I have developed a process for extracting this data. However, it is a multi-step, cumbersome process. It would be great if the log just gave this info on a single line, comma delimited so it would be imported into a database.

An additional easy and very useful enhancement would be to the include this same data on the jpg plot of the focus run.

A few additional thoughts which might be folded into the larger thread on improved autofocus in SGP4:

Minimal request is for single line for each successful autofocus in log file containing
Timestamp Filter Temp FocusPosition HFD

Users can then extract just those lines from many logfiles over time build a robust focus model for each setup.

The reason we need HFD is to use as a “weight” when running a linear regression of foes position against temperature. Better-focused images “count more” in computing the temperature coefficients. Might also include some kind of metric from the autofocus routine like goodness of fit of the v-curve.

A much better solution that would be a bit more work for developers would be to accumulate these data in a separate database or file which would be used by SGP4 itself to build and improve a robust focuser model over time (weeks or months).

I’ve attached my own focuser model built with a OSC camera (ASI094c) over the past few weeks. This is with a Borg 125SD f4, and Optec FocusLynx with temperature probe taped onto the OTA. Focus steps are 1.2 microns and the CFZ is just 38 microns = 32 steps!

Notice that the temp range is about 25 C! (temp range of 45 Fahrenheit) I could never have gotten such a wide range of successful autofocus temps over a single night. That’s key to getting a robust estimate of the temperature response of the focusing system.

Also notice the wide scatter in focus positions around -8 to -9 C. This was due to passing high clouds that interfered with the SGP autofocus routine (different sets of stars averaged for each focus exposure as clouds passed by). Other sources of error include mechanical issues in the extreme cold and differential expansion of different components during periods of rapid temperature change. Just grabbing a pair of these measurements would potentially get the temp compensation factor wrong by a factor of 10!

All of the above-mentioned issues give the impression that the temperature response is nonlinear or unpredictable/inconsistent when performing the recommended procedure of just taking two focus measurements a few degrees apart. Yet those impressions are WRONG as shown by the remarkable fit over many nights explaining almost 90% of the variance in focus and nailing the temp coefficient within a few steps.

This simple example is for a one-shot-color imager. For LRGB or any filter wheel setup, we also need to record which filter is used for every successful autofocus event (and we need lots more data!). The procedure is then to obtain separate regression lines for each filter. Temp comp is the average slope of those regression lines, and filter offsets are the differences in intercepts (each filter intercept minus Luminance).

I use a sophisticated “robust linear model” routine in R to iteratively obtain a slope and intercept that are not sensitive to outliers. With enough data spread over a wide enough range of temperature this wouldn’t be a problem, but you’d need to collect a LOT of data, especially if you also wanted to get 4 to 8 filter offsets!

In summary:

1) please give us [filter timestamp temp focusPosition HFD] on a single searchable line in the log file following every successful autofocus; and

2) consider saving these data yourselves over weeks or months and having SGP’s focus module build and improve a robust linear model of focuser behavior that can be reliably used to interpolate focus positions between widely-spaced autofocus runs

1 Like