OM data reduction with SAS: grism data processing chain


The processing chain omgchain, used to obtain OM grism spectra from the ODF, is a concatenation of several SAS tasks run consecutively. While these steps are described in detail in the Step by Step thread this threads assumes the perl script to be run and describes recommends checks of the resulting output.

Expected Outcome

OM UV or optical grism spectra in fits format. Spectra will be given on a wavelength grid in count rates and absolute flux units.

SAS Tasks to be Used


The SAS has to be setup following the SAS Startup Thread.

Useful Links


Last Reviewed: 25 May 2023, for SAS v21.0

Last Updated: 27 MAY 2019




OM grism data are obtained as image mode data. The different nature of this type of data, dispersed spectra of each object in the field of view instead of their "sky" image, requires special processing of grism images. A series of tasks, some of them common with "normal" images, have been developed. They are concatenated in a perl script, omgchain, which works in a similar way to the image and fast mode chains.

A detailed description of each task can be found in the SAS documentation, both in HTML and Postscript format. A step by step description of the grism extraction chain and examples of the processing by individual execution of all tasks is given in the SAS User's Guide.

The omgchain applies all necessary corrections to the grism data files. The images are rotated to have the dispersion direction aligned with the image columns. Then a source detection algorithm is used to identify the spectra (zero and first dispersion orders) of the sources present in the grism image.

By default, omgchain will extract the spectrum of the target located at the boresight. All spectra present in the grism image (obtained in full frame or with a rectangular window) can be extracted using the parameter extractfieldspectra=yes when invoking omgchain. Then the spectra for which a correlation can be established between zero and first orders are extracted and fully calibrated. Astrometric corrections are applied to the zero order position of the extracted spectra to determine the sky co-ordinates of the corresponding object.

After running the chain, the checks described below should be performed on OM grism processed data. There is an additional task, omgsource, which allows interactive extraction and calibration of grism spectra.


  1. Recommended checks omgchain output products:
    • The most important check to be done after running omgchain consists in verifying that the first order spectra have been properly found and correlated with the corresponding zero order. This can be done by displaying with ds9 the grism rotated image, e.g.

      ds9 p0650300201OMS006RIMAGE0000.FIT -region p0650300201OMS006SPCREG0001.ASC \
         -region p0650300201OMS006REGION0001.ASC -scale log -zoom to fit -invert


      The figure shows the extractions finally done (red overlay, corresponding to *SPCREG* file) and also all detections performed (green overlay, corresponding to *REGION* file).

      The positions for extracted zero and first orders given in the files *SPECLI* and *SWSRLI* and also in the headers of the extracted spectra contained in *SPECTR* can be verified in the displayed image.

      Dubious or defaulted extractions, e.g. in case of very faint spectra, are indicated in the *SPECLI* file.
    • In recent versions of SAS (from SAS 8.0), omgchain produces a postscript file showing the spectrum image with superimposed spectral extraction regions: *SPCREG*.PS
    • Possible contamination by other spectra (zero and/or first orders) should be checked also on the displayed rotated grism image.
  2. Improving the extraction
    • If the spectrum (or spectra) of interest has not been detected automatically because it is too faint, or if the standard extraction is contaminated by close features, then an interactive extraction tool is available with omgsource which uses the rotated image (see step3 of the Step by Step guide). The desired spectrum can be selected interactively, and appropriate source and background extraction regions can be defined.
  3. Time dependent sensitivity degradation.
    • The time dependent sensitivity degradation of the OM detector affects data collected with the grisms. Spectra of the same source obtained at different epochs will show a decrease in the rates or fluxes. From SAS 18 onwards, the effect is automatically corrected for in the grism SAS task, omgchain, which is also run inside omgchain and omgsource.
Correction factor for time dependent sensitivity degradation of the OM grisms
Year UV_Grism V_Grism
2000 1.00 1.00
2002 1.01 1.01
2004 1.02 1.02
2006 1.04 1.02
2008 1.05 1.03
2010 1.07 1.04
2012 1.08 1.04
2014 1.10 1.05
2016 1.12 1.06
2018 1.13 1.07
2020 1.15 1.07