Skip to content

Grid.from_structured does not merge coincident pole and antimeridian nodes #1689

Closed

Description

@rajeeja
  • _read_structured_grid builds its KDTree on raw (lon, lat) pairs, so nodes that are the same point on the sphere are never merged.
  • At the pole all nlon+1 nodes sit at lat=90 with distinct lons; at the seam -180.5 and 179.5 differ by exactly 360.
  • Result: n_node is exactly (nlon+1)*(nlat+1), zero merges. 899 nodes should collapse at 1 deg, 3599 at 0.25 deg.
  • The mesh is topologically torn: the pole node should have valence nlon (360 at 1 deg, 1440 at 0.25 deg) but reports 4.
  • Only affects the native to_rectilinear backend; YAC uses reg_2d_new with a cyclic flag and never enumerates nodes.
  • Fix: merge in Cartesian space inside _read_structured_grid.
  • Related to Handling Duplicate Node Indices  #865, which raises the same pole/antimeridian concern for duplicate nodes generally.

Activity

  1. self-assigned this
    on Aug 19, 2026
  2. added
    bug
    on Aug 19, 2026
  3. moved this from 📚 Backlog to 👀 In review in UXarray Developmenton Aug 21, 2026
  4. moved this from 👀 In review to ✅ Done in UXarray Developmenton Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions