Документ взят из кэша поисковой машины. Адрес оригинального документа : http://xmm.vilspa.esa.es/sas/7.0.0/documentation/threads/xspec_thread.html
Дата изменения: Mon Aug 21 18:11:40 2006
Дата индексирования: Sat Dec 22 14:43:51 2007
Кодировка:

Поисковые слова: arp 220
XSPEC session thread

  SAS home  

  SAS Watchout items  

  List of SAS threads  

XSPEC session thread

This thread contains a (very!) simple standard XSPEC session for fitting data from the X-ray cameras. The EPIC case, will be illustrated with an EPIC spectrum (a fully analogous procedure applies to MOS spectra as well).

EPIC

We assume in the following that the following products have been created and are available in the working directory: a source+background spectrum (PNspectrum.pi), a background only spectrum (PNspectrum_background.pi), a redistribution matrix (PN.rmf), and an ancillary file (PN.arf), both the above appropriate for the source+background spectrum in use. A thread to create spectra of point-like sources with EPIC is available.
  1. Start XSPEC

    xspec

  2. Load spectrum data:

    data 1 PNspectrum.pi

  3. Load the redistribution matrix

    response 1 PN.rmf

  4. Load the ancillary file

    arf 1 PN.arf

  5. Load the background spectrum

    backgrnd 1 PNspectrum_background.pi

  6. Create the output graphic plotting window

    cpd /xs

  7. Define how data has to be plotted, e.g. in energy bins (wavelength would be a valid alternative):

    setplot energy

  8. Relax getting a look into your data

    plot data



    Fig.1: XSPEC data plot

  9. Ignore bad channels in data:

    ignore bad

  10. Ignore energy intervals where the pn matrices are currently not calibrated (e.g.: beyond the energy band 0.2-15.0 keV)

    ignore **-0.2 15.-**

  11. Load a model to be fitted (in this case a simple power law model with photoelectric absorption)

    model wabs*powerlaw

    (you will have to hit return several times for every parameter of the model. The following screen will appear:

     mo = wa((po)).
      Model:  wabs[1]( powerlaw[2] )
    Input parameter value, delta, min, bot, top, and max values for ...
    Current:           1     0.001         0         0     1E+05     1E+06
    wabs:nH>
    Current:           1      0.01        -3        -2         9        10
    powerlaw:PhoIndex>
    Current:           1      0.01         0         0     1E+24     1E+24
    powerlaw:norm>
      ---------------------------------------------------------------------------
      ---------------------------------------------------------------------------
      Model:  wabs[1]( powerlaw[2] )
      Model Fit Model Component  Parameter  Unit     Value
      par   par comp
        1    1    1   wabs       nH       10^22      1.000     +/-      0.
        2    2    2   powerlaw   PhoIndex            1.000     +/-      0.
        3    3    2   powerlaw   norm                1.000     +/-      0.
      ---------------------------------------------------------------------------
      ---------------------------------------------------------------------------
     Chi-Squared =     2.7158111E+09 using  1675 PHA bins.
     Reduced chi-squared =      1624289.     for   1672 degrees of freedom
     Null hypothesis probability =    0.
    

  12. Fit the parameters

    fit 100 1e-1

    The former number indicates the maximum number of iterations before the minimization routine stops. The latter number indicate the minimum difference in chi-squared between two minimization runs, before the routine stops

  13. set the rebinning of your choice (for plotting purposes only!)

    setplot rebin 3 4096

    The former number indicates the maximum number of sigma to be accumulated in a rebinned channel. The latter, the maximum number of channels to bu summed.

  14. plot data with model adjustment and e.g. the residuals  (alternatives, ratio data/model, absolute chi-squared, etc)

    plot data residuals



    Fig.2: XSPEC data, model and residual plot

  15. determine one-side errors on the best-fit parameters

    error 2.706 1 2 3

    The first number indicates the delta chi-squared value.

RGS

We will assume in the following that products are available in the work directory as produced by SAS rgsproc, the RGS SAS metatask for whole data reduction:
  1. Start XSPEC

    xspec

  2. Load spectrum data (in this case RGS1 background subtracted spectrum, first order) into first internal dataset:

    data 1:1 /xvsas05/sasval/data/procred/Mkn421/P0099280201R1S001SRSPEC1001.FIT

  3. Load the response matrix into the first internal response set. The SAS task rgsrmfgen put both response and ancillary data into the response matrix file.

    resp 1 /xvsas05/sasval/data/procred/Mkn421/P0099280201R1S001RSPMAT1001.FIT

  4. Loading a second dataset into second internal data position (in this case data corresponding to RGS2):
  5. data 2:2 /xvsas05/sasval/data/procred/Mkn421/P0099280201R2S002SRSPEC1001.FIT
  6. Load the corresponding response matrix:

    resp 2 /xvsas05/sasval/data/procred/Mkn421/P0099280201R2S002matrix1001.FIT

    A few differences need to be noticed at the data loading level

  7. Create the output graphic plotting window

    cpd /xs

  8. Define how data has to be plotted, e.g. in energy bins (wavelength would be a valid alternative):

    setplot energy

  9. Relax getting a look into your data

    plot data

  10. Ignore bad channels in data:

    ignore bad

  11. Ignore energy intervals where the pn matrices are currently not calibrated (e.g.: beyond 1.9 keV)

    ignore 1.9-**

  12. Load a model to be fitted (in this case a simple power law model)

    model powerlaw

    (you will have to hit return several times for every parameter of the model)

  13. Fit the parameters

    fit 100 1e-1

    The former number indicates the maximum number of iterations before the minimization routine stops. The latter number indicate the minimum difference in chi-squared between two minimization runs, before the routine stops

  14. set the rebinning of your choice (for plotting purposes only!)

    setplot rebin 3 4096

    The former number indicates the maximum number of sigma to be accumulated in a rebinned channel. The latter, the maximum number of channels to bu summed.

  15. plot data with model adjustment and e.g the residuals  (alternatives, ratio data/model, absolute chi-squared, etc)

    plot data residuals

Notice that the help system in XSPEC is started with help, and works similarly to the old good VMS help system.