SAS home    SAS Watchout items    List of SAS threads 

OM data reduction with SAS: grism data processing chain

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.

OM grism data are not yet processed by the XMM-SAS Standard Pipeline run at the SSC. The User has to run the individual grism tasks, or rather use omgchain  on the grisms exposures included in the ODF. All necessary corrections are applied 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. If the user wants to extract all spectra present in the grism image (obtained in full frame or with a rectangular window), the parameter 'extractfieldspectra=yes' has to be used when invoking    omgchain. Then the spectra for which a correlation can be established between zero and first orders are extracted and fully calibrated.

In the near future astrometric corrections will be applied to the zero order position of the extracted spectra to determine the sky co-ordinates of the corresponding object.

We outline here the checking that any user should perform on OM grism processed data and the use of an additional interactive task,  omgsource, which performs the complete extraction and calibration of the spectra selected by the user.

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.


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
              outset=/working_dir/g0125910501OMS005IMAGEI0000.FIT  modeset=4

step2>    Modulo_8 fixed pattern noise is corrected

ommodmap set=/working_dir/g0125910501OMS005IMAGEI0000.FIT  mod8product=yes
                     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

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
                outset=/working_dir/p0125910501OMS005SWSRLI0001.FIT nsigma=2

step5>   Detected spectra are extracted and calibrated.

omgrism set=/working_dir/p0125910501OMS005RIMAGE0000.FIT
                bkgoffsetleft=6 bkgwidthleft=-6 bkgoffsetright=6 bkgwidthright=-6 spectrumhalfwidth=-6
=0 extractionmode=0 extractfieldspectra=no 

step6>    Finally, we can plot the results.

omgrismplot set=/working_dir/p0125910501OMS005SPECTR0000.FIT 
                      binsize=1 plotdevice=/PS scalebkgplot=no plotflux=2