Aperture Extraction in IRAF
Notes and suggestions based on my experience reducing slit spectroscopy.
Apall Parameters
The "apall" task has an enormous number of parameters. I tend to set all the yes/no options on the first page to "yes" the first time I find apertures for a particular data set. Other parameters you may want to set, depending on your data (either before running or while running interactively) are:
- line — Defaults to the center of the image. If you're looking at something like an emission-line galaxy that has a very weak continuum, you may want to center this on a bright emission line instead.
- nsum — With a faint source, you may need to increase this to sum over more lines.
- lower & upper — Adjust according to the width of your aperture.
- nfind — If you expect to find more than one aperture (e.g., you're doing echelle spectoscopy), set this to the number of expected apertures.
- backgro — This must be set to "fit" for the program to do background subtraction.
- t_func & t_order & t_niter — These are three of the key trace fitting parameters. "t_func" is the function to be used (I frequently use a cubic spline or "spline3"), "t_order" is the order of the function (varies widely depending on your data), and "t_niter" is the number of times to reject outliers and refit.
- b_sampl — The region (relative to the center of the aperture) over which to fit the background.
- b_func — The order of the function to use when fitting the background. I often use 2, for a straight line with slope and intercept.
Apall Commands
After you hit enter for a few questions, "apall" enters interactive mode. You will see a cut across your 2D spectrum, with apertures automatically identified. (If things look really weird, you may have set the dispersion axis incorrectly.) Useful commands at this stage include:
- "n" makes a new aperture centered on the cursor.
- "l" sets the lower limit of your latest aperture.
- "u" sets the upper limit of your latest aperture.
- "b" puts you in background mode, where you can use "w a" to zoom out and "w e e" to zoom back in as usual in IRAF. "z" deletes an existing background region, "s" in two places sets the boundaries of a new background region, and "f" applies the changes and shows you a new fit. You can also adjust the fitting parameters as needed using colon commands. Press "q" to exit the background setting.
- "q" in the main apall window exits to the next step.
Next, "apall" traces the aperture and asks you to confirm the fit. Ideally, there is a lovely curve that is relatively easy to fit. Delete any outlying points with "d", then hit "f" to see the new fit. If the trace is so ugly that no pattern is visible, try fitting a horizontal line. When satisfied, hit "q" to exit the trace.