kwmod
This task modifies a single keyword value in a FITS file. One may modify
every header in which the keyword exists, or just a single header. One
may process a single FITS file, or a wildcarded set of FITS files. This
is a simple command line task with minimal overhead.
The command takes three required arguments: the name of a FITS file (or
a QUOTED wildcarded filemask), the name of the FITS keyword to be modified,
and the value for that keyword. Two optional arguments provide the
capability to specify the datatype of the keyword (-t), and to specify
an extension other than the primary header.
The input file is updated.
Usage:
kwmod filespec keyword value [-t datatype] [-e extension]
Context
Inputs
- filespec: the name of the FITS file to be modified. This may be wildcarded
only if the filespec is then quoted with (").
- keyword: the name of the keyword to be modified. The limit is, of
course, 8 characters.
- value: the new value for the keyword. If it is a string, and the
string includes spaces or other special characters, then the string must
be quoted.
- -t datatype: this is an optional switch (c,s,i,f,d,b: character, string,
integer, float, double, boolean) to force the task to interpret the value in a certain
way. This is usually not required since the task will parse the value
if this switch is not provided. Actually character (c) is equivalent to
string (s).
Note that if the value contains both a decimal point and the exponentiation
character (E or e), then it will automatically be typed as a double. However
if the value contains only a decimal point it will be automatically
typed as a float. This automatic behavior can be overridden with the
-t switch.
Valid boolean values are 'T' or 'F'.
- -e extension: this is an optional switch (all, or a number) specifying
the extension(s) you wish modified. If this is not specified, then the
primary header (extension 0) will be modified.
Outputs
The input FITS file will be updated in place.
Examples
kwmod j4w0b5byb_spt.fits APERTYPE SICS
This example will update the APERTYPE keyword to have the value
'SICS ' in the primary header of the spt file.
kwmod j4w0b5byb_spt.fits APEROFFX 0.000250
This example will update the floating point keyword APEROFFX
in the primary header of the spt file.
kwmod j4w0b5byb_spt.fits CENTERA1 512 -e all
This examaple will update the integer keyword CENTERA1 in
all headers of the spt file.
kwmod "*.fit" CENTERA1 512 -e all
This example will update the integer keyword CENTERA1 in
all headers of all spt files in the current working directory