Please let me know any comments/feedback/bugs.
I appreciate that a Batch FITS keyword editor has been programmed. I briefly tested your script (Windows 10 Pro, PixInsight 1.8.8-9). It takes into account that HDUs require multiples of 2880 Bytes (this was apparently an obstacle for other trials to implement the addition of keywords).
However, the script changes some things that were not asked for. I wanted to just add one FITS keyword:
XPIXSZ 3.78 Pixel Width in microns (with binning)
to a FITS file that already contained 35 FITS keywords. The resulting FITS file contains 46 FITS keywords, and is larger by 112600 Bytes (a thumbnail image) than the original file. The following keywords were added:
EXTEND (together with 2 COMMENT keywords)
PROGRAM (together with 2 COMMENT keywords)
COLORSPC
RESOLUTN
RESOUNIT
THUMBIMG
ROWORDER
Besides the keyword
CREATOR, which was written by the capture software, was deleted.
In my view it is not negative that software which is used to modify files leaves its mark (PROGRAM and 2 COMMENT keywords). I don't mind that the keyword
COLORSPC is added as well. However, the keywords
RESOLUTN and
RESOUNIT are unnecessary, and it was not required at all to append a thumbnail image. I understand that the keyword
ROWORDER should be written only by the capture software. Finally, in no case a keyword should be deleted unintentionally.
Otherwise, the script seems to be very useful to me. Perhaps you can consider my request for changes?
Bernd