next up previous contents index
Next: Extended Source: Spectra and Up: 4.1 Examples of Typical Previous: Creating Light Curves

Creating Spectra

 

Example 1: Creating a corrected spectrum from a circular portion of the sky (PSPC data only, see note 1):

Midas 001> SET/PROJECTION CORRECT
Midas 002> SEL/RING center=(150,-2300) radius=300 BIN AMPL 1 *events *spec
Midas 003> SET/PROJECTION NOCORRECT
Example 1a: Creating a corrected spectrum from a circular portion of the sky (PSPC data only, see note 1a):

Midas 001> SEL/RING center=(150,-2300) radius=300 BIN AMPL 1 *events *spec
Midas 002> CREATE/PARFIL corr pcor
Midas 003> CORRECT/SPECTR pcor DATA=spec
                  Example 2: Same as example 1, but selecting a circle via the cursor on a reference image (PSPC data only, see note 2):

Midas 001> SET/PROJECTION CORRECT
Midas 002> SELECT/RING cursor BIN AMPL 1 input=events output=spec
Midas 003> SET/PROJECTION NOCORRECT
                      Example 3: Same as example 2, but the result is written to table column :ABC (PSPC data only, see note 3):

Midas 001> SET/PROJECTION CORRECT
Midas 002> SELECT/RING cursor BIN AMPL 1 id=ABC in=events out=spec
Midas 003> SET/PROJECTION NOCORRECT
            Example 4: Create a spectrum from specified amplitude channels, time intervals and a circular portion of the sky selected via the cursor (PSPC data only, see note 4):

Midas 001> SELECT AMPL 8,40-
           SELECT TIME 20000,30000-
           SELECT/RING cursor -
           BIN AMPL 1 *events *spec2
                          Example 5: Create three spectra from three different time selections (PSPC data only, see note 5):

Midas 001> SELECT TIME [<40000][51000,100000][200000,400000]-
           BIN AMPL 1 *events *spectra
                Example 6: Create a corrected and background subtracted spectrum from a point-like source (PSPC data only, see note 6):

Midas 001> SET/PROJECTION CORRECT
Midas 002> SEL/RING [cursor][cursor] BIN AMPL 1 *events *soubac,backgr
Midas 003> PREPARE/SPECTR soubac,backgr spec ? 5
                    Example 7: Create a corrected and background subtracted spectrum from a point-like source (see note 7):

Midas 001> SEL/RING [cursor][cursor] BIN AMPL 1 *events *soubac,backgr
Midas 002> SELECT/RING cursor *events *back
Midas 003> CREATE/PARFIL corr corfile
Midas 004> CORRECT/SPECTR corfile DATA=soubac OUTPUT=source
Midas 005> CORRECT/SPECTR corfile DATA=backgr-
           MODE=photon ATTITUDE=back OUTPUT=background
Midas 006> PREPARE/SPECTR soubac,backgr spec ? 5 source,background
                Example 8: Add to vignetting and dead time corrected spectra some extra corrections (as PSF or filter transmission) (see note 8):

Midas 001> SET/PROJECTION CORRECT
Midas 002> SEL/RING [cursor][cursor] BIN AMPL 1 *events *soubac,backgr
Midas 003> CREATE/PARFIL corr corfile
Midas 003> WRITE/PARFIL corfile PSF_CORRECTION_IMAGE EXSAS_CAL:psf_pspc
Midas 004> CORRECT/SPECTR corfile DATA=soubac OUTPUT=source
Midas 005> PREPARE/SPECTR soubac,backgr spec ? 5
                Example 9: Create a spectrum from a circle having radius 5 arcmin centered at given RA and DEC (see note 9):

Midas 001> SEL/RIN 2:32:45.2, -23:32:01.3, 5 min BIN AMP 1 *events *spec
                 

Note 1
The correction is meant to the instrument optical axis (i.e. produces a spectrum free of effects due to changing instrument response relative to the instrument optical axis). In order to derive a spectrum, for instance from a point-like source, a spatial selection centered on the source followed by a BIN AMPL command is generally used. In this example it is assumed that a source is positioned at the sky pixel (150,-2300). The amplitude bin is expressed in channels. The output is written to the table spec.tbl at the (default) columns :COUNTS_1 (non corrected spectrum), :CORR_1 (corrected spectrum) and :ERR_1 (statistical errors relative to the corrected spectrum). In case Projection were not set in correction mode, only the column :COUNTS_1 is created. Data correction is a delicate matter, so read carefully section 4.3.4! The default correction is not always the best you can choose (it could be not appropriate for your data). Warning: the Projection correction mode is not available for WFC and HRI data. For these instruments the correction must be applied separately, see section 4.3.4 for this case, or the next example 1a.

Note 1a
An alternative way to correct the spectral data -- more complicated but theoretically more accurate -- is the one shown here in its simplest form (all the defaults are untouched). A parameter file is created and run in attitude mode (the table attitude.tbl must be present on disk). The correction vector is written to the table spec_c, and it will be applied to the data by the Spectral Analysis fitting procedures. No background subtraction is performed.

Note 2
Whenever a reference image is loaded into the image display, the ring selection can be defined via the circular cursor.

Note 3
The output column label for the non corrected spectrum is set to :ABC, the corrected spectrum is written to :C_ABC and the statistical errors to :E_ABC.

Note 4
In creating a spectrum the photons might be generally filtered according to any arrival times, energies, and positions on the detector face or on the sky. In this example the spectrum is not corrected. Binsize is set to 1 channel (i.e. no rebin).

Note 5
Up to 255 spectra can be created and output simultaneously to the same table. Here is an example of the production of 3 spectra in different time intervals. The squared brackets are required in order to process the three time selections independently. To remove them would turn out in a single selection of all photons having arrival times either less than 40000 sec, or between 51000 and 100000 sec, or between 200000 and 400000 sec. A single spectrum would be produced. The 3 spectra are written to the columns :COUNTS_1, :COUNTS_2 and :COUNTS_3 of the table spectra.tbl. If Projection were set in correction mode the corrected spectra are written to the columns :CORR_1, :CORR_2 and :CORR_3, while the statistical errors are written to the columns :ERR_1, :ERR_2 and :ERR_3

Note 6
With this sequence of three commands a corrected and background subtracted spectrum is produced from a photon list. Projection is set in correction mode (vignetting and dead time) first. With the second command line, the source+background and the background spectra from the sky regions which are indicated via the graphic cursor are created and written into the tables soubac.tbl and backgr.tbl. The last command line performs the actual background subtraction and rebins the result so that the signal to noise ratio for each spectral bin is not less than 5.

Note 7
Here a sequence of commands for the production of a corrected and background subtracted spectrum is given, for the case Projection was not run in correction mode: as it can be seen, the procedure is much more complicated, even though it is theoretically the exact way to correct your data (to run Projection is correction mode is a very good approximation, anyway). With the first command line the source+background and the background spectra from the sky regions which are indicated via the graphic cursor are created and written into the MIDAS tables soubac.tbl and backgr.tbl. The second command selects the photons which are necessary in order to run the correction for the background spectrum in photon mode. The correction parameter file corfile.par is created via the command CREATE/PARFIL (see section 4.3.4 about the correction parameter files). Next the command lines CORRECT/SPECTRUM create the correction vectors for the two spectra, to be taken to the Spectral Analysis fitting procedures. The last command line performs the actual background subtraction and rebins the result so that the signal to noise ratio for each spectral bin is not less than 5. Note that in the background subtraction the two spectral correction vectors, produced by the CORRECT/SPECTRUM commands, must be specified in order to allow an accurate background subtraction.

Note 8
After having set the Projection in correction mode, the output spectra contained in the tables soubac.tbl and backgr.tbl are only corrected for vignetting and dead time. Adding in the correction parameter file corfile.par some extra corrections (such as the PSF correction) would generate a correction vector which includes all the new effects. The background extra corrections don't need to be calculated, and no correction vector must be specified in the PREPARE/SPECTR command.

Note 9
Spatial positions in the SELECT command can be specified in equatorial coordinates only; spatial intervals can be specified in units of arcsecond, arcminute, or degree.

For more details about spectra production, see sections 4.2.3 and 4.2.5. In order to get familiar with the projection command syntax it is strongly suggested to read thoroughly section 4.3 (page gif) also.


next up previous contents index
Next: Extended Source: Spectra and Up: 4.1 Examples of Typical Previous: Creating Light Curves

If you have problems/suggestions please send mail to rosat_svc@mpe-garching.mpg.de