fmodcomm -- Operates upon an input FITS file by modifying the text of commentary keywords in the header of the primary array or an extension.
fmodcomm infile[ext#] template newtext
This task modifies the text in any of the three commentary keywords (COMMENT, HISTORY, or <blank>) in the header of the input FITS file. A unique substring (plus its keyword type) specifies the particular line to be modified. If two or more lines are identical, then a match to the first line can be forced by setting the "firstmatch" parameter. New text provided by the user replaces the original text. If the new text is too long to fit on a single line, additional lines of the same keyword type are inserted. New text (up to 99 lines) can be read in from a file via the @filename convention.
1. Modify the myfile.fits file which contains the following record in the primary array header to correct the date to 1995:
COMMENT Data derived from AJ 109, 1697 (1994)
ft> fmodcomm myfile.fits+0 "AJ" "Data derived from AJ 109, 1697 (1995)"
This will find a COMMENT line in the primary array header containing the substring "AJ" and replace that line with "Data derived....(1995)"
2. Modify the myfile.fits file which contains the following records in the first extension so as to sandwich additional text between them:
HISTORY Input PHA spectrum file = SCRABK.PHA HISTORY TASK: FEXTRACT on FILENAME: crabk.fits
ft> fmodcomm myfile.fits+1 "PHA spec" @tmp keytype=HISTORY
where the file named tmp contains:
Input PHA spectrum file = SCRABK.PHA This is an extra line of text So is this one And finally this one
yields:
HISTORY Input PHA spectrum file = SCRABK.PHA HISTORY This is an extra line of text HISTORY So is this one HISTORY And finally this one HISTORY TASK: FEXTRACT on FILENAME: crabk.fits
fthedit. fv, the interactive FITS file editor, can also be used to modify commentary keywords.