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

Return the RMF associated with a PHA data set.

  • 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 RMF within this data set, if there are multiple responses.

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


rmf – This is a reference to the RMF, 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.RMF1D instance

See also


Simulate a PHA data set from a model.


Return the respone information applied to a PHA data set.


Load a file as a PHA data set.


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


Define the convolved model expression for a data set.


Set the ARF for use by a PHA data set.


Set the RMF for use by a PHA data set.


Read in a RMF from a file.


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

>>> rmf1 = get_rmf()
>>> set_rmf(2, rmf1)

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

>>> bgrmf = get_rmf('core', 'bkg.rmf', 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())