get_exposure
- sherpa.astro.ui.get_exposure(id: IdType | None = None, bkg_id: IdType | None = None)
Return the exposure time of a PHA data set.
The exposure time of a PHA data set is taken from the EXPTIME keyword in its header, but it can be changed once the file has been loaded.
- Parameters:
- id
int,str,orNone,optional The identifier for the data set to use. If not given then the default identifier is used, as returned by
get_default_id.- bkg_id
int,str,orNone,optional Set to identify which background component to use. The default value (
None) means that the time is for the source component of the data set.
- id
- Returns:
- exposure
number The exposure time, in seconds.
- exposure
See also
get_areascalReturn the fractional area factor of a PHA data set.
get_backscalReturn the area scaling of a PHA data set.
set_exposureChange the exposure time of a PHA data set.
Examples
Return the exposure time for the default data set.
>>> t = get_exposure()
Return the exposure time for the data set with identifier 2:
>>> t2 = get_exposure(2)
Return the exposure time for the first background component of data set “core”:
>>> tbkg = get_exposure('core', bkg_id=1)