set_full_model

sherpa.astro.ui.set_full_model(id, model=None)

Define the convolved model expression for a data set.

The model expression created by set_model can be modified by “instrumental effects”, such as a PSF set by set_psf. The set_full_model function is for when this is not sufficient, and full control is needed. An example of when this would be if different PSF models should be applied to different source components.

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

  • model (str or sherpa.models.Model object) – This defines the model used to fit the data. It can be a Python expression or a string version of it.

See also

fit

Fit one or more data sets.

set_psf

Add a PSF model to a data set.

set_model

Set the source model expression for a 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 model parameter. If given two un-named arguments, then they are interpreted as the id and model parameters, respectively.

Some functions - such as plot_source - may not work for model expressions created by set_full_model.

Examples

Apply different PSFs to different components, as well as an unconvolved component:

>>> load_psf("psf1", "psf1.dat")
>>> load_psf("psf2", "psf2.dat")
>>> smodel = psf1(gauss2d.src1) + psf2(beta2d.src2) + const2d.bgnd
>>> set_full_model("src", smodel)