-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove delr and delc from ds #346
Conversation
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.
Nice! Only some small comments from me
nlmod/dims/resample.py
Outdated
@@ -92,6 +92,30 @@ def get_xy_mid_structured(extent, delr, delc, descending_y=True): | |||
raise TypeError("unexpected type for delr and/or delc") | |||
|
|||
|
|||
def get_delr(ds): | |||
"""Get the distance along rows (delr) fromythe x-coordinate of a model dataset""" |
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.
Can you make a full docstring with in-and output types?
nlmod/dims/resample.py
Outdated
"""Get the distance along columns (delr) from the x-coordinate of a model dataset""" | ||
assert ds.gridtype == "structured" | ||
y = (ds.extent[3] - ds.y).values | ||
delc = _get_delr_from_x(y) |
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.
Kind of counterintuitive to call _get_delr_from_x to get_delc_from_y. Maybe rename the private method to _get_delta_along_axis or something similar?
This pull request remove delr and delc from ds. When needed, these variables can be calculated from extend, x and y. Also see issue #343.