Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix subset histogram bug in plot options #2393

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Bug Fixes
the selection when the choices change if any of the previous entries are still
valid. [#2344]

- Fixed Plot Options stretch histogram bug that raised an error when a spatial subset
was selected in Imviz and Cubeviz. [#2393]

Cubeviz
^^^^^^^

Expand Down
5 changes: 5 additions & 0 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from astropy.visualization import PercentileInterval
from traitlets import Any, Dict, Float, Bool, Int, List, Unicode, observe

from glue.core.subset_group import GroupedSubset
from glue.viewers.scatter.state import ScatterViewerState
from glue.viewers.profile.state import ProfileViewerState, ProfileLayerState
from glue.viewers.image.state import ImageSubsetLayerState
Expand Down Expand Up @@ -579,6 +580,10 @@ def _update_stretch_histogram(self, msg={}):
# skip further updates if no data are available:
return

if isinstance(data, GroupedSubset):
# don't update histogram for subsets:
return

comp = data.get_component(data.main_components[0])

# TODO: further optimization could be done by caching sub_data
Expand Down