Skip to content
Closed
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
22 changes: 22 additions & 0 deletions ndcube/ndcube.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,28 @@

return utils.cube.get_crop_item_from_points(points, wcs, True, keepdims=keepdims)

@property
def crop_input_types_order(self):
"""
Returns types and order of high-level coordinate objects that must be input to .crop()

Each point given to .crop() must be a tuple of scalar high-level coordinate objects
of these types, in this order. Note, however, that any of these can be replaced
with None if cropping along the axis/axes of that world type in not desired.
"""
return tuple(v[0] for v in self.wcs.world_axis_object_classes.values())

Check warning on line 703 in ndcube/ndcube.py

View check run for this annotation

Codecov / codecov/patch

ndcube/ndcube.py#L703

Added line #L703 was not covered by tests

@property
def crop_by_values_input_units_order(self):
"""
Returns units of inputs to .crop_by_values() and their required order.

Each point given to .crop_by_values() must be a tuple of scalar Quantity objects
with these, or equivalent units. Note, however, that any of these can be replaced
with None if cropping along the axis/axes of that world type in not desired.
"""
return tuple(self.wcs.world_axis_units)

Check warning on line 714 in ndcube/ndcube.py

View check run for this annotation

Codecov / codecov/patch

ndcube/ndcube.py#L714

Added line #L714 was not covered by tests

def __str__(self):
return textwrap.dedent(f"""\
NDCube
Expand Down