Uh oh!
There was an error while loading. Please reload this page.
Testing and fixing NEMO spatialhash index_search - #2153
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)
erikvansebille
commented
Aug 19, 2025
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 |
erikvansebille
commented
Aug 20, 2025
as suggested in #2153 (comment)
erikvansebille
commented
Sep 1, 2025
With the new Morton having, this test passes. Good to pull it into the test-suite? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.

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)