-
Notifications
You must be signed in to change notification settings - Fork 164
Testing and fixing NEMO spatialhash index_search #2153
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
Conversation
The unit test currently fails, because the spatial hash index returned is the cell on the anti-meridian (between 179.875 and 179.875)
|
A simple change to the lines below seems to fix the failing unit test - if xi1[eid] <= xi2[eid]:
+ if abs(xi1[eid] - xi2[eid]) > 225:
+ pass
+ elif xi1[eid] <= xi2[eid]:This way, the grid cells that span the antemeridian (where the left corner is 179.875 and the right corner is -179.875) are not included in the hash table. However, we would need to make this work only when the field @fluidnumerics-joe, does this give you some pointers/ideas how to fix the PS: Note that the 'special' value of |
as suggested in #2153 (comment)
|
With the new Morton having, this test passes. Good to pull it into the test-suite? |

This PR adds a unit test for spatial hash on 1/4 degree NEMO curvilinear grid (from https://github.com/OceanParcels/parcels-data/tree/main/data/NemoCurvilinear_data).
The unit test currently fails, because the spatial hash index returned is the cell on the anti-meridian (between 179.875 and 179.875; which technically also surrounds the location) instead of the cell that snugly surrounds the location
mainfor v3 changes,v4-devfor v4 changes)