diff --git a/CHANGES.rst b/CHANGES.rst index bdfdebbc7d..1af68ac7e8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,8 @@ Cubeviz Imviz ^^^^^ +- Spatial subsets no longer show as having mixed visibility (in the legend and plot options tab) when aligned by WCS. [#3373] + Mosviz ^^^^^^ diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index 478d89f32e..9273544075 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -1614,7 +1614,9 @@ def _layer_to_dict(self, layer_label): linewidths = [] for viewer in self.viewer_objs: for layer in viewer.layers: - if layer.layer.label == layer_label and is_not_wcs_only(layer.layer): + if (layer.layer.label == layer_label + and is_not_wcs_only(layer.layer) + and is_not_wcs_only(layer.layer.data)): if is_subset is None: is_subset = ((hasattr(layer, 'state') and hasattr(layer.state, 'subset_state')) or # noqa (hasattr(layer, 'layer') and hasattr(layer.layer, 'subset_state'))) # noqa @@ -1768,7 +1770,10 @@ def _sort_by_icon(items_dict): def _sort_by_zorder(items_dict): # NOTE: this works best if subscribed to a single viewer - return -1 * items_dict.get('zorder', 0) + zorder = items_dict.get('zorder', 0) + if zorder is None: + zorder = 0 + return -1 * zorder if self.sort_by == 'zorder': layer_items.sort(key=_sort_by_zorder)