Research & Science Home ESA Public Web Site Sci-Tech Portal      XMM-Newton Public Web Site XMM-Newton Sci-Tech Portal
Astrophysics Missions Planetary Exploration Missions Solar Terrestrial Science Missions Fundamental Physics Missions Science Faculty

OM data reduction with SAS: grism data processing chain


Introduction

The thread explains how to extract UV or optical grism spectra from the ODF

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

Prerequisites

The grism chain can only run on appropriate ODF data. If the observation contains no grism data, the chain will give a fatal error.
The SAS has to be setup following the SAS Startup Thread.

Useful Links

Caveats



Procedure

OM grism data are obtained as image mode data. However, the different nature of this type of data, spectra of the objects in the field of view instead of their "sky" image, makes that a special processing must be applied to the 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. Checking 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.

      p0125320701OMS002RIMAGE0000.FIT

      and then loading the corresponding region file

      p0125320701OMS002SPCREG0001.ASC.





      The figure shows the extractions finally done (red overlay, corresponding to *SPCREG* file) and also all detections performed (blue 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 on 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 below). The desired spectrum can be selected interactively, and appropriate source and background extraction regions can be defined.


When omgchain is run on an ODF containing grism data, processing is as follows. We consider only one grism image present in the ODF. As we have pointed out OM grism data are image mode data. Since tracking corrections are not applied to grism data, we need in addition to spacecraft and summary files:

  0472_0125910501_OMS00500WDX.FIT - Exposure priority window file
  0472_0125910501_OMS00500IMI.FIT - Exposure image file with grism data

If SAS is run step by step in a working directory and the data are located in a different one, then the corresponding paths have to be added to the file names accordingly.

step1

The input image here corresponds to a user defined window. In case we had a full frame low resolution exposure, then omcomb must be run beforehand and its output image be used as input for omprep

omprep set=/path_to_your_data/0472_0125910501_OMS00500IMI.FIT \
 pehset=/path_to_your_data/0472_0125910501_OMX00000PEH.FIT \
 nphset=/path_to_your_data/0472_0125910501_OMX00000NPH.FIT \
 wdxset=/path_to_your_data/0472_0125910501_OMS00500WDX.FIT \
 outset=/working_dir/g0125910501OMS005IMAGEI0000.FIT \
 modeset=4

step2

Modulo_8 fixed pattern noise is corrected

ommodmap set=/working_dir/g0125910501OMS005IMAGEI0000.FIT \
 mod8product=yes \
 mod8set=/working_dir/g0125910501OMS005MOD8MP0000.FIT \
 outset=/working_dir/g0125910501OMS005IMAGE_0000.FIT \
 outflatset=/working_dir/g0125910501OMS005FLAFLD0000.FIT \
 nsig=3 \
 nbox=16 \
 mod8correction=1

step3

We obtain now the undistorted and rotated image from which the spectrum, or spectra, will be extracted.

omgprep set=/working_dir/g0125910501OMS005IMAGE_0000.FIT \
 outset=/working_dir/p0125910501OMS005RIMAGE0000.FIT

step4

The source spectra have been detected. They can be checked by overplotting the region file on the rotated image, using ds9.

omdetect set=/working_dir/p0125910501OMS005RIMAGE0000.FIT \
 regionfile=/working_dir/g0125910501OMS005REGION0001.ASC \
 outset=/working_dir/p0125910501OMS005SWSRLI0001.FIT \
 nsigma=2

step5

Astronomical coordinates, RA & Dec, are computed for the detected spectra

omatt set=/working_dir/p0125910501MS005RIMAGE0000.FIT \
 sourcelistset=/working_dir/p0125910501MS005SWSRLI0001.FIT \
 ppsoswset=/working_dir/g0125910501MS005SIMAGE0000.FIT

step6

Detected spectra are extracted and calibrated.

omgrism set=/working_dir/p0125910501OMS005RIMAGE0000.FIT \
 sourcelistset=/working_dir/p0125910501OMS005SWSRLI0001.FIT \
 outset=/working_dir/p0125910501OMS005SPECTR0000.FIT \
 bkgoffsetleft=6 bkgwidthleft=-6 bkgoffsetright=6 \
 bkgwidthright=-6 spectrumhalfwidth=-6 \
 spectrumsmoothlength=0 extractionmode=0 extractfieldspectra=no \
 outspectralistset=/working_dir/p0125910501OMS005SPECLI0000.FIT \
 regionfile=/working_dir/p0125910501OMS005REGION0001.ASC \
 spectraregionfile=/working_dir/p0125910501OMS005SPCREG0001.ASC


step7

Finally, we can plot the results.

omgrismplot set=/working_dir/p0125910501OMS005SPECTR0000.FIT \
 plotfile=/working_dir/g0125910501OMS005SPECTR0000.PS \
 spectraregionfile=/working_dir/p0125910501MS005SPCREG0001.ASC \
 regionplotfile=/working_dir/p0125910501MS005SPCREG0001.PS \
 rotatedimageset=/working_dir/p0125910501MS005RIMAGE0000.FIT \
 binsize=1 plotdevice=/PS scalebkgplot=no plotflux=2




Last Updated: 16 April 2010



Caveats

None



   Copyright 2012© European Space Agency. All rights reserved.
This page was last updated on 1 March, 2011.