Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

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


AHELP for CIAO 4.9 Sherpa v1

calc_model_sum

Context: utilities

Synopsis

Calculate the sum of convolved model counts

Syntax

calc_model_sum( [lo,hi,id,bkg_id] )

Description

The calc_model_sum function calculates the sum of convolved model counts 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 amplitudes of unconvolved source or background models in units of counts/cm^2/sec/keV (or counts/cm^2/sec/A), the function calc_source_sum can be used by data ID or background ID.

  • lo - lower limit ( default=None ); the units are the determined by the analysis setting ("get_analysis")
  • hi - high limit ( default=None ); the units are the determined by the analysis setting ("get_analysis")
  • 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 command ignores any range filters that have been applied to the dataset. If calc_model_sum is called with no arguments, the convolved model counts will be summed over the entire data range of the default data set.

The counts of a convolved 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) a single energy, wavelength, or bin number is given (as opposed to a [lo, hi] interval), then the sum of convolved model 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 sum of convolved model counts for the given range is returned.

o) no value or range is specified, then the sum of convolved model 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.

Example 1

sherpa> calc_model_sum()

When supplied with no arguments, calc_model_sum will sum the convolved model counts over the entire data range of the default data set.

Example 2

sherpa> calc_model_sum(id=3)

Here, data set "3" is specified, so the convolved model counts will be summed over the entire data range of data set 3.

Example 3

sherpa> calc_model_sum(10.0, id=4)

The sum of convolved model counts in the bin(s) corresponding to 10.0 keV in data set 4 is returned.

Example 4

sherpa> calc_model_sum(id=1, bkg_id=1)

When supplied with a background ID, the convolved background model associated with the specified background data set will be summed over the entire data range. In this example, the first background data set loaded in association with source data set 1 is used.

Example 5

sherpa> calc_model_sum(lo=0.1, hi=7.0, "bkg")

The convolved background model 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)

Example 6

sherpa> calc_model_sum(1.0, 15.0,id=1, bkg_id=2)

The convolved background model counts between 1 and 15 angstroms are summed for the second background data set automatically loaded by Sherpa with source data set 1.

Bugs

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

See Also

data
get_bkg_plot
info
list_model_ids, show_bkg_model, show_bkg_source
modeling
add_model, add_user_pars, clean, create_model_component, delete_bkg_model, delete_model, delete_model_component, get_model, get_model_autoassign_func, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_source, get_source_component_image, get_source_component_plot, image_model, image_model_component, image_source, image_source_component, integrate, integrate1d, link, load_table_model, load_template_model, load_user_model, normal_sample, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset, t_sample, uniform_sample
plotting
get_lrt_plot, get_lrt_results, get_pvalue_plot, get_pvalue_results, plot_cdf, plot_model, plot_model_component, plot_pdf, plot_pvalue, plot_scatter, plot_source, plot_source_component, plot_trace
psfs
delete_psf, load_conv
saving
save_delchi, save_resid
tools
aprates, modelflux
utilities
calc_chisqr, calc_energy_flux, calc_photon_flux, calc_source_sum, calc_stat, eqwidth, gamma, igam, igamc, incbet, lgam
visualization
contour_model, contour_ratio, contour_resid, get_ratio, get_resid

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

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