next up previous contents index
Next: Calculation of Photon Flux Up: 6.1 Examples for Reducing Previous: Power Law Fit to

Chi-square Grid Search

 

Here we start with an observed spectrum testdata1:spectrum.tbl of our source. We assume that this spectrum is already corrected by using the correction mode of the projection package (see last example and chapter 4) and begin with setting the context to exsas.

Midas 001> set/context exsas
First we bin the detector response according to the observed spectrum. We relate the binned detector response matrix to the name of the observed spectrum spectrum_drm instead of using the default.
Midas 002> bin/detector testdata1:spectrum ? spectrum_drm
 Create binned detector response matrix spectrum_drm.
Accordingly we create the parameter file spectrum_grid.par necessary to produce the tex2html_wrap_inline17771 values at chosen grid points (parameter 1: values of column density tex2html_wrap_inline17773 from 0 to tex2html_wrap_inline17775 cm tex2html_wrap_inline17777 in steps of tex2html_wrap_inline17779 cm tex2html_wrap_inline17781 and parameter 3: values of photon index tex2html_wrap_inline17783 from -8 to 0 in steps of .5) by entering CREATE/PARFIL FIT with the expert flag option (parameter file without comments). We change this file according to the example and delete all lines, which have proper defaults. Any parameter file can be modified also via the command WRITE/PARFIL.
Midas 003> CREATE/PARFIL fit spectrum_grid ? ? ? expert
!
! --- general key words ---
!
FIT                                     ! alternative: COMPARE, CALCULATE
FOLD                                    ! folding with detector response
INPUT_FILE      testdata1:spectrum      ! observed X-ray spectrum
OUTPUT_FILE     spectrum_grid           ! 2-D grid of chi-square values
CORRECTION_FILE exsas_cal:effarea_pspcc ! corrected effective area
RESPONSE_FILE   spectrum_drm            ! binned detector response matrix
!
! --- power law model, parameters, and red shift ---
!
MODEL        gamm(1)*powl(2,3,4)        ! galactic absorption * power law
PARAMETER 1  0.0  15.0   1.0      grid  ! nH, units of 10^21 atoms/cm^2
PARAMETER 2  1.E-2 1.E-7 1.E+5 0. free  ! flux amplitude at E0
PARAMETER 3  -8.0  0.0   0.5      grid  ! photon index gamma
PARAMETER 4  1.0                        ! reference energy E0 in keV
REDSHIFT     0.0                        ! red shift z
 

   figure5978
Figure 6.3: Contour plot of tex2html_wrap_inline17787 as a function of the galactic column density tex2html_wrap_inline17789 and the photon index tex2html_wrap_inline17791 for three confidence levels of 68.3%, 95.4%, and 99.7%

  Now we run the command MODEL/SPECTRUM to search for a tex2html_wrap_inline17793 grid. Since the program runs tex2html_wrap_inline17795 single fits it takes a while to output the results in the bulk data frame spectrum_grid.bdf.

Midas 004> model/spectrum spectrum_grid
We create a graphic window to make a contour plot of confidence levels by using constant tex2html_wrap_inline17797 values of the `` tex2html_wrap_inline17799 - tex2html_wrap_inline17801 '' parameter grid. Since we don't want to overload the plot we choose only three of five possible contour lines corresponding to the first three default confidence levels of 68.33%, 95.45%, and 99.73%. If we are satisfied with the result we send the plot to a proper printer (see Figure 6.3).
Midas 005> create/graph
Midas 006> set/graphic pmode=1 fonts=1 frame=square
Midas 007> plot/chi2_contour spectrum_grid 3 ? xlab="nH in atoms/cm2"
ylab="Photon index"
Midas 008> copy/graphic LASER
 


next up previous contents index
Next: Calculation of Photon Flux Up: 6.1 Examples for Reducing Previous: Power Law Fit to

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