-
Notifications
You must be signed in to change notification settings - Fork 300
Unstructured regridder : usage tidying #2273
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
Changes from all commits
ad50e85
757b060
bb712e4
ca1bcec
42fab87
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 |
|---|---|---|
|
|
@@ -206,6 +206,11 @@ def _nearest_neighbour_indices_ndcoords(cube, sample_points, cache=None): | |
| Because this function can be slow for multidimensional coordinates, | ||
| a 'cache' dictionary can be provided by the calling code. | ||
|
|
||
| .. Note:: | ||
|
|
||
| If the points are longitudes/latitudes, these are handled correctly as | ||
| points on the sphere, but the values must be in 'degrees'. | ||
|
Member
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. is this protected somewhere? if i supply radians, will a meaningful exception be raised?
Member
Author
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.
No, it is not checked and will just give wrong answers ! I decided to document this problem rather than fix it, as it is an existing low-level routine. Arguably, we should maybe fix the existing analysis.trajectory.interpolate, as it calls this and so exposes the same problem. I have fixed it in the UnstructuredNearest classes, which now convert everything to degrees (and complain if it fails). |
||
|
|
||
| """ | ||
|
|
||
| # Developer notes: | ||
|
|
||
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 distinction isn't immediately obvious to me: interpolation is a numerical method which can support a regrid operation.
As this is the docstring for a class called
UnstructuredNearestI suggest that this note is simply not requiredUh oh!
There was an error while loading. Please reload this page.
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.
What the words 'regrid' and 'interpolate' mean in Iris terms is that cubes support both a 'regrid' and an 'interpolate' method, which can both specify a "scheme".
UnstructuredNearest is a scheme, and these can generally be used with either interpolate or regrid
-- except that this one can't. ( Similarly, neither can PointInCell ).
So, I'd like to keep this statement.
This arrangement is now well established in Iris.
The practical difference is that a "regrid" uses a grid cube as its reference, while "interpolate" takes coordinate values.
But I do agree that the need for both is questionable, and the choice between is nowhere very clearly explained !!
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.
ok, I'm content with this