Replies: 6 comments 1 reply
|
Can you share some sample data somewhere so that someone else can reproduce this issue ? |
0 replies
|
please find the attached link for the sample data. data |
0 replies
|
This line looks wrong: planetary_vorticity_advection = mpcalc.advection(f[:,None,None,None], data.uReconstructZonal, data.uReconstructMeridional)
Try this, which only calculates the advection across latitudes: planetary_vorticity_advection = mpcalc.advection(f[..., :, None], v=data.uReconstructZonal) |
0 replies
|
I tried by the way as suggested: But again I got an error: |
1 reply
|
I am still getting this error: |
0 replies
|
Since latitude is the third axis in this dataset, I think you want this: planetary_vorticity_advection = mpcalc.advection(f[None, None, :, None], v=data.uReconstructMeridional)I can't guarantee that the result of this computation is what is intended, but at least it doesn't crash. |
0 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.
Hi, I am trying to calculate the advection of planetary vorticity, but encountering an error. Can anyone say how to reslove this or hoe advection of planetary vorticity can be done. Below I am posting my code, along with the error.
And the error:
Traceback (most recent call last): Input In [2] in <cell line: 1> planetary_vorticity_advection = mpcalc.advection(f[:,None,None,None], data.uReconstructZonal, data.uReconstructMeridional) File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/tools.py:1178 in wrapper return func(*bound_args.args, **bound_args.kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/xarray.py:1328 in wrapper result = func(*bound_args.args, **bound_args.kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/units.py:325 in wrapper return func(*args, **kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/kinematics.py:455 in advection gradient_vector = geospatial_gradient(scalar, dx=dx, dy=dy, x_dim=x_dim, y_dim=y_dim, File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/tools.py:1178 in wrapper return func(*bound_args.args, **bound_args.kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/xarray.py:1328 in wrapper result = func(*bound_args.args, **bound_args.kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/units.py:325 in wrapper return func(*args, **kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/tools.py:1671 in geospatial_gradient derivatives[component] = first_derivative(f, delta=delta, axis=dim) File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/tools.py:951 in wrapper return preprocess_and_wrap()(func)(f, **kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/xarray.py:1328 in wrapper result = func(*bound_args.args, **bound_args.kwargs) File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/tools.py:1238 in first_derivative n, axis, delta = _process_deriv_args(f, axis, x, delta) File ~/miniconda3/lib/python3.8/site-packages/metpy/calc/tools.py:1731 in _process_deriv_args raise ValueError('f must have at least 3 point along the desired axis.') ValueError: f must have at least 3 point along the desired axis.All reactions