next up previous contents index
Next: Calculation of Photon and Up: 6.1 Examples for Reducing Previous: Chi-square Grid Search

Calculation of Photon Flux Spectrum

     

The command model/spectrum allows in its calculate mode to compute a monochromatic photon flux or count rate spectrum depending on the folding option. Here we give an example to calculate the unabsorbed photon flux density of a power law derived from a fit to the spectrum of our source (see example 1 of this section).

First we define a power law model in parameter file spectrum_flux by using command CREATE/PARFIL fit. The expert flag skips the detailed explanation of the key words. We use the mode calculate and define the energy range between 0.1keV and 2.4keV, which is also the range by default. The output is given to table spectrum_flux. The power law model is defined without any absorption.

Note:Here we give an example of a short parameter file, where we delete all unnecessary keywords, change characters to lower case, and abbreviate the remaining keywords sensibly.
Midas 001> create/parfil fit spectrum_flux ? ? ? expert
cal                          ! calculates only photon flux
energy     0.1  2.4          ! energy interval, unit in keV
out_mode   spectrum          ! output mode
out_file   spectrum_flux     ! output file
model      powl(1,2)         ! power law
par 1       2.3137e-2        ! flux amplitude at E0
par 2      -3.984            ! photon index gamma
Now we run model/spectrum with parameter file spectrum_flux and output the unabsorbed spectrum to table spectrum_flux.tbl.
Midas 002> model/spectrum spectrum_flux
 Got spectral parameters from      spectrum_flux.par.
 DATA SET    1
 MODEL   1  POWL(1,2)
 PARAMETER   1 2.3137E-2
 PARAMETER   2 -3.984
 REDSHIFT
 Initialize table spectrum_flux.tbl.
Read the first five rows of table spectrum_flux.  
Midas 003> read/tab spectrum_flux @1 @5

   Table : spectrum_flux
 
  Sequence ENERGY       E_BIN_WIDTH  PF_M
  -------- ------------ ------------ ------------
         1   1.0000e-01   2.3023e-03   2.2300e+02
         2   1.0230e-01   2.3023e-03   2.0367e+02
         3   1.0460e-01   2.3023e-03   1.8639e+02
         4   1.0691e-01   2.3023e-03   1.7090e+02
         5   1.0921e-01   2.3023e-03   1.5699e+02
  -------- ------------ ------------ ------------
Create a graphic window and plot the calculated unabsorbed power law spectrum.
Midas 004> create/graph
Midas 005> set/graphic ltype=1 stype=0 pmode=1
Midas 006> plot/tab spectrum_flux log(:energy) log(:pf_m)
The integrated flux in the defined energy interval from 0.1keV to 2.4kev can be taken from the descriptor PHOTON_FLUX and ENERGY_FLUX in units of photons/cm tex2html_wrap_inline17805 /s and keV/cm tex2html_wrap_inline17807 /s. Because no absorption was used in the model these fluxes are source fluxes. Warning: If the model contains any absorption function both descriptors describe absorbed fluxes. The first two places (zeros) of the descriptors are filled when a spectrum is fitted.      
Midas 007> read/descriptor spectrum_flux.tbl PHOTON_FLUX
PHOTON_FLUX    :
    0.00000000000000E+00    0.00000000000000E+00     7.4765823152181
Midas 008> read/descriptor spectrum_flux.tbl ENERGY_FLUX
ENERGY_FLUX    :
    0.00000000000000E+00    0.00000000000000E+00     1.1222382746957



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