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

Raise error if user slices NDCube with Ellipsis. #224

Merged
merged 3 commits into from
Mar 19, 2020
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
1 change: 1 addition & 0 deletions changelog/224.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Raises error if NDCube is sliced with an Ellipsis.
4 changes: 4 additions & 0 deletions ndcube/utils/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ def _wcs_slicer(wcs, missing_axes, item):
new_wcs = wcs.slice(item_checked)
# if it a tuple like [0:2, 0:3, 2] or [0:2, 1:3]
elif isinstance(item, tuple):
# Ellipsis slicing is currently not supported.
# Raise an error if user tries to slice by ellipsis.
if Ellipsis in item:
raise NotImplementedError("Slicing FITS-WCS by ellipsis not supported.")
# this is used to not exceed the range of the item tuple
# if the check of the missing_axes which is False if not dead
# is a success than the the item of the tuple is added one by
Expand Down