get_source_contour

sherpa.astro.ui.get_source_contour(id: IdType | None = None, recalc: bool = True, copy: bool = True) sherpa.plot.SourceContour

Return the data used by contour_source.

Changed in version 4.19.0: The contour 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.

recalcbool, optional

If False then the results from the last call to contour_source (or get_source_contour) are returned, otherwise the data is re-generated.

copybool, optional

Is the contour object copied before being returned? If so then the contour attributes will not be changed by multiple calls to this routine.

Returns:
source_dataa sherpa.plot.SourceContour instance

The y attribute contains the model values and the x0 and x1 arrays contain the corresponding coordinate values, as one-dimensional arrays.

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_source_image

Return the data used by image_source.

contour_source

Contour the values of the model, without any PSF.

image_source

Display the source expression for a data set in the image viewer.

Examples

Return the source model pixel values for the default data set:

>>> sinfo = get_source_contour()