SMARTS ECHELLE data reduction pipeline F. M. Walter 12/22/08 This pipeline is designed to reduce full chip 1.5m echelle images. It is written in IDL, and runs under version 6.0 and later. Because there is only one echelle setup, and it is reasonably (but not exactly) stable, you can forgo the tedious wavelength calibration if you want and use my wavelength fits. But you should do a wavelength calibration once, if only to see what I went through! I. Directory Setup Define the root directory for your data in your .cshrc file. For example, I use setenv s15e /raid1/DATA/SMARTS/1.5m/echelle/ You should place the data in subdirectories by day, eg, '081220' in the root directory. The data should be in smarts format - e.g *.zznn.fits, where zz is the target number (10+) and nn is the running observation number for that target (01 - 99). Zero images have zz=00 and PFLATS have zz=01 You should also have a subdirectory WAVCAL under the root directory. This contains the baseline wavelength solutions. These are included in the S/W distribution. You will need to have the IDL astronomy user's library in your path. When you run the pipeline, you can either A.) start in the data directory, or B.) specify the date and the program will find the data. II.) Running the Pipeline The name of the main procedure is e15_proc Run it from the root echelle directory call it as either e15_proc,date or e15_proc,/thisdir type e15_proc,/help for brief on-line help To process all the images, type e15_proc,/all To process the GSU images, type e15_proc,prog='gsu' (by default, only SUNY targets are processed) A directory named RED is created. All output is written to the RED subdirectory. That's all you have to do unless something goes horribly wrong... III.) OUTPUT A number of output files are generated and written to the RED subdirectory: - the flat image: flat.fits - the order traces: trace.fits - every input file has a corresponding bias-subtracted and trimmed file, *_t.fits - Multiple images of the same target are combined into a Tzz.fits file, where zz is the target number. This image is not flattened - The extracted and flattened spectra: Tzz_xf.fits format: 2046 x nord x ns, where nord is the number of orders, and ns is 0 (the net boxcar-extracted spectrum) 1 (the error on 0) 2 (the gross boxcar-extracted spectrum) 3 (the boxcar background spectrum) 4 (the gaussian-extracted spectrum) 5 (the corresponding background) - the extracted wavcal spectrum, Wzz_x.fits. This is not flattened format: 2046 x nord x ns, where nord is the number of orders, and ns is 0 (the extracted spectrum) or 1 (the corresponding background) - The extracted, flattened, wavelength-corrected spectra: Tzz_xfw.fits the data are linearized in wavelength The wavelength information is in the first (and only) fits extension format: main data block is the same as the Tzz_xf.fits file First extension: nord x 2 array containing the wavelength of the first pixel and the avelength interval per pixel, in Angstroms Note: depending on what orders fits are available, not all orders may have a wavelength solution. - the ICUR-format *.icd files. These are extracted and placed in a convenient format for input into ICUR. See http://www.astro.sunysb.edu/fwalter/ICUR/icur.html IV. WHAT THE PIPELINE DOES - median-combine the flats into the file 'flat.fits' - trace the orders in the flat file. The number of orders can be increased or decreased by altering the TCTS keyword. - trim and bias-correct all files. Output is *_t.fits I do not do any zero-point subtractions. - median-combine multiple images of a target into the Tzz.fits file. - extract the orders based on the trace of the flat file. The image is cross-correlated in the cross-dispersion direction to remove any residual shifts. I extract the orders two ways: - boxcar extraction. I extract the target spectrum and the flat "spectrum" , and divide those. - Gaussian extraction. This has the advantage that it can reject cosmic rays, but I do not know how to flatten Gaussian-extracted spectra. write the Tzz_xf.fits file. - extract the wavecal file into Wzz_x.fits - determine the order of each trace in the echelle from its Y location in the image. Cross-correlate the wavecal with the fiducial wavlength image to determine instrumental shifts. Apply the wavelength solution to the data. Linearize the data to a linear wavelength scale. Write the Tzz_xfw.fits file (order numbering is arbitrarily set so that order 30 contains the NaD lines) V.) Examining the Data The primitive way to read the fits file and plot the order of interest follows: ; i is the order number d=readfits(file,h) ;h is the header np=sxpar(h,'naxis1') wc=readfits(file,hwc,ext=1) ;hwc is the extension header w=wc(i,0)+wc(i,1)*findgen(np) ;this generates the linear wavelength array plot,w,d(*,i) The procedure pe15 (calling sequence pe_15,zz) can be used to plot the orders. It starts at some middle order; use the left or right mouse buttons to step through the orders in either direction. Or write your own. VII.) Doing your own wavelength solution. The line list is WAVECAL/thar.lin You will use ewavcal to generate a solution. Type ewavcal,/help for brief on-line help. I may provide more substantial directions later. VII.) The Distribution Download http://www.astro.sunysb.edu/fwalter/TMP/echdist.tar.gz This contains two tar files. - s15echpros.tar contains all the IDL procedures you'll need (plus a whole lot that you won't). Place these somewhere in your IDL path. - wavecal.tar is the WAVECAL directory you'll want for doing the wavelength calibrations. Place it in your root directory. VIII.) CAVEATS It works for me, but remember that you get what you pay for! The wavelength solution seems stable with an RMS of about 0.3 km/s from about 40 observations of the interstellar Na D lines taken over about 8 months. Please direct all complaints, criticisms, and even accolades to me at fwalter@mail.astro.sunysb.edu ----------