xMIP
xMIP copied to clipboard
Try to use cf-xarray for some things?
Right now cmip6 preprocessing works by directly renaming variables / dimensions to homogenize across models.
Another model would be to try to fill in cf-compliant metadata for all the datasets, and then use cf-xarray: https://cf-xarray.readthedocs.io/en/latest/examples/introduction.html
I think that has some architectural advantages over the current model.
cc @dcherian
A possible roadmap:
- would be to add nice attributes after renaming variables (e.g.
axis: X,standard_name: longitudeetc.) - using
cf-xarrayto generate a renaming dict when possible. Fix #52. We can makeDataset.cf.renamework so that this will be easy. - use
cfxr.bounds_to_vertexandcfxr.vertex_to_bounds(https://cf-xarray.readthedocs.io/en/latest/api.html#top-level-api) instead of reimplementing them.
Yes to all of those. I have been using cf-xarray in my prototype code for 3. already, so that just needs to be ported.
I have recently encountered a real need for 1., so I think that would be a great point to start. Do you think you have capacity to work on this @dcherian? I will get to it, but probably not before next week.
Thanks for the patience.
Do you think you have capacity to work on this @dcherian?
Nope :) but happy to help debug / implement / review / merge things on the cf-xarray side
Hehe, that is amazing, many thanks. Thanks. Ill ping you as soon as I can put some cycles in!
Just curious: would cf-xarray help with the xfails in #89 ?
Not entirely sure about that. My approach for this was to get this running with 'blindly' failing some datasets. After that works, I wanted to dig into details about why each one of these fails and how to solve them, one by one. I think that refactoring the internals with cf-xarray will help for sure, but I doubt it will be a super easy 'plug and play solution'. Thats why I wanted to have a broad baseline of tests (even if they fail) before diving in.