Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/sas/7.0.0/documentation/threads/PN_spectrum_thread.html
Дата изменения: Fri Jun 15 18:48:58 2007
Дата индексирования: Sat Dec 22 14:51:58 2007
Кодировка:

Поисковые слова: п п п п п п п п п п п п п
How to extract PN spectra of a point-like source and associated matrices

  SAS home  

  SAS Watchout items  

  List of SAS threads  

Spectral analysis of PN point-like sources

This thread contains a step-by-step recipe to extract PN spectra of a point-like source observed in Imaging mode and to create associated response matrices, starting from a calibrated, concatenated event list (either produced with epproc or available as PPS product; here it has the assumed file name PN.fits).

All the analysis steps are performed with single SAS tasks started from the command line to explain the general method of generating spectral products and to show explicitly the usage and setting of task parameters. The users should note that the SAS metatask xmmselect allows them to interactively define source and background regions (via ds9) and to run backscale on the fly. Especially the xmmselect:Spectral Products generation method, which in addition offers an optimization of the source extraction region and which creates source and background spectra as well as related ancillary and redistribution files in one go, might in some cases be a GUI based alternative to the command line method described below. For more details on how to use xmmselect for the generation of EPIC spectra, the reader is referred to the Users' Guide to the XMM-Newton Science Analysis System.

  1. set up your SAS environment (following the SAS start-up thread)

  2. extract a single event (i.e. pattern zero only), high energy (E > 10 and < 12 keV) light curve, to identify intervals of flaring particle background. Note that in case of the PN, an upper energy limit has been introduced to avoid noisy pixels with E > 12 keV.
  3. evselect table=PN.fits withrateset=Y rateset=ratePN.fits \
      maketimecolumn=Y timebinsize=100 makeratecolumn=Y \
      expression='#XMMEA_EP && (PI in [10000:12000]) && (PATTERN==0)'
    dsplot table=ratePN.fits x=TIME y=RATE

  4. determine a threshold on the light curve counts (in our example: 0.4 cts/s) defining "low background" intervals, create a corresponding GTI file and use it to filter the event list:
  5. tabgtigen table=ratePN.fits expression='RATE<=0.4' gtiset=PNgti.fits
    evselect table=PN.fits withfilteredset=Y filteredset=PNclean.fits \
      destruct=Y keepfilteroutput=T \
      expression='#XMMEA_EP && gti(PNgti.fits,TIME) && (PI>150)'

  6. extract an image (sky coordinates in this example; extraction in detector - DET[XY] - coordinates is possible as well, and may be preferable for some specific scientific needs)
  7. NOTE: arfgen/rmfgen do not support spectra extracted from a region defined in RAW coordinates

    evselect table=PNclean.fits imagebinning=binSize imageset=PNimage.fits withimageset=yes \
      xcolumn=X ycolumn=Y ximagebinsize=80 yimagebinsize=80

  8. display the image
  9. imgdisplay withimagefile=true imagefile=PNimage.fits

    This command is equivalent to the following:

    ds9 PNimage.fits

  10. select the region, from which the spectrum shall be accumulated, using the Region/Circle in ds9 (see Fig.1)

  11. Fig.1: ds9 main window. A circular region (green circle) has been defined using the highlighted menu.

  12. double-click with the cursor on the defined region. A window pops up, showing the properties of the region (Fig.2) (you need to set 'Coord -> Physical' and 'Radius -> Physical' to switch to physical coordinates). Write down the coordinates of the Center (30360.5,28400.5) and of the Radius (640) as they will be needed in step 10 to define the spatial filter expression.

  13. (These values would also be propagated into a Selection Expression if pressing the "2D region" button in xmmselect...)


    Fig.2: selection region properties window, pop'd-up by double-clicking on the region in the main ds9 window

  14. If you want to see the center position in RA, Dec (J2000) coordinates, switch 'Coord -> WCS' (World Coordinate System) and select 'Equatorial J2000'. To diplay the radius of the selection region in arcsec, switch 'Radius -> WCS' and select 'ArcSec'. Units of skycoordinates (X,Y) are 0.05 arcsec, hence the radius in our example is 32 arcsec.

  15. extract a source spectrum, using all the selection expressions defined so far & restricting the patterns to single and doubles
  16. evselect table=PNclean.fits withspectrumset=yes spectrumset=PNsource_spectrum.fits \
      energycolumn=PI spectralbinsize=5 withspecranges=yes specchannelmin=0 specchannelmax=20479 \
      expression='(FLAG==0) && (PATTERN<=4) && ((X,Y) IN circle(30360.5,28400.5,640))'

  17. extract a background spectrum. Have a look at the "EPIC status of calibration and data analysis" document (XMM-SOC-CAL-TN-0018) for latest recommendations on how to select source and background regions. In the following, we assume that the background is extracted from a source-free region at the same distance to the readout node (RAWY position) as the source region. So if your source is at line 150 on CCD 4, you should aim to select background from around line 150 on a neighbouring CCD to ensure similar low-energy noise.
    evselect table=PNclean.fits withspectrumset=yes spectrumset=PNbackground_spectrum.fits \
      energycolumn=PI spectralbinsize=5 withspecranges=yes specchannelmin=0 specchannelmax=20479 \
      expression='(FLAG==0) && (PATTERN<=4) && ((X,Y) IN circle(24440.5,29880.5,640))'
    If you are interested in learning how to extract the background spectra from blank sky event lists, please click here.

  18. If you want to correct the source spectrum for Out-of-Time events, consult the Removing Out-of-Time events thread.

  19. calculate the area of source and background region used to make the spectral files. The area is written into the header of the SPECTRUM table of the file as keyword BACKSCAL (if the spectrum is created via xmmselect, backscale will run automatically)

    backscale spectrumset=PNsource_spectrum.fits badpixlocation=PNclean.fits
    backscale spectrumset=PNbackground_spectrum.fits badpixlocation=PNclean.fits

  20. generate a redistribution matrix

  21. Currently there are two possible approaches:

    a) use the SAS task rmfgen to create a redistribution matrix for your previsouly extracted spectrum:

    rmfgen spectrumset=PNsource_spectrum.fits rmfset=PN.rmf

    NOTE: This can take long (>30 min) on low-performance computers...

    b) use the ready-made (canned) matrices available at the following URL: http://xmm.esac.esa.int/external/xmm_sw_cal/calib/epic_files.shtml

  22. generate an ancillary file (for extended sources use extendedsource=yes detmaptype=flat or dataset)
  23. NOTE: arfgen reads in the pattern range from the DSS information in the spectrum dataset, and accumulates the quantum efficiency curves over those patterns, which is then combined to the other consituents of the ARF. Be aware that the entire range of allowed patterns are assumed if no pattern range is found in the DSS.

    arfgen spectrumset=PNsource_spectrum.fits arfset=PN.arf withrmfset=yes rmfset=PN.rmf \
      badpixlocation=PNclean.fits detmaptype=psf

  24. prepare the spectrum and link associated files
  25. FTOOL: grppha: PHA filename: PNsource_spectrum.fits
                   output filename: PNsource_spectrum.grp
                   chkey BACKFILE PNbackground_spectrum.fits
                   chkey RESPFILE PN.rmf
                   chkey ANCRFILE PN.arf
                   group min 25 ! as an example
                   exit

  26. fit the spectrum
  27. FTOOL: xspec: data PNsource_spectrum.grp

  28. NOTE ON PATTERN SELECTION IN PN SPECTRA:

  29. For bright sources and sources with narrow lines it might be better to extract two spectra and corresponding backgrounds, response and ancillary files: one set for single pixel events (PATTERN==0) and another set for doubles (PATTERN IN [1:4]).
    Fitting these two spectra simultaneously will show if there are any problems with pile-up (see also SAS thread on "How to evaluate the pile-up fraction") and - as the energy calibration for singles is slightly better than the one for doubles - will show the line features at highest energy resolution in the single events spectra.
    However, in case of PN Timing mode observations (where the rate of single to double events depends on the source position) one should always create and fit a spectrum of the combined single and double events. For details on the spectral analysis of data obtained in Timing and Burst mode, see again XMM-SOC-CAL-TN-0018.