get_rmf
- sherpa.astro.ui.get_rmf(id: IdType | None = None, resp_id: IdType | None = None, bkg_id: IdType | None = None)
Return the RMF associated with a PHA data set.
- Parameters:
id (int, str, or None, optional) – The data set to use. If not given then the default identifier is used, as returned by
get_default_id
.resp_id (int, str, or None, optional) – The identifier for the RMF within this data set, if there are multiple responses.
bkg_id (int, str, or None, optional) – Set this to return the given background component.
- Returns:
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
fake_pha
Simulate a PHA data set from a model.
get_response
Return the response information applied to a PHA data set.
load_pha
Load a file as a PHA data set.
load_rmf
Load a RMF from a file and add it to 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_rmf
Read in a RMF from a file.
Examples
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())