Method for determining filter offsets


I’ve tried on a few nights now to figure out my NB filter offsets relative to Lum. I fail to get consistent results.

I’ve tried 2 ways. Run the AF routine such as: L,L,Ha,Ha,L,L,Ha,Ha…etc. since the temp is dropping constantly the numbers are always different. I’m not sure how to compensate for the temp change.

The other way was using a focus mask, noting the focus position with each filter and bumping the ‘fine focus’ button until proper focus was achieved. This method surprisingly was inconsistent as well.

I know there have been requests for a filter offset wizard, but what is the correct way to figure these darn offsets out?


SGP auto focus how does it work?
Parse the log file for focus positions?


The best (and fastest) method for offset tuning will almost always us a Bahtinov mask on a very bright star (dimmer stars will not create a visible pattern with NB filters). SGPro’s AF will occupy between 2 and 5 minutes per run and its results with NB filters are questionable.


Thanks Ken. When I was using the mask method, I noticed on bright stars that it’s hard to tell where the spikes actually are. I adjusted the visual histogram and exposure to see a better pattern to no avail. Using a dimmer star seemed to work better.

So just make slight tweaks using the focus module and note the position? Maybe my backlash settings need adjusting. I noticed that even though the focus position number was the same that it gave slightly different results depending on which direction the focus move came from (in or out)



You can also use the venerable “Bahtinov Grabber” software to remove error introduced through human perception.


Well, in my opinion it is best to try getting your offsets when the temp is
very steady and the seeing is good using SGP’s autofocus routine. A
bahtinov mask can work but I always found that to be less accurate. I well
know that those good, steady, clear nights are very hard to come buy, but
I’ve found calculating offsets on those nights is worth it in the end.

Other than that, I suggest taking L, Ha, L, Ha and averaging the two
filter’s positions. If you are getting wildly different focus positions
because the temp is dropping then I wouldn’t even bother to try and wait
for a better night…but that’s just me.

This hobby can be maddening waiting for the right conditions!


you can plot your data in excel and linear fit the two sets of data (focus position vs. time of capture for each filter). you should be able to reliably see what the offset is if you have 4-5 data points for each filter.



I typically set up a spreadsheet and then set the focus times to whatever is required for the filter in question. If I bin 2x2, that is typically 3-5 sec for Lum and 15 sec for Narrowband (5nm). I then wait until. the temp is farily stable and run 5 sets of Lum/Narrow for each filter. The spreadsheet then figures the (Lum - Narrow) difference for each set and takes the mean difference. If I get some major outliers, i will repeat that set. Tedious but works quite well.


Thanks for all the replies. I will try the spreadsheet method (although I am excel and spreadsheet ignorant, so I will probably do this long hand)

I tried this long hand before but I was having inconsistent results. Seems I was on the right track but the temperature was dropping to quickly and varied the results to much.

I also downloaded a focus mask ‘helper’ to try Ken’s method again.

Any more tips appreciated!

Thanks again



I used a Bahtinov Mask + Bahtinov Grabber (software) and an artificial star to set my narrowband filter offset.



I stopped trying to get reliable offsets in my long refractor… So now I just focus on each filter. I think its given me a more reliable focus, especially at times of changing temperatures.


Is the offset between 2 filters (say: Lum and Ha) always the same no matter the temperature? Or does the offset change between the 2 as conditions change?

Also, does anyone have a ready-made spreadsheet that I can just enter values into?

Thanks, all these replies are helpful


The offset should remain consistent between the filters regardless of the


I use a GoldFocus mask and their software. Once you calibrate the steps per pixel on their readout, it is very quick to get a pixel readout for each filter position and then translate that into motor steps.


There’s one trick I found very useful. SGP’s AF works very well for me even with narrowband filters, so I set up a sequence that rotates through LRLGLBLHaLOIIIILSII filters for a few times using 4x4 binned short exposures and SGP’s autofocus between each frame. The focuser values are stored in .fit headers, so I could just let the sequence run its course and then collect and average the results to a spreadsheet during the day. This way you don’t need to waste valuable sky time with manual SGP twiddling.


I endorse venhae’s method, which I use as well.

Set up a sequence with a set of good focus targets that span the night, then rotate through all your filters and do autofocus events all night long. I can take a couple hundred of these in one night. It’s best if temperature also drops steadily through the night.

All the focus positions and temperatures are saved in the FITs headers.

I’ve written a program in R that sucks the temp and focus positions out of the FITs headers and runs linear regressions for each filter.

The slopes of the lines are all the same, indicating the temperature compensation coefficient.

The different y-intercepts of each filter’s line give the filter offsets.

In my opinion, this is a much more robust way to get reliable temp coefficients and filter offsets than any manual procedure.

It would be wonderful to build such a simple statistical analysis into SGPro. I’d be more than happy to share my R program.


@airscottdenning I’m not familiar with “R” but is your program something
that can be shared easily? I’m very interested in your program.



Sure, I’m happy to send code on here, but maybe easier for you if I provide links to several text files.

R is a very widely used open-source programming language and statistical analysis package used by millions of people and available for Windows, Mac, and Linux. It’s quite common to use R with a wonderful IDE called RStudio. Both R and RStudio are completely free.

My code collects focus positions and temps from a night’s worth of .fits files, sorts them by filter, regresses position against temp for each filter, determines slopes & intercepts (temp coef and filter offsets), and makes a nice annotated plot. Optionally it can weight the data by FWHM and exclude poorly focused outliers.

There are three programs I use for my SGPro focus analysis:

When I have time, I plan to make an interactive website to do the focus analysis on my server from a users collection of fits files, and display the results in a web browser.

If you work for Main Sequence Software, please email me so I can help implement this in SGPro. It would be much easier to do this in your package rather than having to save all the files and then read them in later!

Scott Denning


This sounds awesome, thanks for making and sharing this!


Sounds fantastic…I know there will be quite a few of us with no programming /scripting skills whatsoever that will appreciate that.

Looking forward to seeing this come over the horizon.


Here’s an example of focus analysis for two nights this past spring. I discovered from this analysis that I have a mechanical problem with my focuser, and have since sent it off for repair.