Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
The routines in this directory are for reading and writing (disk) FITS binary table extensions. Access to FITS files is direct, rather than passing through intermediate file structures (such as SDAS/Geis). Some routines for reading and writing primary FITS files, and for reading and writing FITS tapes, are included to support writing binary tables. The various routines are:
FXREAD Read primary FITS file FXPAR Extract values from a FITS header
One thing that sometimes confuses first time users is that the logical unit variable UNIT is an output parameter of FXBCREATE, not an input parameter. One does not specify the logical unit number for the file; instead FXBCREATE assigns one via a call to GET_LUN. The returned value is then used by the other routines. A similar situation exists in regard to the column number argument to FXBADDCOL. Column numbers are assigned in the order in which FXBADDCOL is called. See the LaTeX file "fits_bintable.tex" for more information.
FXBOPEN Open FITS binary table extension for reading. FXBREAD Read data from FITS binary table. FXBCLOSE Close FITS binary table. FXBTDIM Parse keywords from binary tables with a TDIM-like format. FXBHELP Show information about the binary table columns. FXBFIND Find column keywords in header. FXBCOLNUM Returns the column number of a specified column. FXBHEADER Returns the header of an opened FITS binary table. FXBISOPEN Returns whether or not a FITS binary table is open. FXBSTATE Returns the state of a FITS binary table. FXBDIMEN Returns the dimensions of a binary table column.The same comment above about FXBCREATE and UNIT also applies to FXBOPEN.
In addition to the keywords described in the binary tables extension proposal, several additional keywords are supported by FXBADDCOL with the /VARIABLE keyword. Other than that, support for variable-length arrays is automatic. Some operations, such as reading entire columns, and the multidimensional array facility described above, are not allowed with variable-length arrays.
Ordinarily, the default THEAP value (NAXIS1*NAXIS2) is used to write the variable-length arrays. However, a different THEAP value can be used by using FXADDPAR to insert the desired value into the binary table header before calling FXBCREATE.
At present, there is no support for IEEE +/- Infinity and -0 special values. However, it would be a simple matter to add support similar to IEEE NaN.
Bit arrays (type "X" in FITS binary tables) are treated in IDL as byte arrays with approximately 1/8 the number of elements. Support for this is automatic when reading binary tables. Columns can be defined as type "X" when writing binary tables if the BIT keyword is passed to FXBADDCOL giving the number of bits, and the data array is of type byte. Dimension information is ignored for bit arrays, since the dimensions apply to the bits, and not to the bytes that IDL processes.
Logical arrays (type "L" in FITS binary tables) are treated in IDL as byte arrays. Support for this is automatic when reading binary tables. Columns can be defined as type "L" when writing binary tables if the /LOGICAL keyword is passed to FXBADDCOL, and the data array is of type byte.
To use the virtual column convention, the user must call FXBREAD with the /VIRTUAL keyword, and must also reference the desired information by name rather than by column number. FXBREAD will then look first for a column with that name. If it doesn't find one, it then looks for a keyword with that name in the header.
FXADDPAR | Add or modify a parameter in a FITS header array. |
FXBADDCOL | Adds a column to a binary table extension. |
FXBCLOSE | Close a FITS binary table extension opened for read. |
FXBCOLNUM() | Returns a binary table column number. |
FXBCREATE | Open a new binary table at the end of a FITS file. |
FXBDIMEN() | Returns the dimensions for a column in a FITS binary table. Explanation : This procedure returns the dimensions associated with a column in a binary table opened for read with the command FXBOPEN. Use : Result = FXBDIMEN(UNIT,COL) Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. COL = Column in the binary table to read data from, either as a character string containing a column label (TTYPE), or as a numerical column index starting from column one. Opt. Inputs : None. Outputs : The result of the function is an array containing the dimensions for the specified column in the FITS binary table that UNIT points to. Opt. Outputs: None. Keywords : ERRMSG = If defined and passed, then any error messages will be returned to the user in this parameter rather than depending on the MESSAGE routine in IDL. If no errors are encountered, then a null string is returned. In order to use this feature, ERRMSG must be defined first, e.g. ERRMSG = '' Result = FXBDIMEN( ERRMSG=ERRMSG, ... ) IF ERRMSG NE '' THEN ... Calls : FXBCOLNUM, FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: The dimensions will be returned whether or not the table is still open or not. If UNIT does not point to a binary table, then 0 is returned. If UNIT is an undefined variable, then 0 is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 4 March 1994. Modified : Version 1, William Thompson, GSFC, 4 March 1994. Version 2, William Thompson, GSFC, 21 June 1994 Added ERRMSG keyword. Version 3, William Thompson, GSFC, 23 June 1994 Modified so that ERRMSG is not touched if not defined. Version : Version 3, 23 June 1994 Converted to IDL V5.0 W. Landsman September 1997 |
FXBFIND | Find column keywords in a FITS binary table header. |
FXBFINDLUN() | Find logical unit number UNIT in FXBINTABLE common block. |
FXBFINISH | Close a FITS binary table extension file opened for write. |
FXBGROW | Increase the number of rows in a binary table. |
FXBHEADER() | Returns the header of an open FITS binary table. Explanation : This procedure returns the FITS extension header of a FITS binary table opened for read with the command FXBOPEN. Use : Result = FXBHEADER(UNIT) Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. Opt. Inputs : None. Outputs : The result of the function is a string array containing the header for the FITS binary table that UNIT points to. Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: The string array returned always has as many elements as the largest header read by FXBOPEN. Any extra elements beyond the true header are blank or null strings. The header will be returned whether or not the table is still open or not. If UNIT does not point to a binary table, then a string array of nulls is returned. If UNIT is an undefined variable, then the null string is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 1 July 1993. Modified : Version 1, William Thompson, GSFC, 1 July 1993. Version : Version 1, 1 July 1993. Converted to IDL V5.0 W. Landsman September 1997 |
FXBHELP | Prints short description of columns in a FITS binary table. |
FXBHMAKE | Create basic FITS binary table extension (BINTABLE) header. |
FXBINTABLE | Common block FXBINTABLE used by "FXB" routines. |
FXBISOPEN() | Returns true if UNIT points to an open FITS binary table. Explanation : This procedure checks to see if the logical unit number given by the variable UNIT corresponds to a FITS binary table opened for read with the command FXBOPEN, and which has not yet been closed with FXBCLOSE. Use : Result = FXBISOPEN(UNIT) If FXBISOPEN(UNIT) THEN ... Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. Opt. Inputs : None. Outputs : The result of the function is either True (1) or False (0), depending on whether UNIT points to an open binary table or not. Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: If UNIT is an undefined variable, then False (0) is returned. If UNIT points to a FITS binary table file that is opened for write, then False (0) is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 1 July 1993. Modified : Version 1, William Thompson, GSFC, 1 July 1993. Version : Version 1, 1 July 1993. Converted to IDL V5.0 W. Landsman September 1997 |
FXBOPEN | Open binary table extension in a disk FITS file for reading or updating |
FXBPARSE | Parse the binary table extension header. |
FXBREAD | Read a data array from a disk FITS binary table file. |
FXBREADM | Read multiple columns/rows from a disk FITS binary table file. |
FXBSTATE() | Returns the state of a FITS binary table. Explanation : This procedure returns the state of a FITS binary table that was either opened for read with the command FXBOPEN, or for write with the command FXBCREATE. Use : Result = FXBSTATE(UNIT) Inputs : UNIT = Logical unit number returned by FXBOPEN routine. Must be a scalar integer. Opt. Inputs : None. Outputs : The result of the function is the state of the FITS binary table that UNIT points to. This can be one of three values: 0 = Closed 1 = Open for read 2 = Open for write Opt. Outputs: None. Keywords : None. Calls : FXBFINDLUN Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more information. Restrictions: None. Side effects: If UNIT is an undefined variable, then 0 (closed) is returned. Category : Data Handling, I/O, FITS, Generic. Prev. Hist. : None. Written : William Thompson, GSFC, 1 July 1993. Modified : Version 1, William Thompson, GSFC, 1 July 1993. Version : Version 1, 1 July 1993. Converted to IDL V5.0 W. Landsman September 1997 |
FXBTDIM() | Parse TDIM-like kwywords. |
FXBTFORM | Returns information about FITS binary table columns. |
FXBWRITE | Write a binary data array to a disk FITS binary table file. |
FXBWRITM | Write multiple columns/rows to a disk FITS binary table file. |
FXFINDEND | Find the end of a FITS file. |
FXHCLEAN | Removes required keywords from FITS header. |
FXHMAKE | Create a basic FITS header array. |
FXHMODIFY | Modify a FITS header in a file on disk. |
FXHREAD | Reads a FITS header from an opened disk file. |
FXPAR() | Obtain the value of a parameter in a FITS header. |
FXPARPOS() | Finds position to insert record into FITS header. |
FXREAD | Read basic FITS files. |
FXWRITE | Write a disk FITS file. |
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]