Skip to content

SCRIP encode writes NaN into padded corners, leaving an extra NaN node on read #1911

Open

Description

@cmdupuis3

_encode_scrip fills the padded slots of a ragged mesh with NaN in grid_corner_lat/lon. SCRIP has no fill value for corners, so the NaNs are written to disk as if they were coordinates. On main, the reader no longer uses NaN corners in face_node_connectivity, because the valid_corners mask turns them back into INT_FILL_VALUE. But the node de-duplication still collapses every NaN corner into one node with NaN coordinates that no face uses. A round trip therefore adds a node: 6 nodes become 7, and one of them has node_lon/node_lat = NaN. That NaN node can break anything that reads node coordinates, such as bounds or plotting. Two possible fixes: pad by repeating the last valid corner, which is the usual SCRIP convention, or drop non-finite corners before the de-duplication so they never become a node. Sub-issue of #1658.

Activity

  1. self-assigned this
    on Nov 19, 2026
  2. added
    bug
    on Nov 19, 2026
  3. moved this from 📚 Backlog to 📝 To-Do in UXarray Developmenton Nov 19, 2026
  4. changed the title [-]SCRIP encode writes NaN into padded corners, leaving an extra NaN node on read*[/-] [+]SCRIP encode writes NaN into padded corners, leaving an extra NaN node on read[/+] on Nov 19, 2026
  5. added
    accuracy
    on Nov 19, 2026
  6. moved this from 📝 To-Do to 🏗 In progress in UXarray Developmenton Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

accuracybug

Type

No type

Fields

Priority

Medium

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions