ApertureSubsetSelect#
- class jdaviz.core.template_mixin.ApertureSubsetSelect(**kwargs: Any)[source]#
Bases:
SubsetSelect
Plugin select for aperture subsets, with support for single or multi-selection, as well as live-preview rendered in the viewers.
Useful API methods/attributes:
selected
select_all()
(only ifis_multiselect
)select_none()
(only ifis_multiselect
)
Traitlets (in the object, custom traitlets in the plugin):
items
(list of dicts with keys: label, color, type)selected
(string)selected_validity
(dict)
Properties (in the object only):
labels
(list of labels corresponding to items)selected_item
(dictionary initems
coresponding toselected
, cached)selected_obj
(subset object corresponding toselected
, cached)marks
(list of marks added to image viewers in the app to preview the apertures)
Methods (in the object only):
selected_min_max(cube)
(quantity, only applicable for spectral subsets)
To use in a plugin:
create (empty) traitlets in the plugin
register with all the automatic logic in the plugin’s init by passing the string names of the respective traitlets.
use component in plugin template (see below)
refer to properties above based on the interally stored reference to the instantiated object of this component
observe the traitlets created and defined in the plugin, as necessary
Example template (label and hint are optional):
<plugin-subset-select :items="aperture_items" :selected.sync="aperture_selected" :show_if_single_entry="true" label="Aperture" hint="Select aperture." />
- Parameters:
- plugin
the parent plugin object
- itemsstr
the name of the items traitlet defined in
plugin
- selectedstr
the name of the selected traitlet defined in
plugin
- selected_validity: str
the name of the selected validity dict traitlet defined in
plugin
- scale_factorstr
the name of the traitlet defining the radius factor for the drawn aperture
- multiselectstr
the name of the traitlet defining whether the dropdown should accept multiple selections
- datasetstr
the name of the dataset traitlet defined in
plugin
, to be used for accessing how the subset is applied to the data (masks, etc), optional- viewerslist
the reference names or ids of the viewer to extract the subregion. If not provided or None, will loop through all references.
Attributes Summary
Methods Summary
get_mask
(flux_cube, aperture_method, ...[, ...])Attributes Documentation
- image_viewers#
- is_composite#
- marks#
Methods Documentation