ahmodhkext - merges the extensions of a FITS file together into a single extension
ahmodhkext.pl infile outfile keyword
This script merges several extensions of a FITS file 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 are sorted based on the value
of the column specified in the parameter 'sortcol'.
Each extension in the FITS file must have identical column formats and
must contain a keyword identical in all extensions.
The new extension contains an additional column.
This column is named from the parameter 'colname'; if 'colname' is empty the column
has the same name as the FITS keyword specified by the parameter 'keyword'.
The column is populated with the value of this keyword from the extension from which
the row was originally taken.
This column is added to every source extension.
- infile [file]
- Input file containing the multiple extensions 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 extensions to be merged.
The keyword name is used to name the new column in the merged extension.
The contents of that keyword populates the rows in the new column in the merged table.
If the parameter 'colname' is filled, the new
column is named with the content of ‘colname’.
- (colname = "TESTKEY") [string]
- Name of a new column in the merged extension.
If empty, the column is named, with the FITS keyword specified by the parameter 'keyword'.
- (inputext = "*") [string]
- Comma separated 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 containing 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 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)
- Merge two extension of a file into one extension. Each extension contain a commond keyword TESTKEY.
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
- 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'
July 28, 2016