Using Xarray's map_blocks() with MetPy functions? #2914
Unanswered
DanielAdriaansen
asked this question in
Q&A
Replies: 1 comment 5 replies
-
|
Try this instead: xr.map_blocks(mpcalc.precipitable_water,
args=[gfs_ds['P3D'],gfs_ds['TD']],
kwargs={'bottom':(1000.0*units('hectopascal')),'top':(100.0*units('hectopascal'))},
template=gfs_ds['TD'].isel(isobaric=0)).compute()If you use the dataset version (like you do originally):
I'm not sure this will work, but it should address the original error. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I know that there's several limitations to processing gridded data through functions that rely on
get_layer()(e.g. #1533), but I was wondering if a possible workaround is to usexr.map_blocks()for these functions onto chunked arrays, or whether the limitation inget_layer()would prevent this also?Here is a somewhat simple example of what I am trying:
I end up with a huge traceback that ultimately ends with:
So either what I am doing isn't possible based upon the design of
precipitable_water(), or I am not usingxr.map_blocks()correctly.Does anyone have any experience or thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions