Skip to content
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

Improve xarray support #16

Open
bladwig1 opened this issue Apr 12, 2017 · 9 comments
Open

Improve xarray support #16

bladwig1 opened this issue Apr 12, 2017 · 9 comments
Labels
enhancement New feature or request

Comments

@bladwig1
Copy link

bladwig1 commented Apr 12, 2017

Current support for xarray is fairly primitive. Some features that would be nice are:

  • Add support for using xarray.Dataset directly instead of extracting the NetCDF object.
  • Add multidimensional indexing support by using the latlon_to_xy routines.
  • Make isel, sel, and other indexing features work correctly.

This list will be updated as needed.

@bladwig1 bladwig1 added the enhancement New feature or request label Apr 12, 2017
@bladwig1 bladwig1 self-assigned this Apr 12, 2017
@snowman2
Copy link

snowman2 commented Apr 21, 2017

It would be nice to have this as an extension to xarray. That way you could call something like

with xr.open_dataset('/path/to/file.nc') as xd:
    t = xd.wrf.getvar('temp')
    proj4 = xd.wrf.proj4
    cart_proj = xd.wrf.cartopy

See: http://xarray.pydata.org/en/stable/internals.html#extending-xarray

I have used it here:
https://github.com/snowman2/pangaea/blob/master/pangaea/xlsm.py

@snowman2
Copy link

Looks like it would not be bad to try to merge with salem. See: fmaussion/salem#82

@honnorat
Copy link
Contributor

Any news about an improved xarray support ?
It would be nice at first to be able to get data from xarray datasets, like

with xr.open_dataset('/path/to/file.nc') as ds:
    t = wrf.getvar(ds, 'temp')

@Timothy-W-Hilton
Copy link

I'm also wondering about this one. It's not straightforward to use getvar on a large number of WRF output files (see issue 94); seems xarray could help with this.

@jthielen
Copy link

jthielen commented Jan 9, 2020

@Timothy-W-Hilton Thanks for bumping this!

I'd be interested in hearing about the wrf-python maintainers' perspective on this as well. I've been working a fair bit with WRF output in xarray (especially in the context of MetPy and CF conventions, see this abstract), and would be glad to collaborate on these efforts going forward if it seems to be a good fit.

@clyne
Copy link
Collaborator

clyne commented Jan 9, 2020

We, the GeoCAT team at NCAR, do have plans to refactor wrf-python to be compatible with Xarray. However, the team's priority at the moment is rolling out model-agnostic computational routines (called GeoCAT.comp). These new functions operate directly on Xarray data arrays. The repo for these new functions is here: https://github.com/NCAR/geocat-comp

We don't yet have a timeframe for turning our focus back to wrf-python. However, if this is something that someone in the community wanted to bite off we'd be happy to provide guidance.

@jthielen
Copy link

@clyne Thank you for the update! After the hecticness of the AMS Meeting and a few pending projects settle down, I'll see if (and in what ways) I could be of any help with this.

@clyne
Copy link
Collaborator

clyne commented Jan 10, 2020 via email

@Timothy-W-Hilton
Copy link

Thanks, @clyne, for the update! It's nice to know that the slowdown in wrf-python development these past six months doesn't indicate it's being phased out. I'm also open to helping out, though 2020 doesn't really have a lot of space for a large new project for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants