Calculate the sum of observed data counts
calc_data_sum( [lo,hi,id,bkg_id] )
The calc_data_sum function calculates the sum of observed data
counts in all or a portion of a source or background
data set by data ID or background ID.
A subset of the data 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. Calc_data_sum accepts binned, unbinned,
background-subtracted and unsubtracted data.
-
lo - low limit;
default=None
-
hi - high limit;
default=None
-
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_data_sum function can be called with no
arguments, in which case the observed counts will be
summed over the entire data range of the default data
set. The counts in any background data set can be summed
by supplying the background ID as the argument. It is
possible to supply background-subtracted source data to
calc_data_sum; the raw counts sum can be found by calling
"unsubtract()" before "calc_data_sum()".
For 1-D data, if
o) a single energy, wavelength, or bin number is
given (as opposed to a [lo, hi] interval), then the
sum of data counts in the bin associated with that value
is returned.
o) an energy or wavelength range is given with the 'lo' and 'hi'
arguments, then the total summed data counts for the given range is
returned.
o) no value or range is specified, then the total summed data counts
for the full range of the data set is returned.
For 2-D data, the summation is carried out over the entire input image.
When supplied with no arguments, calc_data_sum will sum
the observed data counts over the entire data range of the
default data set.
sherpa> calc_data_sum(id=3)
Here, data set "3" is specified, so the total summed counts
of the entire data range of data set 3 will be returned.
sherpa> calc_data_sum(10.0, id=4)
The total observed counts in the bin(s) corresponding to
10.0 keV in data set 4 are summed.
sherpa> calc_data_sum(bkg_id=1)
When supplied with a background ID, the total observed
background counts
in the entire data range of the specified background data
set will be summed. In this example, the first background
data set automatically located by Sherpa is used.
sherpa> calc_data_sum(lo=0.1, hi=7.0, "bkg")
The total observed background counts between 0.1 and 7.0 keV are summed for the
background data set with user-assigned ID "bkg". (Note
that a user-defined string ID cannot be supplied to the
"bkg_id" argument)
sherpa> calc_data_sum(1.0, 15.0,id=1, bkg_id=2)
The total observed background counts between 1 and 15 angstroms are
summed in the second background data set automatically
loaded by Sherpa with source data set 1.
- py.sherpa
-
calc_data_sum2d,
calc_ftest,
calc_kcorr,
calc_mlr,
calc_model_sum2d,
calc_source_sum2d,
clean,
contour,
contour_data,
contour_ratio,
copy_data,
dataspace1d,
dataspace2d,
delete_data,
get_axes,
get_bkg_plot,
get_counts,
get_data,
get_data_plot,
get_default_id,
get_dep,
get_dims,
get_error,
get_filter,
get_rate,
get_ratio,
get_resid,
get_specresp,
group,
histogram1d,
histogram2d,
image_data,
list_data_ids,
list_response_ids,
load_ascii,
load_data,
plot_data,
rebin,
set_data,
ungroup,
unpack_ascii,
unpack_data
|