next up previous contents
Next: Flux Calibration Up: Long-Slit Grism Data Reduction Previous: Slit Illumination Correction

Extraction of 1D Spectra

We now have an averaged two-dimensional image of the long-slit grism spectrum. For most applications, we want to extract a one-dimensional spectrum from this image. In general, residual sky emission lines will also be present in the image. This is because the sky emission line spectrum varies on shorter timescales than our integration time. This sky background is removed during the extraction process by linear interpolation along the slit direction.

One-dimensional spectra are extracted using the redgspec task by setting the extract flag, and optionally defining a value for the reffile parameter. The redgspec task uses the apall task in the IRAF noao.twodspec.apextract package to perform the extraction and background subtraction interactively. It is recommended that users become familiar with the workings of this package. The available cursor commands are listed below. Generally, you will want to edit the extraction aperture for each object by setting reffile="". However, this may be difficult for extremely weakly-exposed spectra and is inappropriate for comparison spectra. In these cases, you can use a previously defined extraction aperture from a reference spectrum. If a reference spectrum is to be used, set the reffile parameter to the filename of the reference spectrum.

                 APEXTRACT CURSOR KEY SUMMARY
 
?  Print help            a  Toggle all flag         b  Set background(s)
c  Center aperture(s)    d  Delete aperture(s)      e  Extract spectra
f  Find apertures        g  Recenter aperture(s)    i  Set aperture ID
j  Set beam number       l  Set lower limit(s)      m  Mark and center aperture
n  New uncentered ap.    o  Order the ap. numbers   q  Quit
r  Redraw graph          s  Shift aperture(s)       t  Trace aperture(s)
u  Set upper limit(s)    w  Window graph            y  Y level limit(s)
z  Resize aperture(s)    .  Nearest aperture        +  Next aperture
-  Previous aperture     I  Interrupt
 
                 APEXTRACT COLON COMMAND SUMMARY
 
:apertures      :apidtable      :avglimits      :b_function     :b_grow         
:b_high_reject  :b_low_reject   :b_naverage     :b_niterate     :b_order        
:b_sample       :background     :bkg            :center         :clean          
:database       :extras         :gain           :image          :line           
:llimit         :logfile        :lower          :lsigma         :maxsep         
:minsep         :npeaks         :nsubaps        :nsum           :order          
:parameters     :peak           :plotfile       :r_grow         :radius         
:read           :readnoise      :saturation     :shift          :show           
:skybox         :t_function     :t_grow         :t_high_reject  :t_low_reject   
:t_naverage     :t_niterate     :t_nsum         :t_order        :t_sample       
:t_step         :t_width        :threshold      :title          :ulimit         
:upper          :usigma         :weights        :width          :write          
:ylevel         :t_nlost
 
                APEXTRACT CURSOR KEYS
 
?    Print help
a    Toggle the ALL flag
b an Set background fitting parameters
c an Center aperture(s)
d an Delete aperture(s)
e an Extract spectra (see APSUM)
f    Find apertures up to the requested number (see APFIND)
g an Recenter aperture(s) (see APRECENTER)
i  n Set aperture ID
j  n Set aperture beam number
l ac Set lower limit of current aperture at cursor position
m    Define and center a new aperture on the profile near the cursor
n    Define a new aperture centered at the cursor
o  n Enter desired aperture number for cursor selected aperture and remaining
     apertures are reordered using apidtable and maxsep parameters
     (see APFIND for ordering algorithm)
q    Quit
r    Redraw the graph
s an Shift the center(s) of the current aperture to the cursor position
t ac Trace aperture positions (see APTRACE)
u ac Set upper limit of current aperture at cursor position
w    Window the graph using the window cursor keys
y an Set aperture limits to intercept the data at the cursor y position
z an Resize aperture(s) (see APRESIZE)
.  n Select the aperture nearest the cursor to be the current aperture
+  c Select the next aperture (in ID) to be the current aperture
-  c Select the previous aperture (in ID) to be the current aperture
I    Interrupt task immediately.  Database information is not saved.
 
The letter a following the key indicates if all apertures are affected when
the ALL flag is set.  The letter c indicates that the key affects the
current aperture while the letter n indicates that the key affects the
aperture whose center is nearest the cursor.
 
                        APEXTRACT COLON COMMANDS
 
:show [file]       Print a list of the apertures (default file is STDOUT)
:parameters [file] Print current parameter values (default file is STDOUT)
:read [name]       Read apertures from database (default to the current image)
:write [name]      Write apertures to database (default to the current image)
 
The remaining colon commands are task parameters and print the current
value if no value is given or reset the current value to that specified.
Use :parameters to see current parameter values.

The extraction process proceeds slightly differently for the different observation types defined by the observation type header entry. If the observation type is abba, the positive object spectrum is extracted interactively, then the corresponding sky spectrum is automatically extracted, and these steps are repeated for an inverted version of the negative object spectrum. For the osso and soos observation types, the object spectrum is extracted interactively, then the sky spectrum is automatically extracted. For comparison spectra, the extraction occurs automatically using the extraction aperture defined by the reference spectrum. The extraction and background aperture definitions used for each object spectrum become the default definitions for extracting the next spectrum. Generally all that is required is to recenter the extraction aperture on the new spectrum.

The extraction process for each spectrum begins by asking Edit apertures for infile.oim? (yes):. Answering yes to this question allows the user to interactively change the default extraction and background subtraction apertures using the apedit task. The full profile perpendicular to the dispersion axis is plotted in the graphics display and the location of the default extraction aperture is indicated, if one is defined. Type m to mark the location of the first extraction aperture at the centroid of the profile peak near the cursor location. Type n to mark the first extraction aperture at the cursor location without centroiding. Type s to shift a predefined aperture to a different location, and optionally centroid the aperture at the new location in response to the question asked. Type c to centroid a predefined aperture. On weakly exposed spectra, the object may not be detectable in the full slit profile. If emission features are present, plot the slit profile only around an emission line by decreasing the number of dispersion lines summed by typing, e.g., :nsum 20, and selecting the location of the cut across the spectrum by typing :line nnn, where nnn is the line number where the feature occurs. To change the lower bound of the extraction aperture, position the cursor at the new position and type l, or type :lower -4 to explicitly set to a value of -4. To change the upper bound of the extraction aperture, position the cursor at the new position and type u, or type :upper 4 to explicitly set to a value of 4. Alternatively, you can set the width of the extraction aperture using the height of the cursor as a threshold to define new upper and lower bounds and type y. Type r to redraw the graph. Define new background sample regions explicitly by typing, e.g., :b_sample -8:-5,5:8, or type b to change the background subtraction sample regions using the cursor. The cursor commands then available are those of the interactive curve fitting task icfit that were listed earlier. Type z to delete the sample region nearest the cursor. Type s to define one side of a new sample region, and s again to define the other side. Type :sample -8:-5,5:8 to set the background subtraction sample regions explicitly from within icfit. To change the order of the fit type :order 1. Type f for a new fit. Type r to redraw the graph. Type q to exit from the interactive curve fitting task. When the extraction and background apertures have been defined, type q to exit the aperture editor.

Answer yes to the question Write apertures for infile.oim to database (yes): to save the definition. Then answer yes to the question Extract aperture spectra for infile.oim? (yes): to perform the extraction. Answer yes to the question Review extracted spectra from infile.oim? (yes): to display the extracted one-dimensional spectrum. Since we have only one aperture, answer yes to the question Review extracted spectrum for aperture 1 from infile.oim (yes):. Type q to proceed. Then type a carriage return to the question Output image name [use # to skip output] (infile.oim.0001):. The redgspec task will rename this file.

Each extracted spectrum is stored in an IRAF multispec format file named by appending .osp, .ssp, or .csp to the base spectrum name for the object, sky, or comparison spectrum, respectively. The aperture definitions for each extracted spectrum are stored in a database/ sub-directory of the current directory in files with names like apinfile.oim.


next up previous contents
Next: Flux Calibration Up: Long-Slit Grism Data Reduction Previous: Slit Illumination Correction

Kabal
Thu Jun 5 16:44:21 EST 1997