Last modified: December 2013

URL: http://cxc.harvard.edu/sherpa/ahelp/sample_photon_flux.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.11 Sherpa v1

sample_photon_flux

Context: utilities

Synopsis

Sample the photon flux distribution

Syntax

sample_photon_flux( [lo, hi], [id=1, num=1, correlated=False] )

Description

The sample_photon_flux command returns one or more samples of the photon flux distribution, which is the flux distribution for the model component accounting for the errors on the model parameters.

The plot_photon_flux() command can be used to plot up this distribution.

Function arguments

The return value

The return value is a two-dimensional array. The number of rows in the array matches the number of samples used (so the value of the num argument). The first column is the flux value; the remaining columns give the parameter values used to calculate the flux value (the order is that of the parnames field of the get_fit_results() output).

The units for the flux values are the same as that returned by the calc_photon_flux() command.


Examples

Example 1

sherpa> a = sample_photon_flux()
sherpa> print (a[0][0])

Obtain and print one sample of the photon flux distribution from the default model, over the whole energy interval.

Example 2

sherpa> a = sample_photon_flux(0.5, 7.0)

Obtain one sample of the photon flux distribution from the default model, between 0.5 and 7.0 keV.

Example 3

sherpa> a = sample_photon_flux(id="src", num=100)
sherpa> f = a[:,0]

Obtain 100 samples of the photon flux distribution from the "src" model. The flux values are extracted as the one-dimensional array f.


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

plotting
get_energy_flux_hist, get_photon_flux_hist, plot_energy_flux, plot_photon_flux
utilities
sample_energy_flux, sample_flux