Using imageContainer to edit FITS keywords

edited January 2024 in PixInsight
Hi all,

Recently I have been using Filters while acquiring data, but the Filter "information" is not recorded during shooting (no filter wheel or anything).

So I want to add the FILTER keyword to the FITS header.  I know I could rename the files and use keywords in WBPP, but I'd also like the information  in the header.

I have been able to accomplish this using an ImageContainer and the FITSHeader process.  However, my complaint is that it creates a copy of all of the files, instead of "updating" with the new FITS Keyword.

Is there anyway to accomplish this without duplicating all of the image files?

Thanks,
-Matt

Comments

  • edited January 2024
    Three things.
    1. I have called this "bug" of ImageContainer previously (many times) on the official Forum.You should be able to overwrite files... but it simply doesn't do it for some reason.
    2. The easiest method is a python script... but that isn't a PI solution. If you use Python (or have it installed on your machine) I am happy to share it. Basically it just uses the capabilities of AstroPy to open and edit FITs headers. 
    3. I believe that BatchFitsKeywordEdit script does what you want. This is by @MikeCranfield. Perhaps we can prevail upon him to make a clobber method available (with a warning). Clobbering keywords and values across images isn't the worst thing- because if you make a mistake you can undo it as a batch as well. 

    I should probably do a video on #3 ... it comes up often enough.

    -the Blockhead

  • Another follow up.
    I spoke with Mike Cranfield. Currently his script will make copies of files- but I implored him to allow for the "correction" of files (clobbering). There are plenty of cases where adjusting keywords or values in situ make sense.

    This might be a quick adjustment for him... we will see!

    -the Blockhead
  • Thanks for the info.  I tried the "BatchFitsKeywordEdit" script, but indeed it makes copies of the files.  I do like his script better because it allows you to put keyword entries at specific locations.  

    Having the option to overwrite existing files would certainly get my vote...

    Thanks!
    -Matt
  • He is going to do it...
    likely released tomorrow.

    -the Blockhead
  • Ask and ye shall receive!  

    That's very cool.

    Thanks to you and @MikeCranfield
  • Version 2.1 now released allowing overwriting of existing files.
    CS, Mike
  • Excellent!! 
    Thank you Mike!!
    -the Blockhead
  • It works!

    Thanks Adam and Mike.  PixInsight is an amazing product, but support and knowledge sharing from people like you (and a host of others) is really what sets it apart.


Sign In or Register to comment.