Skip to content

Conversation

@bnb32
Copy link
Collaborator

@bnb32 bnb32 commented Jun 12, 2025

Add is_regular_grid arg for CollectorNC. If True set 1D lat / lon arrays for spatial chunks and combine by coords.

@bnb32 bnb32 requested a review from grantbuster June 12, 2025 15:33
Copy link
Member

@grantbuster grantbuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this but i think we could in the future collect curvilinear rectangles just by knowing that the chunks are always ordered in a certain way (row major?). Question would be how to set enumerated coordinates. Maybe just iterate through the sorted chunks knowing you're going through the rows and set the x/y enumerated coordinates incrementally. This would break when you do a masked fwp.

@bnb32
Copy link
Collaborator Author

bnb32 commented Jun 17, 2025

I like this but i think we could in the future collect curvilinear rectangles just by knowing that the chunks are always ordered in a certain way (row major?). Question would be how to set enumerated coordinates. Maybe just iterate through the sorted chunks knowing you're going through the rows and set the x/y enumerated coordinates incrementally. This would break when you do a masked fwp.

Not sure I follow the enumerated coords stuff but generally I think this is a good idea. We'd have to know how many lat / lon chunks there are though so we know when were incrementing through constant lats vs constant lons (maybe this is what you're referring to) but otherwise it could work. Will still require extra logic on top of xr.combine_by_coords but doing could do it with xr.concat over lats and then xr.concat across lons. I'll mull over this more for an improvement down the road. Masking will def break stuff - I think really the best way to handle that case is with h5s.

@bnb32 bnb32 merged commit 421bb9f into main Jun 17, 2025
12 checks passed
@bnb32 bnb32 deleted the bnb/nc_collection branch June 17, 2025 00:30
github-actions bot pushed a commit that referenced this pull request Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants