Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/integrate.html
Jump to: Description · Example · Bugs · See Also


AHELP for CIAO 4.15 Sherpa

integrate

Context: modeling

Synopsis

Controlling the integration of model components

Syntax

modelname.integrate=False
modelname.integrate=True

Description

The integration of models in CIAO4 Sherpa is controlled by an integration flag in each model structure.

Sherpa source and background models are integrated over bins in energy-space or wavelength-space before being folded through an instrument, or over bins in counts-space if no instrument model is specified. If integration is turned off, then the model values at the entered data points are used for non-binned data. For binned data, the model values at the left side of the bin are used in the fitting. Changing the integration status of a model component will have no affect if the data are not binned.

There is no control from Sherpa over the integration setting of XSPEC source models. Additionally, there is no integration setting for instrument models.

Certain combinations of additive/integrated and multiplicative/non-integrated model components are not allowed - such as by adding two model components with different integration settings - as they can not produce meaningful results. Sherpa will issue a warning when it detects an unacceptable combination.

Why do the model units change when integrate is turned on/off?

In general, the relevant parameters of a model (e.g., positions, radii, amplitudes) match up with the COORD setting. If you are working in image coordinates, model parameters will also refer to image coordinates. This can change, however, if you change the integrate setting of the model.

If you create a model, e.g. a beta2d model, and turn integration off, you will get the model value at a point (x,y). In that case, the units are just "counts" since the rest of the beta2d expression is unitless (see "ahelp beta2d" for details).

When you turn integrate on, you are telling Sherpa to bin up the model values for you. Sherpa evaluates the model at (x_lo, y_lo) and (x_hi, y_hi), and bins it so that you get all the counts that happened in that bin, not just at some particular point in data space. Since the bin size is being taken into account, the value really means "counts/bin" or "counts/pixel", not simply "counts".

To see the difference that integrate makes, use the image_model command to display the model values in ds9. Change the integrate setting and image the model again to see how the values change.


Example

sherpa> set_source(xsphabs.abs1 * powlaw1d.p1)
sherpa> p1.integrate
True
sherpa> p1.integrate=False
sherpa> p1.integrate
False

Define a model and turn off the integration for the "p1" component.


Bugs

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

See Also

data
get_bkg_chisqr_plot, get_bkg_delchi_plot, get_bkg_fit_plot, get_bkg_model_plot, get_bkg_plot, get_bkg_ratio_plot, get_bkg_resid_plot, get_bkg_source_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_num_par_frozen, get_num_par_thawed, get_order_plot, get_par, get_pileup_model, get_source, get_source_component_image, get_source_component_plot, get_source_contour, get_source_image, get_source_plot, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, image_model, image_model_component, image_source, image_source_component, link, load_table_model, load_template_interpolator, load_template_model, load_user_model, normal_sample, reset, save_model, save_source, set_bkg_model, set_bkg_source, set_full_model, set_model, set_model_autoassign_func, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset, t_sample, uniform_sample
plotting
get_cdf_plot, get_pdf_plot, 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
utilities
calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth
visualization
contour_model, contour_ratio, contour_resid