================================================= 24/11/2008 IDL README: reading a FITS table in IDL ================================================= To read the STAGES catalogue into an IDL structure do the following: > cat = mrdfits(file, 1) cat: an IDL structure containing the data file: filename of the catalogue (including path), e.g. '/RAID5/marco/stages/gala/cat/stages_200308.fits' Note, MRDFITS is part of the astrolib (http://idlastro.gsfc.nasa.gov), which has to be installed separately. To check the column entries in the resulting structure: > help, cat, /struct To access individual columns, e.g.: > print, cat.nr > number = cat.nr To work with individual entries: > galaxy_magnitude = cat[5000].st_mag_galfit To work with several entries: > sample = cat[50:70].nr Note, blank column entries have special values depending on the variable type: -- int / long variables have an "undefined" value of -32768 / -2147483648 -- float variables have -NaN, which is represented in IDL as nan = !values.f_nan. NaN entries should be queried with the FINITE function, e.g.: no_hst_mag = where(finite(cat.st_mag_best) ne 1). Not trapping these might result in certain commands to produce unwanted results.