A generalized FITS reader, IFITSRD.pro (see also Section IV)
a. To read headers and primary array file arr.fit:
Store main header in string array "mheader", extension header
in "exheader" and primary data array as "arr":
IDL> ifitsrd,'arr.fit',-1,mheader,exheader,arr ; read primary array
b. To read headers and image extension data as eps from same file:
IDL> ifitsrd,'arr.fit',0,mheader,exheader,eps ; read image extension
In general, 'ifitsrd' calls 'iuefhrd', which lists all the parameter fields
in the binary table (this may be as many as 20, but is usually less than this).
Including even one of the p-fields (e.g. "p1") in the command will resulting
in a listing of all these fields. Thus the action of reading the file will
give the user the correspondence between the p-fields and the arrays or scalar
values they represent.
c. Reading of data arrays.
Assume "guess.fit" has a primary array, an image extension and a binary
table extension. Write the headers and the first 5 columns from the
first 2 rows of the binary table, assuming the binary extension data
starts in record 12:
IDL> ifitsrd,'guess.fit',[1,2],mhead,exhead,p1,p2,p3,p4,p5,erec=12
Note that one uses "ifitsrd" for either for image (SILO/SIHI) or extracted
data files. Because "ifitsrd" is a generalized reader, it addresses arrays
by their running row numbers.
FITS-reader for NEWSIPS extracted spectral data arrays, READMX.pro
"readmx" reads IUE merged extracted spectra (MXLO, MXHI) and returns
the primary FITS header, wavelengths and absolute fluxes. The nu flags,
net, background, and ripple-corrected fluxes may be optionally returned.
a. To read a low-dispersion image:
IDL> readmx,'swp32525.mxlo',main,wave,flux,flags,sigma,bkgrd,net
b. To read the region of a high dispersion spectrum contiaining MgII:
IDL> readmx,'lwp12345.mxhi',head,wave,flux,quality,sigma,wrange=[2790,2810]
c. To read echelle orders 100--103 of this image:
IDL> readmx,'lwp12345.mxhi',h,wave,flux,quality,sigma,orange=[100,103]
Notice that because "readmx" is written for IUE data, it recognizes echelle
orders or wavelengths rather than row numbers.