- 积分
- 1319
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-9
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
因为ERA5自己有散度和涡度可以下载,我自己初学也不太会用python,因此一些物理量计算需要验证下对错,结果发现ERA5再分析资料中的涡度散度和使用Metpy计算出来的相差很多。
比如这个是Metpy中关于涡度的定义,
- ##定义
- Definition : vorticity(*args: Any, **kwargs: Any)
- Calculate the vertical vorticity of the horizontal wind.
- Parameters
- u(..., M, N) xarray.DataArray or pint.Quantity
- x component of the wind
- v(..., M, N) xarray.DataArray or pint.Quantity
- y component of the wind
- dxpint.Quantity, optional
- The grid spacing(s) in the x-direction. If an array, there should be one item less than the size of u along the applicable axis. Optional if xarray.DataArray with latitude/longitude coordinates used as input. Keyword-only argument.
- dypint.Quantity, optional
- The grid spacing(s) in the y-direction. If an array, there should be one item less than the size of u along the applicable axis. Optional if xarray.DataArray with latitude/longitude coordinates used as input. Keyword-only argument.
- x_dimint, optional
- Axis number of x dimension. Defaults to -1 (implying [..., Y, X] order). Automatically parsed from input if using xarray.DataArray. Keyword-only argument.
- y_dimint, optional
- Axis number of y dimension. Defaults to -2 (implying [..., Y, X] order). Automatically parsed from input if using xarray.DataArray. Keyword-only argument.
下面是自己的部分:
- dx, dy = mpcalc.lat_lon_grid_deltas(lon, lat)
- # 计算出来的数据和原来的数据差很多,????
- wind_vor = mpcalc.vorticity(u,v,dx=dx,dy=dy,x_dim=-1,y_dim=-2)
- wind_div = mpcalc.divergence(u,v,dx=dx,dy=dy,x_dim=-1,y_dim=-2)
这个是Metpy算出来的相对涡度:
wind_vor
Out[19]:
array([[ 1.22826072e-05, -1.74879282e-06, -1.80048286e-05, ...,
-1.22620830e-05, -1.35755185e-05, -1.83350494e-05],
[ 2.63587489e-05, 1.48204562e-05, 6.34924628e-07, ...,
9.65214860e-06, 1.33634245e-06, -8.16623809e-06],
[ 2.67111189e-05, 1.33099878e-05, -2.92370330e-06, ...,
3.26149484e-05, 2.52949367e-05, 1.80315283e-05],
...,
[ 8.29784375e-05, 6.32179686e-05, 3.79085029e-05, ...,
9.22821203e-06, 4.61023816e-06, 3.97450527e-07],
[ 4.54908416e-05, 4.44313939e-05, 4.02905938e-05, ...,
8.23294447e-06, 5.82363777e-06, 4.14160954e-06],
[ 4.09520199e-05, 4.88505044e-05, 3.95765279e-05, ...,
7.05006292e-06, 5.65144343e-06, 5.70478559e-06]]) <Unit('1 / second')>
这个是ERA5资料中的相对涡度:
masked_array(
data=[[ 1.89363456e-06, 3.88504163e-06, -9.56801947e-06, ...,
-2.28832029e-06, -2.48746100e-06, -9.65652645e-06],
[ 2.47948159e-05, 1.28021200e-05, -8.37317523e-06, ...,
4.43821026e-06, -2.99637614e-06, -1.11611451e-05],
[ 3.08575441e-05, 1.62096387e-05, 1.67748434e-07, ...,
4.09030864e-05, 3.31144721e-05, 2.21617332e-05],
...,
[ 4.69436879e-05, 7.75892300e-05, 1.97056645e-05, ...,
1.01026570e-05, 4.43821026e-06, -3.19039962e-07],
[ 2.41752670e-05, 5.44667813e-05, 3.40216686e-05, ...,
8.46527790e-06, 6.27473012e-06, 3.46463347e-06],
[ 2.75385323e-05, 6.01091013e-05, 2.68083497e-05, ...,
6.89427899e-06, 6.40749059e-06, 4.32757654e-06]],
mask=False,
fill_value=1e+20) <Unit('1 / second')> |
|