Skip to content

Commit

Permalink
Backport PR spacetelescope#3097: Exclude subsets from WCS-only layer …
Browse files Browse the repository at this point in the history
…filter
  • Loading branch information
bmorris3 committed Jul 18, 2024
1 parent f96b8c0 commit aa1c2ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Cubeviz
Imviz
^^^^^

- Exclude subset layers from the orientation options in the Orientation plugin. [#3097]

Mosviz
^^^^^^

Expand Down
16 changes: 7 additions & 9 deletions jdaviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,14 @@ def layer_is_table_data(layer):


def is_wcs_only(layer):
# exclude WCS-only layers from the layer choices:
# identify WCS-only layers
if hasattr(layer, 'layer'):
state = layer.layer
elif hasattr(layer, 'data'):
state = layer.data
elif hasattr(layer, 'meta'):
state = layer
else:
raise NotImplementedError
return getattr(state, 'meta', {}).get(_wcs_only_label, False)
layer = layer.layer

return (
# WCS-only layers have a metadata label:
getattr(layer, 'meta', {}).get(_wcs_only_label, False)
)


def is_not_wcs_only(layer):
Expand Down

0 comments on commit aa1c2ce

Please sign in to comment.