get_model_image
- sherpa.astro.ui.get_model_image(id: IdType | None = None, copy: bool = True) sherpa.image.ModelImage
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.Changed in version 4.19.0: The image object is now copied by default. To get the previous behaviour set the
copyattribute toFalse.- Parameters:
- id
int,str,orNone,optional The data set. If not given then the default identifier is used, as returned by
get_default_id.- copybool,
optional Is the plot object copied before being returned? If so then the plot attributes will not be changed by multiple calls to this routine.
- id
- Returns:
- src_img
asherpa.image.ModelImageinstance The
yattribute contains the source model values as a 2D NumPy array.
- src_img
- Raises:
sherpa.utils.err.IdentifierErrIf the data set does not exist or a source expression has not been set.
See also
get_source_imageReturn the data used by image_source.
contour_modelContour the values of the model, including any PSF.
image_modelDisplay the model for a data set in the image viewer.
set_psfAdd 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