SCH-1073: Add face-centered subset support#5
Merged
Conversation
added 4 commits
February 23, 2026 10:09
…ure for element data
kjnam
approved these changes
Apr 24, 2026
Member
kjnam
left a comment
There was a problem hiding this comment.
Alex tested with a full Bay-Delta data and reported the change worked fine.
kjnam
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SCH-1073: Add face-centered subset support
Summary
Adds support for subsetting face-centered (element) data by computing and assigning z-coordinates at edges and faces, and fixes an issue with
sgrid_iselthat blocked element-based subsetting.Changes
Z-coordinate computation:
suxarray/io/_schismgrid.py_assign_z_coordsto derive 1D static (node_z,edge_z,face_z) and 3D time-varying (node_z_3d,edge_z_3d,face_z_3d) z-coordinates from node-levelzCoordinates._calculate_edge_z— averages node z-coordinates for each edge._calculate_face_z— averages node z-coordinates for each face, handling triangular and quad elements._read_schism_gridso z-coordinates are assigned when z-coordinate files are provided.Bug fix:
suxarray/grid/grid.pysgrid_isel: now excludesinverse_indicesalong with grid dimensions to avoid invalid xarray-dimension errors during subsetting.Tests & fixtures:
tests/testfixtures.py: addedsxds_element_testfixture loading face-centered test data (out2d_alt_*.nc,zCoordinates_alt_*.nc,verticalVelAtElement_*.nc).tests/test_suxarray.py: addedtest_subset_elements_bounding_polygonto verify bounding-box subsetting on element-centered data.tests/testdata/.Notes