NAME

ahmodhkext - merges the extensions of a FITS file together into a single extension

USAGE

ahmodhkext.pl infile outfile keyword

DESCRIPTION

This script provides a tool that merges the extensions of a FITS file together into a single extension. The new extension is appended to the end of the FITS file. In addition to merging, rows in the new extension will be sorted based on the value of the column specified in the paramter 'sortcol'.

The new extension will contain an additional column. This column will be named from the parameter 'colname'; if 'colname' is empty then it will have the same name as the FITS keyword specified by the parameter 'keyword'. The column will be populated with the value of this keyword from the extension from which the row was originally taken. This column will be added to every source extension.

Assumptions

Each extenstion in the FITS file that will be merged must have identical column formats.

Each extension is expected to have a keyword of the same name which will used to be label data from that extension.

PARAMETERS

infile [file]
Input file containing the multiple extensions that will be merged into one extension.

outfile [file]
Name of desired output file. If this is the same as infile, and if clobber is 'yes', the old file will be rewritten.

keyword [string]
Keyword in each extension to be used to label data from that extension. This keyword must be present in all source extensions to be merged. The keyword name will be the name of a new column in the merged extension, and the contents of that keyword for each extension will populate the respective rows in the merged table. If the parameter 'colname' is filled, that will be the new column name in the merged extension, not the name of this keyword.

(colname = "TESTKEY") [string]
This will be the name of a new column in the merged extension. If this is empty, the column will have the same name as the FITS keyword specified by the parameter 'keyword'.

(inputext = "*") [string]
Comma seperated list of names of the extensions to process and merge. All extensions may be selected by using the asterisk ('*')

(outputext = "TARGETEXT") [string]
Name of the new extension that will contain the merged data.

(valuecol = "") [string]]
A list of values to populate the new column in the merged extension. There must be one entry for each respective source extension. If this parameter is filled, the new column is not populated with data from the 'keyword' parameter.

(tform) [boolean]]
Format of column to be created, default 'A'

(sortcol = S_TIME) [string]]
Name of column to sort resulting FITS file on.

(cleanup = yes) [boolean]]
Remove temporary files that were created in the process of merging the extensions. (yes/no)

(deletekey = yes) [boolean]]
Remove the keyword specified in the 'keyword' parameter from each source extension. (yes/no)

(clobber = no) [bool]
Overwrite existing output file (yes/no)

(chatter = 1) [int]
Chatter level for output

(logfile = !DEFAULT) [string]
Name of the log file. Special values are DEFAULT and NONE for the default file name or no log file. The default is the name of the tool with a .log extension. For example, if running ahmodhkext, the default log file will be called ahmodhkext.log. If the parameter is set to an empty string, an error will be generated. If the parameter begins with an exclamation point (!), any existing log file with the chosen name will be overwritten; otherwise new log information is appended to any current file.

(debug = no) [bool]
Debug mode enabled (yes/no)

(mode = ql) [string]
Mode of automatic parameters (h/hl/q/ql)

EXAMPLES

  1. Merge two extension of a file into one. The value of the TESTKEY keyword in each extension is copied into a column named TESTKEY in the new merged extension. The merged extension is named TARGETEXT. The keyword TESTKEY is not deleted in the source extensions, although it is moved to the end of each header.
               ahmodhkext.pl in.fits out.fits inputext='EXT2,EXT3' outputext=TARGETEXT keyword=TESTKEY deletekey=no
          
  2. Merge two extension of a file into one. The merged extension is named TARGETEXT. The new columns is named NEWCOLUMN. In NEWCOLUMN, every row that came from EXT1 will have the value 'aa', and every row that came from EXT2 will have the value 'bb'.
               ahmodhkext.pl in.fits out.fits inputext='EXT2,EXT3' outputext=TARGETEXT colname='NEWCOLUMN' valuecol='aa,bb'
          

LAST MODIFIED

October 21, 2014