fedithead  Richard J. Mathar
Fitsheaderkeywordbatcheditor
 All Classes Files Functions Variables Macros
Functions
fedithead.cxx File Reference

Functions

void usage (char *argv0)
 Print a usage syntax message detailing the command line.
 
int main (int argc, char **argv)
 Fedithead is a standalone program which edits FITS header data following directions from a configuration file.
 

Function Documentation

void usage ( char *  argv0)

Print a usage syntax message detailing the command line.

Parameters
[in]argv0The name of the main program.
Since
2012-10-18
int main ( int  argc,
char **  argv 
)

Fedithead is a standalone program which edits FITS header data following directions from a configuration file.

An optional argument -v triggers a detailed message of the program for each keyword changed.

The first command line argument is the path/file name of an existing FITS file which is to be modified.

The second argument and optionally further arguments are ASCII files structured very similar to the template files used with cfitsio and fmodhead.

Each of these may contain empty lines and comment lines (starting with #) that have no effect.

It may contain lines starting with the dash (-) that demand removal of the keyword from the FITS header. (If that keyword does not exist this does not have any effect.) The keyword may have regex expressions to deal with a group of keywords at once.

It man contain lines that embed two keyword names between colons (:) or between exclamation marks (!), so there are three of these delimiters in that type of line. (This is a syntactical extension to template files of fmodhead, fedithd and the cfitsio templates). Fits header cards with names matching the regular expression delimited by the first two colons have their names substituted by the substitutional expression between the 2nd and third colon. (Values and comments remain as they are).

It may contain lines that start with at least 8 blanks. The rest of these lines is turned into COMMENT lines that are appended to the FITS header.

Finally, all other lines are interpreted as keyword-value-comment triples in FITS header style (with = and / as delimiters), that trigger adding that card to the header. (Existing keywords with the same name are removed).

Example file (see also the fmodhead examples in the source distribution:

# delete CHOP_A and CHOP_B

-CHOP_[AB]

# replace RHUM by a hierarchical version

:RHUM:HIERARCH LN AMBI RHUM:

# rename enumerated wheels to filters

:WHEEL(\1):HIERARCH LN ICS FILT\1:

# add a OBSERVAT keyword

OBSERVAT = "LBT" / on the mountain

# add a comment

Nice observation conditions. Dry with occasional snowflakes.

Parameters
[in]argcThe number of command line switches and arguments.
[in]argvThe vector of all command line arguments.
Returns
0 if the file manipulation was successful.
Since
2012-10-18
2013-10-30 Support more than one template header file.