Skip to the navigation links
Last modified: December 2009

URL: http://cxc-newtest.cfa.harvard.edu/ciao4.2/modelflux.html
AHELP for CIAO 4.2

modelflux

Context: sherpa_tools

Synopsis

Calculate model flux or count rate

Syntax

modelflux  arf rmf model paramvals emin emax [oemin] [oemax] [rate]
[pflux] [flux] [opt]

Description

Convert between energy flux, photon flux and count rate for any Sherpa model, given a set of spectral response files. The method assumes the model has an overall linear normalization.

Example 1

modelflux arf="arf.fits" rmf="rmf.fits"
model="xsphabs.abs1*powlaw1d.p1" paramvals="abs1.nh=0.07;p1.gamma=2.26"
emin="0.5" emax="7.0"

The default use is to convert from rate to flux. This example calculates the flux of the source in [0.5,7.0] keV corresponding to a count rate of 1 count/second in the same band.

Example 2

modelflux arf="arf.fits" rmf="rmf.fits"
model="xsphabs.abs1*powlaw1d.p1"
paramvals="abs1.nh=0.07;p1.gamma=2.26;p1.ampl=0.0003" emin="0.5"
emax="7.0" rate="0.1"

Here we specify an explicit count rate of 0.1 count/s and calculate the energy flux and photon flux that would generate that count rate, given the model.

Even though we specified an amplitude parameter for the power law, it does not affect the result, since the output is linearly rescaled to match the requested count rate.

Example 3

modelflux arf="arf.fits" rmf="rmf.fits"
model="xsphabs.abs1*powlaw1d.p1"
paramvals="abs1.nh=0.07;p1.gamma=2.26;p1.ampl=0.0003" emin="0.1"
emax="10.0" oemin="0.5" oemax="2.0" rate="0.1"

This example finds out what flux in the energy range 0.1-10 keV would produce a 0.5-2 keV count rate of 0.1 count/s. The emin and emax parameters always specify the energy range for the flux; the oemin and oemax parameters can be used to specify a different energy band for the rate.

Example 4

modelflux arf="arf.fits" rmf="rmf.fits"
model="xsphabs.abs1*(powlaw1d.p1+xsgaussian.g)"
paramvals="abs1.nh=0.07;p1.gamma=2.26;p1.ampl=0.0003;g.sigma=0.1;g.line=
1.0;g.norm=1.0e-5" emin="0.5" emax="2.0" flux="1.E-12" opt="flux"

This example uses "opt=flux" to tell modelflux we are giving it the flux and want to know the count rate (opt="rate" is the default). Calculates the count rate of the source in [0.5,2.0] keV where a flux of 1E-12 ergs/cm^2/s is observed in the same band. Although the overall normalization is scaled to the requested flux, the relative normalizations of the two components are set using the p1.ampl and g.norm parameters.

Parameters

name type ftype def reqd
arf file input   yes
rmf file input   yes
model string     yes
paramvals string     yes
emin real   INDEF yes
emax real   INDEF yes
oemin real   INDEF no
oemax real   INDEF no
rate real   1.0 no
pflux real   INDEF no
flux real   INDEF no
opt string   rate no

Detailed Parameter Descriptions

Parameter=arf (file required filetype=input)

Ancillary Response File (ARF)

Parameter=rmf (file required filetype=input)

Response File (RMF)

Parameter=model (string required default=)

Sherpa model definition string, e.g. xsphabs.abs1*xspowerlaw.p1

Parameter=paramvals (string required default=)

semicolon-delimited (';') string of (id.parameter=value) pairs, e.g. abs1.nh=0.07;p1.gamma=2.26

Parameter=emin (real required default=INDEF)

Lower bound of flux energy range in keV

Parameter=emax (real required default=INDEF)

Upper bound of flux energy range in keV

Parameter=oemin (real not required default=INDEF)

Lower bound of energy range for count rate in keV, default=emin

Parameter=oemax (real not required default=INDEF)

Upper bound of energy range for count rate in keV, default=emin

Parameter=rate (real not required default=1.0)

count rate in counts s^-1

Parameter=pflux (real not required default=INDEF)

photon flux in energy range in photon cm^-2 s^-1

Parameter=flux (real not required default=INDEF)

energy flux in energy range in erg cm^-2 s^-1

Parameter=opt (string not required default=rate)

Input type: (rate|flux|pflux), rate->flux,pflux or flux->rate,pflux

This parameter is used to control whether modelflux calculates a rate from the flux or pflux parameters, or vice versa.

Bugs

See the bugs page for this tool on the CIAO website for an up-to-date listing of known bugs.

See Also

sherpa
calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, gamma, igam, igamc, incbet, lgam

Last modified: December 2009