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:
|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:
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:
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.