get_model_component_image
- sherpa.astro.ui.get_model_component_image(id, model=None, copy: bool = True) sherpa.image.ComponentModelImage
Return the data used by image_model_component.
Changed in version 4.19.0: The plot object is now copied by default. To get the previous behaviour set the
copyattribute toFalse.- Parameters:
- id
intorstr,optional The data set. If not given then the default identifier is used, as returned by
get_default_id.- model
strorsherpa.models.model.Modelinstance The component to display (the name, if a string).
- 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:
- cpt_img
asherpa.image.ComponentModelImageinstance The
yattribute contains the component model values as a 2D NumPy array.
- cpt_img
- Raises:
sherpa.utils.err.IdentifierErrIf the data set does not exist or a source expression has not been set.
See also
get_source_component_imageReturn the data used by image_source_component.
get_model_imageReturn the data used by image_model.
image_modelDisplay the model for a data set in the image viewer.
image_model_componentDisplay a component of the model in the image viewer.
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
modelparameter. If given two un-named arguments, then they are interpreted as theidandmodelparameters, respectively.Examples
Return the gsrc component values for the default data set:
>>> minfo = get_model_component_image(gsrc)
Get the
bgndmodel pixel values for data set 2:>>> minfo = get_model_component_image(2, bgnd)