NAME

fits2rdb - Converts FITS binary table to RDB table

SYNOPSIS

fits2rdb

  [ -i | --input the_input_FITS_filename ] 

  [ -o | --output the_output_RDB_filename ] 

  [ -e | --extname the_FITS_extension_name ] 

  [ -n | --extnum the_FITS_extension_number ]

  [ -m | --comment ]

  [ -c | --column column_name_to_include_in_output ]

  [ -r | --rcolumn regex_for_included_FITS_column_names ]

  [ -C | --vcolumn column_name_to_exclude_from_output ]

  [ -R | --rvcolumn regex_for_excluded_FITS_column_names ]

  [ -d | --defformat FITS_type=printf_style_format ]

  [ -f | --colformat column_name=printf_style_format ]

  [ -a | --arraysep array_element_seperator ]

  [ -t | --trim yes|no ]

  [ -T | --truevalue string_representation_of_true ]

  [ -F | --falsevalue string_representation_of_false ]

  [ -I | --invalidvalue string_representation_of_invalid ]

  [ -B | --byte str|num ]

  [ -x | --maxrows rows_per_read ]

  [ -h | --help ]
 
  [ -u | --usage ]

  [ -v | --version ]

  [ -V | --verbose ]

  [ the_input_FITS_filename ]

  [ the_output_FITS_filename ]

DESCRIPTION

fits2rdb converts a FITS binary table extension to an RDB table. Default behavior is to convert the entire table. The user may specify that only certain columns be converted and output using the --column, --rcolumn, --vcolumn, and --rvcolumn options. Column specifications are case insensitive; Output column names are all lowercase. For --rcolumn and --rvcolumn, the regular expressions are Perl5 regular expressions. See the pcre manpage for a description of the few exceptions.

The user may also specify that the FITS header data unit(HDU) be converted into RDB comments using the --comment option.

The input FITS file is specified via the --input option. To specify a particular FITS extension within the file, the user may provide the extension name and extension number via the --extname and --extnum options.

If the user is familiar with the Funtools IRAF-style bracket notation, it is possible to specify the file, extension, and filters with the --input option.

It is also possible to specify input and output filenames as non-option arguments on the commandline. To do so, simply specify the input name and, optionally, the output name.

Here are three commandlines illustrating the various syntax.

If no extension name is specified, fits2rdb searches for the first extension with the name EVENTS, STDEVT, or RAYTRACE. Failing that, it reopens the file and searches each extension until it finds a binary table. fits2rdb then processes the binary table.

The conversion is handled as follows:

If no column options are specified all columns will be output. If any column options are specified, only the columns matching the specification will be output.

If column options are present on the command line, output columns are are determined by building a list of column consisting of the columns specified with the --column and --rcolumn options, less the columns specified with the --vcolumn and --rvcolumn options.

If the --comment option is specified, FITS HDU keywords are output as RDB comment variables. Keywords are lowercased upon output. FITS 'COMMENT' and 'HISTORY' keywords are appended with '_XXX' where XXX is an integer specifying the order of the 'COMMENT' or 'HISTORY' keyword in the header. If the LONGSTRN keyword is present, fits2rdb will join lines which are continued across multiple FITS cards into a single RDB comment.

OPTIONS

fits2rdb uses a getopt style interface with POSIX syntax for command line options. Mixing option and non-option arguments is not allowed.

-i | --input the_input_FITS_filename | the_input_FITS_filename

Name of the FITS file. If --input equals 'stdin', input is read from STDIN. Defaults to stdin.

-o | --output the_output_RDB_filename | the_output_FITS_filename

Name of the output RDB file. If --output equals 'stdout', output is written to STDOUT. Defaults to stdout.

-e | --extname the_FITS_extension_name

The name of the FITS extension upon which to operate.

-n | --extnum the_FITS_extension_number

The number of the FITS extension upon which to operate.

-m | --comment

If specified, print the HDU keywords as RDB comment variables.

-c | --column column_name_to_include_in_output

Column name to select for output. --column may be specified multiple times with different values or may be a comma or whitespace seperated list.

-r | --rcolumn regex_for_included_FITS_column_names

Regular expression to match against column names in the binary table. --rcolumn may be specified multiple times with different values or may be comma or whitespace seperated list. The regular expression pattern matching is done using the same syntax and semantics as Perl 5. See the pcre man page for more info.

-C | --vcolumn column_name_to_exclude_from_output

Excludes the named column from the output table. --vcolumn may be specified multiple times with different values or may be a comma or whitespace seperated list.

-R | --rvcolumn regex_for_excluded_FITS_column_names

Excludes columns that match the regular expression from the output table. --rvcolumn may be specified multiple times with different values or may be a comma or whitespace seperated list. The regular expression pattern matching is done using the same syntax and semantics as Perl 5. See the pcre man page for more info.

-d | --defformat FITS_type=printf_style_format

Default output formats. The user may specify any FITS data type(A,E,I,etc...) and a printf style format string.

-f | --colfformat column_name=printf_style_format

Column specific output formats. The user may override the output formats on a column by column basis by specifying the column name and a printf style format string.

-a | --arraysep array_element_seperator

Seperator used when printing arrays. Defaults to ','.

-t | --trim yes|no

If set to yes(default behavior), trim leading and trail whitespace from RDB comments and table string fields. Otherwise, don't trim whitespace.

-T | --truevalue string_representation_of_true

Allows the user to set the RDB representation of a FITS logical field.

-F | --falsevalue string_representation_of_false

Allows the user to set the RDB representation of a FITS logical field.

-I | --invalidvalue string_representation_of_invalid

Allows the user to set the RDB representation of a FITS logical field.

-B | --byte str|num

Represent bytes as string(str) or numbers(num).

-x | --maxrows rows_per_read

Sets the maximum number of rows per read call. Setting this to a large number may speed reading of data up to a point. The default is 8192 rows read at a time.

-h | --help

Print just a list of options and exit.

-u | --usage

Print this usage info and exit.

-v | --version

Print version info and exit.

-V | --verbose

Print warnings about column matches that fail.

AUTHORS

M. Tibbetts ( mtibbetts@head-cfa.harvard.edu )