2. Data Reduction Guide with IRAF Examples We thank John Carr (O.S.U.) for contributing the lion's share of these notes on CSHELL data reduction. John wrote nearly all of the following material on point source data reduction. Point Source Data Reduction Note: Data should have been taken in nod mode (AB or ABBA, object is in both A and B beams and nodding along the slit) 1) Flat Fields a) combine the flat-field images: e.g. IRAF function 'imcombine' with avgsigclip b) combine dark images: e.g. IRAF 'imcombine' c) flat = a) - b) : e.g. IRAF 'imarith' d) fix badpixels using the badpixel mask: e.g. use fix.cl IRAF script e) normalize the flat-field, producing a frame called 'normflat' 2) Object Data a) form differences A1-B1, A2-B2, ...B1-A1, B2-A2, ...: e.g. IRAF 'imarith' b) combine the differences for each beam to give an A image and a B image: e.g. IRAF 'imcombine' c) divide each by the normalized flat-field: e.g. IRAF 'imarith' d) correct for badpixels with the mask: e.g. use fix.cl IRAF script e) Examine the images for any additional bad pixels or other problems f) You may save disk space by stripping out NICMOS image areas where there is no data e.g. use strip.cl IRAF script 3) Do the same for the standard star data, if any. 4) Extract the Spectra The IRAF noao.twodspec.apextract package is well-suited to this. The three extraction steps can be done interactively at once with the APALL task (dispaxis = 1) : a) EDIT the aperture and width (and any background regions subtract) b) TRACE the aperture, defining its position as a function of position across the frame c) EXTRACT the one-D spectrum from the frame 5) Extract Calibration Spectra (based on spectral lamp data) Assuming n>=1 images with n>=2 lamp lines (often in different orders): a) combine the images to be used: e.g. IRAF 'imcombine' or 'imcopy' b) extract a calibration spectrum for each beam (A,B) such that the calibration data are extracted from the same part of the image as the object data. Do this using APALL, setting 'referen' and 'profile' to the object data image, and do not edit or trace the aperture. We now have 1-dimensional spectra 6) Wavelength Scale Data (using noao.onedspec IRAF tasks) a) for each line in calibration spectra, convert the line wavelength to the equivalent wavelength in that order (done in find_lines program) b) use 'IDENTIFY' to fit a wavelength scale to the spectrum c) use 'REFSPEC' to assign that wavelength scale to object spectrum (careful to apply the A calibration to the A spectrum, etc.) d) use 'DISPCOR' to produce a dispersion correct spectrum for each beam 7) Reduce the standard star data in the same way 8) Divide each object spectrum beam by the appropriate standard star beam 9) Combine All Spectra Since the A, B beams will have, in general, different wavelength scales, use the function 'COMBINE' (noao.onedspec IRAF task), which will resample the spectra and average them. This is the final spectrum. 10) Plot the final spectrum using SPLOT (noao.onedspec IRAF task), which can compute equivalent widths, display wavelenght and intensity units, etc. Extended Emission If your object is extended along the length of your slit, then the standard point source spectral extraction technique outlined above will probably not work optimally. First perform the frame arithmetic outlined in steps 1) - 3) above. Divide the object and standard star data by the normalized flat. Telluric correction: you may divide the flat-fielded object data by a flat-fielded standard star frame which has been artificially extended along the slit direction, but it is best to rotate the images first so that the slit is exactly perpindicular to the dispersion axis. Additional background subtraction can be done with BACKGROUND (IRAF noao.twodspec.longslit task), and then you should register all frames by moving them along the slit direction. IDENTIFY (IRAF noao.twodspec.longslit task) will allow you to measure the centroid of flux peaks interactively, and IMSHIFT (IRAF images task) allows you to shift the images to a common center. Combine all shifted images with IMCOMBINE (IRAF images task). What you do from here depends on what you want to get out of the data as well as its morphology.