get_arf¶

sherpa.astro.ui.get_arf(id=None, resp_id=None, bkg_id=None)

Return the ARF associated with a PHA data set.

Parameters
• id (int or str, optional) – The data set to use. If not given then the default identifier is used, as returned by get_default_id.

• resp_id (int or str, optional) – The identifier for the ARF within this data set, if there are multiple responses.

• bkg_id (int or str, optional) – Set this to return the given background component.

Returns

arf – This is a reference to the ARF, rather than a copy, so that changing the fields of the object will change the values in the data set.

Return type

a sherpa.astro.instrument.ARF1D instance

fake_pha()

Simulate a PHA data set from a model.

get_response()

Return the respone information applied to a PHA data set.

load_arf()

Load an ARF from a file and add it to a PHA data set.

load_pha()

Load a file as a PHA data set.

set_full_model()

Define the convolved model expression for a data set.

set_arf()

Set the ARF for use by a PHA data set.

set_rmf()

Set the RMF for use by a PHA data set.

unpack_arf()

Read in an ARF from a file.

Examples

Return the exposure field of the ARF from the default data set:

>>> get_arf().exposure


Copy the ARF from the default data set to data set 2:

>>> arf1 = get_arf()
>>> set_arf(2, arf1)


Retrieve the ARF associated to the second background component of the ‘core’ data set:

>>> bgarf = get_arf('core', 'bkg.arf', bkg_id=2)


Retrieve the ARF and RMF for the default data set and use them to create a model expression which includes a power-law component (pbgnd) that is not convolved by the response:

>>> arf = get_arf()
>>> rmf = get_rmf()
>>> src_expr = xsphabs.abs1 * powlaw1d.psrc
>>> set_full_model(rmf(arf(src_expr)) + powlaw1d.pbgnd)
>>> print(get_model())