Last modified: December 2020

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_exposure.html
Jump to: Description · Examples · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.13 Sherpa v1

set_exposure

Context: data

Synopsis

Change the exposure time of a PHA data set.

Syntax

set_exposure(id, exptime=None, bkg_id=None)

id - int or str, optional
exptime - num
bkg_id - int or str, optional

Description

The exposure time of a PHA data set is taken from the exposure keyword in its header, but it can be changed once the file has been loaded.


Examples

Example 1

Increase the exposure time of the default data set by 5 per cent.

>>> etime = get_exposure()
>>> set_exposure(etime * 1.05)

Example 2

Use the EXPOSURE value from the ARF, rather than the value from the PHA file, for data set 2:

>>> set_exposure(2, get_arf(2).exposure)

Example 3

Set the exposure time of the second background component of the 'jet' data set.

>>> set_exposure('jet', 12324.45, bkg_id=2)

PARAMETERS

The parameters for this function are:

Parameter Definition
id The identifier for the data set to use. If not given then the default identifier is used, as returned by `get_default_id` .
exptime The exposure time, in seconds.
bkg_id Set to identify which background component to set. The default value ( none ) means that this is for the source component of the data set.

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `exptime` parameter. If given two un-named arguments, then they are interpreted as the `id` and `exptime` parameters, respectively. The remaining parameters are expected to be given as named arguments.


Bugs

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

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
get_exposure, set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
get_par, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
set_analysis, set_default_id
visualization
image_setregion