[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


TBGET Source code in tbget.pro

TBGET

Name
       TBGET
Purpose
       Return value(s) from specified column in a FITS binary table
Calling Sequence
       values = TBGET( h, tab, field, [ rows, nulls, /NOSCALE] )
               or
       values = TBGET( tb_str, tab, field, [ rows, nulls, /NOSCALE] )
Input Parameters
       h - FITS binary table header, e.g. as returned by FITS_READ
                       or
       tb_str - IDL structure extracted from FITS header by TBINFO.
               Use of the IDL structure will improve processing speed
       tab - FITS binary table array, e.g. as returned by FITS_READ
       field - field name or number, scalar
Optional Input Parameters
       rows -  scalar or vector giving row number(s)
               Row numbers start at 0.  If not supplied or set to
               -1 then values for all rows are returned
Keyword Parameters
       /NOSCALE - If this keyword is set and nonzero, then the TSCALn and
               TZEROn keywords will *not* be used to scale to physical values
               Default is to perfrom scaling
       CONTINUE - This keyword does nothing, it is kept for consistency with
               with earlier versions of TBGET().
Output Parameters
       the values for the row are returned as the function value.
       Null values are set to 0 or blanks for strings.
Optional Output
       nulls - null value flag of same length as the returned data.
               Only used for integer data types, B, I, and J
               It is set to 1 at null value positions and 0 elsewhere.
               If supplied then the optional input, rows, must also
               be supplied.
Example
       Read the columns labeled 'WAVELENGTH' and 'FLUX' from the second
       extension of a FITS file 'spectra.fits' into IDL vectors w and f
       IDL> fits_read,'spectra.fits',tab,htab,exten=2   ;Read 2nd extension
       IDL> w = tbget(htab,tab,'wavelength')
       IDL> f = tbget(htab,tab,'flux')
Note
       (1) If the column is variable length ('P') format, then TBGET() will
       return the longword array of pointers into the heap area.   TBGET()
       currently lacks the ability to actually extract the data from the
       heap area.
       (2) Use the higher-level procedure FTAB_EXT (which calls TBGET()) to
       extract vectors directly from the FITS file.
       (3) Use the procedure FITS_HELP to determine which extensions are
       binary tables, and FTAB_HELP or TBHELP to determine the columns of the
       table
Procedures Used
       IS_IEEE_BIG(), TBINFO, TBSIZE
Revision History
       Written  W. Landsman        February, 1991
       Work for string and complex   W. Landsman         April, 1993
       Default scaling by TSCALn, TZEROn, Added /NOSCALE keyword,
       Fixed nulls output, return longword pointers for variable length
               binary tables,     W. Landsman  December 1996
       Added a check for zero width column  W. Landsman   April, 1997
       Add TEMPORARY() and REFORM() for speed  W. Landsman  May, 1997
       Use new structure returned by TBINFO    W. Landsman  August 1997
       Converted to IDL V5.0   W. Landsman   September 1997
       Add IS_IEEE_BIG(), No subscripting when all rows requested
                               W. Landsman    March 2000
       Use SIZE(/TNAME) instead of DATATYPE()  W. Landsman October 2001
       Bypass IEEE_TO_HOST call for improved speed W. Landsman November 2002
       Cosmetic changes to SIZE() calls W. Landsman December 2002
       Added unofficial support for 64bit integers W. Landsman February 2003
       Support unsigned integers, new pointer types of TSCAL and TZERO
       returned by TBINFO   W. Landsman        April 2003
       Add an i = i[0] for V6.0 compatibility  W. Landsman  August 2003

Last modified by pro2html on 2004 February 26 at 04:51 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically