The calc_source_sum function calculates the sum of unconvolved
source or background model amplitudes for
all or a portion of a source or background data set by data ID
or background ID. A subset of the model can be specified by
entering the low and high ends of the desired data interval in
units of keV for energy data or Angstroms for
wavelength data. To sum the counts of convolved source or background
models, the function calc_model_sum can be used by data ID or
background ID.
-
lo - low limit;
default=NULL
-
hi - high limit;
default=NULL
-
id - data ID;
if not given, uses the default sherpa id (id=1 by default, see "ahelp get_default_id")
-
bkg_id - background data ID
The calc_source_sum function can be called with no
arguments, in which case the unconvolved model amplitudes
will be summed over the entire data range of the
default data set. The amplitudes of an unconvolved
background model can be summed by
supplying the corresponding Sherpa-assigned background ID
as the argument (e.g. "1" or "2" for the first or second
background data set automatically
located by Sherpa in the corresponding source data set).
For 1-D data, if:
o) one energy (or wavelength) is given (as opposed to a
[lo, hi] interval), then the model amplitude at
that energy (or wavelength) is returned in units of
counts/cm^2/sec/keV (or counts/cm^2/sec/A).
o) an energy or wavelength range is given with the 'lo' and 'hi'
arguments, then the total integrated model amplitudes over the given
range is returned in units of counts/cm^2/sec.
o) no value or range is specified, then the total integrated model amplitude
over the full range of the dataset is returned in units of
counts/cm^2/sec.
For 1-D data, if an instrument model is not used, the units are
assumed to be counts, or counts per bin-width. See the Note on Units below.
For 2-D data the total integrated model amplitudes is carried out over
the entire input image.
Note on Units: In its current incarnation, Sherpa has no explicit
knowledge of data or model units. The units displayed with computed
fluxes are defaults, generally correct for standard analyses of 1-D PHA
energy/wavelength spectra (XSPEC-like analyses). They may be incorrect
for non-standard analyses, or for analyses of 2-D spatial images with
exposure maps, etc. The correct units can be determined by working
backwards from the data, taking into account the exposure time, the
units of the instrument model, the bin units, etc.