spacer link to MAST page spacer logo image spacer
 
link to STScI page


Reading IMAPS Files Using
IUEDAC IDL Routines


The examples below use the IFITSRD routine from the IUEDAC library:

Raw Files

The raw files simply consist of a FITS primary header, and a primary array. The commands below will extract the spectral image from the gamma Cas file imaps1_0337.fits, and display the results.
ifitsrd,'imaps1_0337.fits',-1,h,e,image
tvscl,image

Coadded, Corrected Files

The coadded (i.e., stacked) data files consist of primary array header, a primary array, a binary table extension header, a single binary table row of 10 columns, an image extension header, and an image extension 2-dimensional array.

The first example shows how to use ifitsrd to read a corrected image of a gamma Cas spectrum, extract the wavelength information as an IDL structure, and use the IUEDAC program rdz to display wavelength and order number wherever the user points the cursor within the displayed image:

ifitsrd,'imaps1_337-339.fits',-1,h,e,image      ; extract corrected image
ifitsrd,'imaps1_337-339.fits',1,h,e,par,/struc  ; extract binary table fields
wav=fltarr(50,5)               ; prepare wavelength array for rdz
wav(*,0) = par.wavelength      ; starting wavelengths 
wav(*,1) = par.deltaw          ; wavelength increments
wav(*,2) = par.order           ; order numbers
wav(*,3) = par.yest            ; estimated y position of each order
rdz,image,wav

The above example uses an IDL structure to store the fields of a binary table in a single IDL variable. Separate variables can also be assigned to each field although knowing the format of the table helps one assign reasonable variable names. For example, the following command stores each field of the binary table as a separate variable:

ifitsrd,'imaps1_337-339.fits',1,h,e,w0,m0,x,y,g,nim,coe,order, $
         wavelength,deltaw,yest

Also, the following commands can be used to read the fpn1 array which is stored in an image extension following the binary table:

iuefhrd,'imaps1_337-339.fits',p,h,l,e
record = total(p(0:4)) + 1
ifitsrd,'imaps1_337-339.fits',0,h,e,fpn1,erec=record