You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the Pangeo gitter, I just stumbled upon the xcape project: https://github.com/xgcm/xcape. I haven't looked too much into it, but being able to interoperate well with it (after #1353 is in place) may be useful in part towards MetPy's goals of efficient gridded convective parameter calculations (e.g., #480, #1258).
Also, while we're at it, xgcm brings a lot of useful functionality to the table (and is more mature of a project than xcape), so it would also be useful to make sure that MetPy's accessors and calculations can also play nicely with it. Perhaps a future goal could even be leveraging xgcm's derivatives, integration, and interpolation when supplied an xgcm Grid?
Here's a motivating example for interoperability with xgcm from #1389:
I have not used metpy.calc before. Since the results of the derivative calculation is defined at the same grid point as the input, I just expected the result by metpy would be different from that by xgcm.
But I do would like a try. However, I am a little confused by the difference and usage between xarray and metpy.xarray. Given u and v as two xarray.DataArrays on a stagged grid over the globe:
following @kgoebber but not sure if dx and dy are calculated properly, as the coordinates for u and v are slightly different. Besides, how to convert div back to xarray.DataArray. I am currently only farmiliar with xarray...
Activity
jthielen commentedon Feb 9, 2022
Here's a motivating example for interoperability with xgcm from #1389:
I have not used
metpy.calcbefore. Since the results of the derivative calculation is defined at the same grid point as the input, I just expected the result bymetpywould be different from that byxgcm.But I do would like a try. However, I am a little confused by the difference and usage between
xarrayandmetpy.xarray. Givenuandvas twoxarray.DataArrays on a stagged grid over the globe:how to calculate divergence using 'metpy' function? I tried:
following @kgoebber but not sure if
dxanddyare calculated properly, as the coordinates foruandvare slightly different. Besides, how to convertdivback toxarray.DataArray. I am currently only farmiliar withxarray...Originally posted by @miniufo in #1389 (comment)