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


Reading a raw data (pep) file with the IDL Astronomy User's Library routines

We start IDL and load the IDL Astronomy User's Library procedures as usual. The raw data consists of primary array header, a binary table extension header, and a number of rows of 6 columns of binary table data. The first thing we might want to do is examine the header, we might then want to look at program IDs or the tube used for a specific scan.

Let us say we are interested in the star epsilon Sco (which is star number 385). We down-load the raw data file c385.pep from the archive, and then we can read the extension header using the command fxbopen:

IDL>fxbopen,unit1,"c385.pep",1,header
IDL>openw,15,'header.txt'
IDL>writeu,15,header 
IDL>$more header.txt
XTENSION= 'BINTABLE'           / Extension type
BITPIX  =                    8 / Binary data
NAXIS   =                    2 / Binary table data
NAXIS1  =                  124 / Bytes per row
NAXIS2  =                   41 / Number of rows
PCOUNT  =                13621 / Bytes following last record (i.e. gap+heap)
GCOUNT  =                    1 / Only one group
TFIELDS =                   40 / Number of fields per row
THEAP   =                 5760 / Offset in bytes from start of data to heap     
EXTNAME = 'SCANS   '           / Extension header name
TTYPE1  = 'STAR_NUM'           / OAO-3 object number
TDISP1  = 'I3      '           / Recommended Fortran-90 display format
TFORM1  = '1I      '           / Count and data type
TTYPE2  = 'OBS_NUM '           / Nth observation for this object
TDISP2  = 'I2.0    '           / Recommended Fortran-90 display format
TFORM2  = '1I      '           / Count and data type
TTYPE3  = 'REC_NUM '           / Record number
TDISP3  = 'I5.0    '           / Recommended Fortran-90 display format
TFORM3  = '1I      '           / Count and data type
TTYPE4  = 'PGM_NAME'           / Program name
TDISP4  = 'A4      '           / Recommended Fortran-90 display format
TFORM4  = '4A      '           / Count and data type
          ...
          ...
          ...
TFORM29 = '1J      '           / Count and data type
TTYPE30 = 'STAND   '           / Background status anded
TDISP30 = 'I1.0    '           / Recommended Fortran-90 display format
TFORM30 = '1B      '           /

Now lets say we want to read the program names associated with each of the 41 scans for this star, then we would use the fxbread command:

IDL> fxbread,unit1,pgmname,4 
IDL> print,pgmname
EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07
EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07
EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07 EW07

We then see that all of the scans were taken as part of a single program (EW07). Similarly, we can get the tube name for all of these scans by looking at column 14:

IDL> fxbread,unit1,tube,14
IDL> print,tube   
U2 V2 V3 U3 U1 V3 U3 U2 V2 V3 U3 U2 V2 V3 U3 U2 V2 V3 U3 U2 V2
V3 U3 U1 V3 U3 U2 V2 V3 U3 U2 V2 V3 U3 U1 V3 U3 U2 V2 V3 U3



Example provided by jtl