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

Exclude subsets from WCS-only layer filter #3097

Merged
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
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ Imviz
- Fix multiple footprints bug that prevented footprint updates on changes to the
viewer orientation. [#2918]

- 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 @@ -241,16 +241,14 @@


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

Check warning on line 246 in jdaviz/utils.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/utils.py#L246

Added line #L246 was not covered by tests

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


def is_not_wcs_only(layer):
Expand Down
Loading