Filter offset wizard

First, apologies if this has been covered before. I searched the forum but didn’t see anything directly related.

Would anyone else find it useful to have a filter offset wizard, similar to the feature in CCD AutoPilot? I realize for many this may be a one and done operation, but it still requires manually switching filters and noting focus positions.

Would it be possible to have a wizard that will just go through each of the filters in the filter wheel, run the autofocus routine, calculate the offsets, and then populate the relevant fields in the filter section?

Dave

9 Likes

I’m not sure if it has been discussed here, but Ken and I have talked about adding this feature. I certainly think it would be useful.

Jared

1 Like

I agree that would be a useful feature.
When I look for offsets I make several AF runs per filter and rotate through the filters to help compensate for temperature shifts during lengthy process. It would be nice if the tool could do this and also have an option to choose how many AF runs per filter to do.
Andy

this wizard would be very nice.
Took me 5 hours to get consistent results last time i did it…

I’m glad its not just me. I too spent a few hours on this to get consistent results. I just got an FSQ106 and frequent focusing has been the norm, so having the autofocusing running as quickly as possible is worth the effort.

+1 on this. I would love to have a wizard. This is at least a one time per telescope and I’d probably trust results from Ken and Jared’s code than from my attempts to correct for temperature drift during the process.

I end up going Lum-Red-Lum-Red-Lum-Red-average; Lum-Green-Lum-Green-Lum-Gree-average; etc. then figuring the offsets between each Lum and its color filter, then the differences between each set of Lums, and doing more math to straighten it all out. There is certainly a much better way to do it!

Anyway, a filter focus offset wizard would be a very valuable addition.

  • Shane

You figure out the focus point for each filter from a base line. Like, I use my L filter and it focuses at step 3000. My red filter is at 2975. My blue filter is at 3025. I put those numbers in the filter dialog. I tell SGP to focus with my L filter. But, today the L filter focuses at 3010. It will offset to 2985 when I switch to my red filter.

Make sense?

Thank you Mad. I actually deleted my post while you were responding as I found the answer while browsing and realized it worked the way I wished it did. Thank you for your response anyways :slight_smile: You were just too fast for me.

1 Like

There’s one feature I would like to see! It would be awesome!

Even better than an offset wizard would be to simply have a checkbox that asks SGP to collect data (filter, position, temp) on each successful AF run and store them until further notice.

The idea would be to check this box and then set the AF to run after each frame for an entire sequence.

Afterward, a button next to the checkbox would trigger the calculation of both the focuser offsets and the temperature compensation ratio for the equipment. Better yet, the focus positions, offsets, and temperature compensation results would be used to automatically populate the appropriate fields in the Equipment Profile and also be saved in a plain text file for later use.

This is exactly the way TheSkyX works with @focus2. Of course I can’t see the code in TheSkyX, but it appears to be a very simple algorithm that performs a linear regression of all the focus positions for each filter against temperature. The average slope across all the regression lines is the temperature compensation ratio and the differences among the intercepts are the filter offsets.

1 Like

Replying to my own comment here …

As it turns out the required information for simultaneously calculating filter offsets and also temperature compensation coefficients is in fact already stored in the FITS headers of images saved by SGP. So until and unless SGP decides to implement automatic calculation of these critical numbers, it would appear be very easy to implement this as a “wizard” that could be applied to a night’s worth of saved images after the fact.

The procedure would be simple: set AF to run for every frame, and perform a sequence that includes every filter over and over throughout a night or across several nights that include a sufficient range of different focuser-recorded temperatures. Save the light frames for later analysis.

The “wizard” would then prompt the user for the directory containing the saved frames from the sequence. The wizard would simply read the FITS headers from each image, extracting just the filter name, focus position, and temperature. It would then calculate linear regression coefficients (slope and intercept) for focus position vs temperature for each filter.

At a minimum, such a simple wizard could report focuser offsets and a temperature compensation ratio. With a tiny bit more effort the wizard could also report an error bar for each coefficient (from the correlation, r-squared, and rms of the regressions) and advise the user as to whether additional data be collected. This might involve additional frames (more points) or a wider range of temperatures or both. In my experience the real data are very close to linear with minimal scatter, so just a few points for each filter across a range of maybe 5 C ought to be sufficient.

A really ideal wizard would also automatically populate the appropriate fields in the Equipment Profile.

In the meantime, until such a wizard exists in SGP, I’m going to write my own little post-processing script to do this. I can do this without any new features in SGP, since the program already records all the required data in the FITS headers and already allows AF after each 1 frame. Of course it would be extremely convenient if this feature was integrated into SGP and didn’t require the user to code it offline!

I will post my code on here, or if somebody can tell me a better place to post this, by all means please do.

Hello

I was searching the forums for how to save filter offsets within SGP and I came across your post. Did you ever write the script that you mention in this post? Would you be willing to share it with me?

Sure. There are actually three programs, attached below.

read.focus.data.R loops through all the fits files in a chosen directory and sucks out temp, filter, focuser position, and FWHM if available

analyze.focus.data.R fits regression lines for position vs temp for each filter, optionally weighted by FWHM

plot.focus.data.R plots the individual focus points and the regression lines for each filter vs temp

I’ve also attached an example of the program output that combines all my images from March 3-4 last year.

As you can see, my programming language of choice is R. R is free, open source, and available for Windows, Mac, and linux https://www.r-project.org/ If you want to do anything significant in R, you’ll probably also want RStudio, which is also free https://www.rstudio.com/ The programs could easily be translated into python or MATLAB or something else, but I have not tried to do that.

FYI, my results showed that my focuser was messed up, so your results should be much better than mine!

If you have questions or comments, I’d be happy to help .

Scott Denning

Oops … I see that the attachments didn’t make it into the forum.

Here are the three programs I use:

read.focus.data.R loops through all the fits files in a chosen directory and sucks out temp, filter, focuser position, and FWHM if available

analyze.focus.data.R fits regression lines for position vs temp for each filter, optionally weighted by FWHM

plot.focus.data.R plots the individual focus points and the regression lines for each filter vs temp

Here’s example output:

Thank you so much! I will get r-project set up on my computer and I can’t wait to try it out.

Again, Thank you!
Walter