get_model_image

sherpa.ui.get_model_image(id=None)

Return the data used by image_model.

Evaluate the source expression for the image pixels - including any PSF convolution defined by set_psf - and return the results.

Parameters:id (int or str, optional) – The data set. If not given then the default identifier is used, as returned by get_default_id.
Returns:src_img – The y attribute contains the source model values as a 2D NumPy array.
Return type:a sherpa.image.ModelImage instance
Raises:sherpa.utils.err.IdentifierErr – If the data set does not exist or a source expression has not been set.

See also

get_source_image()
Return the data used by image_source.
contour_model()
Contour the values of the model, including any PSF.
image_model()
Display the model for a data set in the image viewer.
set_psf()
Add a PSF model to a data set.

Examples

Calculate the residuals (data - model) for the default data set:

>>> minfo = get_model_image()
>>> dinfo = get_data_image()
>>> resid = dinfo.y - minfo.y