Method for determining filter offsets

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.

3 Likes

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.

1 Like

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

Joel,

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!

Best,
Scott Denning
scott.denning@gmail.com

2 Likes

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.

@airscottdenning

Thanks for the ideas… pretty great implementation.

Moving to feature requests.

Great idea and I was thinking of doing something similar in Python, namely, reading the FITS Focus absolute data field and graphing that versus temperature since I need to get all my offsets for my filters - I am relatively new to SGP (and confess I am still a little confused as to when the auto focus routine runs versus just applying the offset. I will be able to work it out in three years when we next get a clear night :flushed: )
Is SGP written in Visual C++ or Ruby??? Should be quite easy to code that procedure @Ken @Jared ?

silly question, if I run an automatic series of focuses to compare different filters where do I find the .fits headers for each focus?

was a silly question and have found the answer by looking!!!

Great effort! I have downloaded and tried to run the files but stuck at the FITSio step… do you have a link for that ? All I could find is CRAN - Package FITSio - CRAN-R… is that the correct library ? and how do we install the libraries… Guess I need to learn R to have at least a basic understanding of things :frowning:

OK, I managed to install FITSio…now struglling to read the files with your read.focus.data script…

I’m happy to help you debug if you like. I’ve tried to include comments and use easy-to-understand variable names. Also tried to be as general as I could, but inevitably some of the code is specific to my situation.

Please feel free to email me airscottdenning@yahoo.com for help getting this to work.

1 Like

A what? Bahtinov Grabber? haven’t heard of it before.

“Methodd for determining filter offsets”
was reading this thread yesterday and saw Ken’s post saying that it was being moved to feature request, but that was a few years ago… did this ever make it to a working feature in SGP?

Please use Mikael’s SGP Auto Focus LogViewer, SGP AF Logviewer v1.2 Release .

Bernd

I just looked for AF logs and do not have any files in …\AppData\Local\SequenceGenerator\AutoFocusLogs folder. Do I need to turn on AF logging somewhere? I don’t see any setting so far…

SGP AF LogViewer evaluates the normal SGP logfiles. These can be found in the C:\users<user>\AppData\Local\SequenceGenerator folder (the files are named “sg_logfile_<date+time>.log”).

Bernd

thank you… I had just figured out that the AF logs are part of the SGP log files. I’ll give this utility a try. looks promising for what I’m trying to do.