-
-
Notifications
You must be signed in to change notification settings - Fork 54
Properties giving order of types in inputs to NDCube.crop and crop_by_values 2 #868
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1458,6 +1458,25 @@ | |||||
self.mask = False | ||||||
return None | ||||||
|
||||||
@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. | ||||||
Comment on lines
+1464
to
+1467
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First line of the docstring should be <80 char. Then a blank line, then a paragraph. (Same below) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also put code snippets in double backticks. |
||||||
""" | ||||||
return tuple(v[0] for v in self.wcs.world_axis_object_classes.values()) | ||||||
|
||||||
@property | ||||||
def crop_by_values_input_units_order(self): | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm much less convinced by the need for this property as we can just say "look at cube.wcs.world_axis_units" in the docstring of |
||||||
""" | ||||||
Returns units of inputs to .crop_by_values() and their required order. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Properties don't return they are.
Suggested change
|
||||||
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) | ||||||
|
||||||
def _create_masked_array_for_rebinning(data, mask, operation_ignores_mask): | ||||||
m = None if (mask is None or mask is False or operation_ignores_mask) else mask | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really feels like it belongs on the WCS API (as
world_classes_order
) or something.