Calculating temperature advection from ERA5 data #2372
-
I have an assignment on reproducing this case study (https://unidata.github.io/python-training/workshop/MetPy_Case_Study/metpy-case-study/) with ERA5 data. So first I was trying to just calculate 850hPa temperature advection. Here's my code:
Output is given as an error: got an unexpected keyword argument 'dim_order' Can you please point out what is wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
MetPy 1.0 changed to more natively work with xarray data and eliminate the data = xr.open_dataset('/home/nazimur/Downloads/Data/Storm of the Century/nonamestorm.nc').sel(time=data.time[0])
t850 = mpcalc.smooth_gaussian(data.t.sel(level=data.level[2]), n=6)
u850 = mpcalc.smooth_gaussian(data.u.sel(level=data.level[2]), n=6)
v850 = mpcalc.smooth_gaussian(data.v.sel(level=data.level[2]), n=6)
temp_adv_850 = mpcalc.advection(t850, u=u850, v=v850).metpy.convert_units('degC/s') MetPy has The example you reference is unfortunately out of date. We have some updated copies, but for various reasons have not updated the published content, though doing so is very high on our todo list. |
Beta Was this translation helpful? Give feedback.
MetPy 1.0 changed to more natively work with xarray data and eliminate the
dim_order
argument. The upshot of all of that is you should be able to do:MetPy has
smooth_gaussian
which wrapsgaussian_filter
, but using ann
of 6 should be close to what you had before. Going that way lets MetPy ha…