Merge coincident pole and antimeridian nodes in structured grids - #1690
Merge coincident pole and antimeridian nodes in structured grids#1690rajeeja wants to merge 7 commits into
Conversation
Match nodes in Cartesian space rather than the lon/lat plane so pole and antimeridian nodes are recognized as the same point, and store the resulting polar faces as triangles instead of quads with a repeated corner.
|
Checked the docs and user guide for behavior changes: both datasets in |
Sevans711
left a comment
There was a problem hiding this comment.
Thank you for your work on this! Requesting minor changes and clarifications. I will take a closer look at the tests after understanding things a bit better.
Can you clarify, what does this mean from your original comment?
- Now matches in Cartesian space, so nodes that are the same point on the sphere collapse: 899 nodes at 1 deg, 3599 at 0.25 deg.
I was also confused about the following, but I left an inline comment about it, feel free to respond there if that is easier:
- Merging leaves each polar quad with a repeated corner, so those faces are now stored as triangles padded with the fill value.
float32 input (e.g. real climate datasets) silently ran the whole xyz/tolerance pipeline at float32 precision, causing pole/antimeridian merges to fail or merge only partially.
Sevans711
left a comment
There was a problem hiding this comment.
Looks almost ready to merge now, thank you for the changes! Left inline comments with minor style request and noting one typo. Other than that I think it looks good!
Sevans711
left a comment
There was a problem hiding this comment.
Looks ready to merge, thank you for the implementation here and for the back and forth with addressing all of my comments!
Closes #1689
_read_structured_gridmatched nodes in the lon/lat plane, so thenlon+1nodes at each pole and the two sides of the antimeridian were never merged.nlonas expected (36 at 10 deg, 360 at 1 deg) andV - E + F == 2confirms a closed sphere.