-
Notifications
You must be signed in to change notification settings - Fork 75
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
Download multiple fields with FastHerbie? #242
Comments
It looks like I can pull multiple variables, as long as they are at the same level/height. E.g., DATES = pd.date_range(start='2023-06-21 06:00',
end='2023-06-22 06:00',
freq='24H')
fxx = range(30,32)
variables = 'UGRD:10 m|VGRD:10 m' # <--- two variables, both at 10 m
FH = FastHerbie(DATES, model="HRRR", product="sfc", fxx=fxx)
ds = FH.xarray(variables) works ok. I'd still be interested in knowing if there is a way to pull multiple variables at multiple heights. I'm my case, I don't need the height information, so that could be dropped/overridden. |
Hi @williamhobbs, that's pretty much what I would have done. The main limitation is in cfgrib which sets the variable level as a coordinate. Since the xarray Datasets with different levels can't be joined together, cfgrib instead returns a list of Datasets. It could be possible for Herbie to drop the level coordinate so you can join things together, but I hesitate trimming metadata. I actually think the right solution is for cfgrib to return an xarray Datatree instead of a list of Datasets. This hasn't really gone anywhere yet, but I'd love to see it happen. xarray-contrib/datatree#195. See also ecmwf/cfgrib#344 and pydata/xarray#7437 |
Thanks. That's helpful background. I'll close this issue - let me know if you'd like me to leave it open. |
Is there a simple way to download multiple variables/fields at once with
FastHerbie()
?For example, this:
returns:
and
I could run a loop, downloading a dataset one variable at a time, but I wanted to make sure there wasn't a better way to do it.
Thanks!
The text was updated successfully, but these errors were encountered: