如何在python中使用xarray乘以气候数据集?

问题描述

输入:

tws = ds1.lwe_thickness
print(tws.size)
print(tws.shape)
# tws

# vectorization
stacked1 = tws.stack(space =("latitude","longitude"))    # 
stacked
print(stacked1.shape)

# standardization
Y = (stacked1-stacked1.mean())/(stacked1.std())
print(Y)
print(Y.shape) 

print(Xt.shape)  # precipitation dataset
print(Y.shape)   # total water storage dataset

 # co-variance between precipitation and total water storage
Cxy = (Xt*Y)/(72)
print(Cxy.shape)
print(Cxy)
print(Cxy.dims)

输出

(64800,72) (72,64800) (64800,0) 数组([],shape=(64800,0),dtype=float64) 坐标:* time(time) datetime64[ns] * space(space) MultiIndex

  • 纬度(空间) float64 -90.0 -90.0 -90.0 -90.0 ... 89.0 89.0 89.0 89.0
  • 经度(空间) float64 0.0 1.0 2.0 3.0 4.0 ... 356.0 357.0 358.0 359.0('空间','时间')

最初 Xt 矩阵的大小为 6480072,Y 为 7264800。将这两个矩阵相乘后,大小应为 6480064800,但我得到 648000。为什么会发生这种情况?帮我解决这个问题。基本上我在这里使用 xarray。

附加图片here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)