next up previous contents
Next: 8.6 High Dispersion Extraction Up: 8.5 Low Dispersion Extraction Previous: 8.5.3 Gaussian Extractions

8.5.4 Multiple Gaussian Extractions

Sometimes, observers have found it convenient to take images with more than one spectrum in the aperture. Neither IUESIPS nor NEWSIPS extract the spectra separately. It is possible to use BOXCAR to extract them if the spectra are very well separated. The standard GEX routines, however, are incapable of doing this. Some users may be familiar with an old, little-publicized program called DGEX which was an adaption of the standard GEX routines designed to extract two spectra separately. It was able to ignore the region occupied by the second spectrum (for both fitting and background purposes) while extracting the first spectrum, and vice versa. It worked well enough if the two spectra were well separated. It did not work properly for closely spaced spectra (or for cases where there were three or more spectra). This procedure did not work for NEWSIPS data.

New software has been developed to fit gaussian profiles to multiple spectra at the same time. Since the fits are done concurrently, the spectra do not have to be well separated, and more than two spectra may be specified. This procedure, MGEX, can handle both NEWSIPS and IUESIPS data:

MGEX,IMAGET,WMIN,WMAX,DELS1,DELS2,left,right,center, $
h,w,f,err,q,/silent,/noplots,/sfp,outname=outname
 

IMAGET The line-by-line file to be processed.
WMIN Minimum wavelength of region to be extracted.
WMAX Maximum wavelength of region to be extracted.
DELS1 Bin size in sample numbers, used in first pass (analogous to GEX1 for single spectra).
DELS2 Bin size in sample numbers, used in second pass (analogous to GEX2 for single spectra).
left First line number of the spectral region. Lines shortward of this one are considered to be background.
right Last line number of the spectral region. Lines longward of this one are considered to be background.
center Central line numbers for each spectrum.
h FITS header of output spectra.
w Wavelengths (one dimensional) for output spectra.
f Fluxes (two dimensional) for output spectra.
err Fitting errors (two dimensional) for output spectra.
q Quality flags (two dimensional) for output spectra.
silent This suppresses printed output if set.
noplots This suppresses plotting if set.
outname Returns the name of the output file.
sfp ``Save Fit Parameters'' (centers, widths, heights, and slope and intercept of background fits) determined for the various spectra at each wavelength. If set these items will be included in the output FITS file.

The output of MGEX is a FITS file similar to that produced by standard GEX, except that the spectra are stored in separate rows. GEXCAL is capable of calibrating the data stored in this format. Unless a specific row is specified via the ROW keyword, GEXCAL will calibrate the spectra in all the rows. The vectors F, ERR, and Q will be two dimensional! Example:

1.
mgex,'lwp18206slg',2400,3300,10,1,left,right,center,/sfp
(MGEX will allow you to select left, right, and/or center (if any of these are not given) using a cursor.)
2.
gexcal,'lwp18206.g1f',h,w,f,e,q
3.
To plot the first spectrum: plot,w,f(*,0)
4.
To plot the second spectrum: plot,w,f(*,1) etc.

Note that IDL subscripting begins with 0, not 1.

Row numbers increase with center line number. Here is an example. You ran MGEX on LWP18206SLG. This image has two spectra, located at lines 53 and 58. To read them separately:

1.
ifitsrd,'lwp18206.g1f',1,h,eh,w,f1,e1,q1,cen1,wid1,ht1, bslope1,bint1
2.
ifitsrd,'lwp18206.g1f',2,h,eh,w,f2,e2,q2,cen2,wid2,ht2,bslope2,bint2

The ``h'', ``eh'', and ``w'' vectors is the same in both cases. Spectrum 1 contains data centered at line 53. Spectrum 2 contains data centered at line 58.

It is important to select the object slit with care. If too much background is included in the extraction region, the fitting algorithms may not produce reasonable results (you will see the fits on the screen). Therefore, make the slit as narrow as possible without actually excluding spectral data.


next up previous contents
Next: 8.6 High Dispersion Extraction Up: 8.5 Low Dispersion Extraction Previous: 8.5.3 Gaussian Extractions

2/9/1998