Enhancement: Add FITS Grader Score to FITS file as Keyword Value

Just found the FITS Grader - what a nice tool!

I’ve been following the PixInsight preprocessing steps outlined in this tutorial:

One of the more time-consuming steps involves computing a score for each subframe and then writing it into the FITS header of that file as a weight parameter for use with ImageIntegration. Search the tutorial for SSWEIGHT to see what I mean.

Could FITS Grader do this - write the score into the FITS header of each file as a new keyword, after it is graded?

That would automate something that takes an hour currently!

Thanks for having a listen and for a wonderful suite of tools.


1 Like


I’m not sure I’m understanding you correctly but PI’s SubframeSelector will write the score into the FITS header, using any keyword you choose.


Hi Bob -

Thanks for your reply. Yes, I know PI’s SubframeSelector can write the keyword value into the FITS file - but I don’t know of a way, other than manually typing in the results from the FITS Grader, to do it in an automated fashion.

What I’m suggesting is that the FITS Grader application, available here from Main Sequence Software, write the score it computes for a subframe into that subframe’s FITS header after it finishes scoring all the files in a folder (and optionally the subfolders).

Currently the FITS Grader can save the measurements to as CSV file, or rename the FITS Files to include the score in their filename. But the scores need to be in a FITS header field for ImageIntegration to use them as a weighting factor.

I don’t know of a way to have SubframeSelector automatically take the output of the FITS Grader and do this, but if there is, that would be great.

Automating this would save a lot of time.

Hope that makes it clear!



Yes, very clear now. I have a similar problem with the CALSTAT keyword when doing variable star work. I have to manually enter it, and the corresponding value, in each FITS file since PI doesn’t do it automatically when you calibrate subs. I use F4W2HDU ( freebie app) to do the editing. You might find it helpful but it is still a manual entry exercise.


Hi Bob,

I did come across F4W2HDU while doing a Google search. The manual editing would still take quite some time.

I’ve been looking for an excuse to learn Python, since the data from FITS Grader is in a CSV file, it wouldn’t be terribly hard to write a standalone script that read the CSV file and used that information to open the file, insert the score as a FITS keyword, and close the file. Small matter of programming… and finding the time to learn Python!


I just tested the FITS Image Grader for the first time and this request came to mind immediatelly. Is there any news if this is possible to implement?

+1 for this request. Would be a great add


1 Like