| tomultispec | hst_calib.ctools | tomultispec |
tomultispec - Converts spectra from rows of a FITS 3-D binary table to an IRAF multispec image
tomultispec input output
The tomultispec task will extract the specified rows and columns from a FITS 3-D binary table and convert this data into an IRAF multispec format image. Each row extracted from the FITS table is written to a line in the output 2-D image. This task is intended primarily as a means to convert spectra from the STIS and NICMOS instruments to a format that can be used as input to NOAO spectral tasks, such as splot. This task is layered upon the mkmultispec task (also found in the ctools package) which performs a similar operation for FOS and GHRS calibrated spectra. A majority of the parameters for tomultispec echo those for mkmultispec.
The task extracts specified rows, each of which contains a spectral order, from the input FITS table, fits a dispersion solution to each wavelength array, stores the solutions in the header of the output image, and writes the flux arrays to successive lines in the output "multispec" image. Type "help specwcs" for details of this spectral format. If only a single row is selected from the input table, the dispersion solution can be fit interactively.
The rows of interest must be designated by an appropriate row selector appended to the input table name. Type "help selectors" for details of the row/column selector syntax for tables. If no row selector is used, all the rows will be written to the output image.
The columns in the input FITS table containing the flux and wavelength arrays are specified via the task parameters "flux_col" and "wave_col", respectively. If a column named "SPORDER" is present, it will be used to populate the "beam" number of the output "multispec" image; it is intended as a means to associate the spectrum order number with the beam number.
The following parameters apply only for interactive fitting which is only allowed for single row (order) conversion.
If you are rejecting many points, you might not want to mark rejected points. If interactive mode were chosen, this parameter will be set to the last value specified by the ":markrej" command.
1. Extract all rows from the input FITS table, a10b01c2d_x1d.fits, and write the output to the OIF file a10b01c2d_ms.imh.
cl> tomultispec a10b01c2d_x1d.fits a10b01c2d_ms.imh
2. Extract rows 2, 3, 4, and 12 from the FITS table, a10b01c2d_x1d.fits, and write the output to the OIF file a10b01c2d_ms.imh. Note the use of the double quotes around the file name+row selector.
cl> tomultispec "a10b01c2d_x1d.fits[r:row=(2:4,12)]" a10b01c2d_ms
3. Extract spectral orders 112-116 from a STIS FITS table, stis_x1d.fits, and write the output to the OIF file stis_ms.imh.
cl> tomultispec "stis_x1d.fits[r:sporder=(112:116)]" stis_ms
4. Extract the gross flux and wavelength columns from row 2 of the FITS table, stis_x1d.fits, perform the fit to the wavelength array interactively, and write the output to the OIF file stis_ms.imh.
cl> tomultispec "stis_x1d.fits[r:row=2]" flux_col=GROSS \ >>> inter+ stis_ms.imh
The "function = table" parameter option should be chosen only when necessary (i.e, non-monotonic wavelength values) as there is a strict limit on the number of wavelengths which can be accommodated in an output image header. Therefore, if multiple rows have been extracted from the input FITS table, it is possible that there will not be enough space to store all of the required wavelength information. Depending upon the output format of the wavelengths (as specified in the "format" parameter of this task), only three or four wavelengths arrays can be accommodated in the header.
Tomultispec cannot be used correctly as a background job as tomultispec incorporates the use other tasks which need to be able to update their parameter values.
This task creates a large number of temporary files in the "tempdir" directory. If the task should abort prematurely, these files will not be deleted. In order to identify the temporary files created by tomultispec, the files have a prefix of "tomul_", as well as either an "X" or "Y" indicating if the file contains the "wave_col" (X) or "flux_col" (Y) data, a system tag making the files unique, and a row identification. For example, a temporary file would be "tomul_X_6844c_r0012.hhh", indicating the "wave_col" data from row 12 of the input table.
This task was written by M.D. De La Pena, SSG.
For assistance using this or any other tasks, please contact help@stsci.edu or call the help desk at 410-338-1082.
mkmultispec, specwcs, selectors, icfit