-
Notifications
You must be signed in to change notification settings - Fork 44
Add open_multigrid list_grid_names functions #1404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for handling this so quickly! I tested the code with a grid generated by yac and that works well. But when i tried to open the grids from the OASIS benchmarks i stubled across an I used |
Thanks for testing this. I used this script to generate the test files. Maybe some assumptions I made was incorrect there. Can you check and also share the OASIS files you used to test this? |
My last commit might have fixed that. I added a safeguard so xarray no longer tries 2‑D boolean indexing when the OASIS grids leave center_lon/center_lat as DataArrays. Please pull the latest and try your ux.open_multigrid call again—let me know if the IndexError still appears. |
|
great! The Now i get a ValueError: As far as I understood the code, it lacks the detection of multidimensional cell arrays. E.g. here https://github.com/UXARRAY/uxarray/pull/1404/files#diff-9ea4ae11df0f0212a38f7a79686328d0dcf5f0386cd0afcf877981c2fc4d372cR327 only one dimension name for the cells are extracted. As i understood it you could detect the multiple dimensions (e.g. |
…efore building grids
Please pull try again; do you have a test file that I can include in our tests? |
|
Loading the grids works now. But if i add the masks i get the following error: For testing i use the grid files that are contained in the OASIS benchmarks: https://zenodo.org/records/5342778 and a yac generated grid: |
Thanks for the test; Ah, the plot you see if because open_multigrid currently assumes 1 means “keep” and 0 means “discard”. When applied to torc, that inverts the intended meaning: land is kept, ocean is dropped. per grid is better, I think: how about a per-grid dict: |


Fixes #1401
Add support for OASIS/YAC multi-grid SCRIP files so UXarray can read the same debugging grids YAC produces @nils3er - please review.
Also, added a ux.list_grid_names(...) utility for quick inspection of available grids before loading.
This lets UXarray ingest the exact multi-grid outputs from YAC/OASIS-based workflows, paving the way for future coupler history support.