About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/get_pflux.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 get_pflux Context: sherpa

Synopsis

get_flux(), get_pflux(), and get_bpflux() calculate the photon flux (unconvolved) for source and background datasets using the module functions in Sherpa.

Syntax

Struct_Type get_flux(Struct_Type)
Struct_Type get_bflux(Struct_Type)
Struct_Type get_flux([Integer_Type[,{Float_Type |
Array_Type}[,String_Type]]])
Struct_Type get_bflux([Integer_Type[,{Float_Type |
Array_Type}[,String_Type]]])

Error Return Values: NULL

Arguments:

(1) Structure of form returned by get_flux_str; or

(1) Dataset number (default 1)

(2) Evaluation point, or lower-upper bounds (default use all data)

(3) Model component or stack name (default use all appropriate models)

Description

The get_pflux and get_bpflux functions retrieve the photon flux, nominally in units of photons/cm^2/s (if the flux is computed over a range), or photons/cm^2/s/keV (or per Angstrom) (if the flux is computed at a single point). The actual units depend upon the units of the input data and whether or not instrument models (e.g. RMF, RSP etc.) have been specified, etc.

The output of get_flux_str(), a structure, can be used as input to get_pflux() and get_bpflux(). One would retrieve this default structure, modify its field values, and pass it to get_pflux() et al. See the example below.

Note that numerical arguments are interpreted using Sherpa's current ANALYSIS setting.

The structure output by these functions contains the following fields:

get_flux Structure Fields

Field Description
dataset the dataset for which the flux is evaluated
range the single point at which the flux is computed, or the range over which the flux is integrated; if NULL, the integral is done over the entire dataset range
comp the model stack or component for which the flux is computed; if NULL, the whole source/bg stack is used
value the computed flux value
units the flux units

See the related Sherpa command FLUX for more information.

Also see these related Sherpa/S-Lang module functions:

Related Sherpa/S-Lang Module Functions

Name Description
get_pflux2d Returns photon fluxes in 2-D images
get_eflux | get_beflux Returns the unconvolved energy flux for source or background datasets
get_eflux2d Returns energy fluxes in 2-D images
get_mcounts_sum | get_bmcounts_sum Returns the sum of convolved model counts in source and background datasets
get_mcounts_sum2d Returns sums of model counts in 2-D images
get_dcounts_sum | get_bdcounts_sum | get_net_counts_sum Returns the sum of observed counts in source and background datasets
get_dcounts_sum2d Returns sums of observed counts in 2-D images

Example 1

Fit an absorbed power law function to the data set and compute the flux between 2 and 10 keV:

sherpa> source= xsphabs[abs]*pow[p1]
sherpa> fit
 LVMQT: V2.0
 LVMQT: initial statistic value = 1401.63
 LVMQT: final statistic value = 235.824 at iteration 5
           abs.nH  0.0626393  10**22 atoms/cm**2  
            p1.gamma  1.70739     
            p1.ampl  6.81852e-05     

sherpa> foo=get_pflux(1,[2,10])
sherpa> print(foo)              
dataset          =  1
range            =  Float_Type[2]
comp             =  NULL
value            =  7.88051e-05
units            =  photons/cm**2/s
sherpa> print(foo.value)
7.88051e-05

Example 2

Define a structure foo and use it to compute the flux between 2 and 10 keV:

sherpa> foo = get_flux_str()
sherpa> print(foo)
dataset          =  1
range            =  NULL
comp             =  NULL
sherpa> foo.range = [2,10]
sherpa> print(get_flux(foo).value)
0.000166532
sherpa> print(get_flux(foo).units)
photons/cm**2/s
sherpa> print(get_pflux(,[2,10],"p").value)
0.000166532

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.