get_ratio_image

sherpa.astro.ui.get_ratio_image(id: IdType | None = None, copy: bool = True) → sherpa.image.RatioImage

Return the data used by image_ratio.

Changed in version 4.19.0: The image object is now copied by default. To get the previous behaviour set the copy attribute to False.

Parameters:
idint, str, or None, 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.

Returns:
ratio_imga sherpa.image.RatioImage instance

The y attribute contains the ratio values as a 2D NumPy array.

Raises:
sherpa.utils.err.DataErr

If the data set is not 2D.

sherpa.utils.err.IdentifierErr

If the data set does not exist or a source expression has not been set.

See also

get_resid_image

Return the data used by image_resid.

contour_ratio

Contour the ratio of data to model.

image_ratio

Display the ratio (data/model) for a data set in the image viewer.

Examples

Return the ratio data for the default data set:

>>> rinfo = get_ratio_image()