爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2816|回复: 3

两个数值场的运算出现问题,请问是为什么?

[复制链接]

新浪微博达人勋

发表于 2018-1-24 16:07:46 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
把两个场相加时出错,出错的提示是:TypeError: add(): 2nd arg can't be coerced to org.meteoinfo.math.Complex, java.lang.Number, org.python.core.PyComplex, ucar.ma2.Array

从数值上看两个场都是数值型,不应该有问题啊,请王老师帮忙看看

一个场是
array([[61.189998626708984, 68.94000053405762, 76.69000244140625, 76.19000244140625, 75.69000244140625, 81.19000244140625, 86.69000244140625, 91.19000244140625, 95.69000244140625, 95.69000244140625, 95.69000244140625, 95.44000244140625, 95.19000244140625, 95.94000244140625, 96.69000244140625, 97.19000244140625, 97.69000244140625, 96.69000244140625, 95.69000244140625, 95.19000244140625, 94.69000244140625, 94.44000244140625, 94.19000244140625, 93.94000244140625, 93.69000244140625, 93.19000244140625, 92.69000244140625, 91.19000244140625, 89.69000244140625, 86.69000244140625, 83.69000244140625, 81.94000244140625, 80.19000244140625, 79.94000244140625, 79.69000244140625, 82.69000244140625, 85.69000244140625, 82.94000244140625, 80.19000244140625, 79.44000244140625, 78.69000244140625, 79.69000244140625, 80.69000244140625, 81.69000244140625, 82.69000244140625, 83.69000244140625, 84.69000244140625, 85.19000244140625, 85.69000244140625, 86.69000244140625, 87.69000244140625, 88.94000244140625, 90.19000244140625, 89.94000244140625, 89.69000244140625, 89.69000244140625, 89.69000244140625, 89.94000244140625, 90.19000244140625, 89.94000244140625, 89.69000244140625, 89.69000244140625, 89.69000244140625, 89.44000244140625, 89.19000244140625, 88.44000244140625, 87.69000244140625, 87.19000244140625, 86.69000244140625]
      [65.19000053405762, 73.06500148773193, 80.94000244140625, 81.44000244140625, 81.94000244140625, 82.94000244140625, 83.94000244140625, 89.06500244140625, 94.19000244140625, 94.19000244140625, 94.19000244140625, 95.31500244140625, 96.44000244140625, 96.81500244140625, 97.19000244140625, 97.19000244140625, 97.19000244140625, 96.94000244140625, 96.69000244140625, 95.94000244140625, 95.19000244140625, 94.94000244140625, 94.69000244140625, 94.31500244140625, 93.94000244140625, 92.56500244140625, 91.19000244140625, 89.06500244140625, 86.94000244140625, 84.94000244140625, 82.94000244140625, 81.44000244140625, 79.94000244140625, 81.56500244140625, 83.19000244140625, 85.44000244140625, 87.69000244140625, 85.44000244140625, 83.19000244140625, 83.19000244140625, 83.19000244140625, 84.19000244140625, 85.19000244140625, 86.06500244140625, 86.94000244140625, 87.44000244140625, 87.94000244140625, 88.56500244140625, 89.19000244140625, 89.81500244140625, 90.44000244140625, 90.69000244140625, 90.94000244140625, 90.44000244140625, 89.94000244140625, 89.69000244140625, 89.44000244140625, 89.56500244140625, 89.69000244140625, 89.44000244140625, 89.19000244140625, 89.31500244140625, 89.44000244140625, 88.19000244140625, 86.94000244140625, 87.19000244140625, 87.44000244140625, 86.69000244140625, 85.94000244140625]
      [69.19000244140625, 77.19000244140625, 85.19000244140625, 86.69000244140625, 88.19000244140625, 84.69000244140625, 81.19000244140625, 86.94000244140625, 92.69000244140625, 92.69000244140625, 92.69000244140625, 95.19000244140625, 97.69000244140625, 97.69000244140625, 97.69000244140625, 97.19000244140625, 96.69000244140625, 97.19000244140625, 97.69000244140625, 96.69000244140625, 95.69000244140625, 95.44000244140625, 95.19000244140625, 94.69000244140625, 94.19000244140625, 91.94000244140625, 89.69000244140625, 86.94000244140625, 84.19000244140625, 83.19000244140625, 82.19000244140625, 80.94000244140625, 79.69000244140625, 83.19000244140625, 86.69000244140625, 88.19000244140625, 89.69000244140625, 87.94000244140625, 86.19000244140625, 86.94000244140625, 87.69000244140625, 88.69000244140625, 89.69000244140625, 90.44000244140625, 91.19000244140625, 91.19000244140625, 91.19000244140625, 91.94000244140625, 92.69000244140625, 92.94000244140625, 93.19000244140625, 92.44000244140625, 91.69000244140625, 90.94000244140625, 90.19000244140625, 89.69000244140625, 89.19000244140625, 89.19000244140625, 89.19000244140625, 88.94000244140625, 88.69000244140625, 88.94000244140625, 89.19000244140625, ...]])


另一个是
array([[21.316551, 19.394629, 19.778883, 20.985106, 22.380295, 23.301928, 21.856398, 20.297321, 20.853794, 22.380295, 23.811808, 25.369328, 25.509558, 25.369328, 25.075497, 24.845633, 24.693413, 24.557116, 24.181952, 24.181952, 24.226704, 24.27153, 24.466614, 24.693413, 24.98333, 25.229773, 25.276217, 25.415997, 25.509558, 25.556452, 25.713308, 25.666162, 25.619091, 25.855192, 25.950167, 25.556452, 24.98333, 25.075497, 25.902641, 26.413506, 26.252922, 26.156984, 26.10913, 26.10913, 26.301008, 27.229353, 26.061352, 25.322737, 25.369328, 25.902641, 26.204916, 26.10913, 26.10913, 26.156984, 25.950167, 25.619091, 25.229773, 25.509558, 25.855192, 26.061352, 26.252922, 26.413506, 26.413506, 26.558762, 26.704716, 26.753525, 26.753525, 26.704716, 26.81872]
      [18.752806, 20.528662, 20.945635, 21.436989, 21.477264, 21.51761, 21.396776, 21.064238, 20.775354, 22.199842, 24.13727, 25.029377, 25.229773, 25.229773, 24.937359, 24.891459, 24.98333, 24.98333, 24.602474, 24.033295, 24.226704, 24.181952, 24.092659, 24.13727, 24.226704, 24.316427, 24.361399, 24.693413, 24.98333, 24.937359, 24.891459, 24.98333, 25.121695, 25.322737, 25.556452, 25.509558, 25.167965, 24.98333, 24.937359, 24.784649, 24.784649, 24.845633, 24.64791, 24.51183, 24.466614, 24.226704, 24.033295, 24.092659, 24.13727, 24.226704, 24.181952, 24.316427, 24.27153, 24.466614, 24.406445, 24.466614, 24.784649, 25.121695, 25.415997, 25.666162, 25.807823, 25.950167, 26.10913, 26.34917, 26.558762, 26.558762, 26.461847, 26.413506, 26.413506]
      [18.752806, 20.73623, 19.162363, 19.004852, 20.619247, 21.396776, 22.77332, 23.57752, 23.301928, 23.723711, 24.602474, 24.557116, 24.316427, 24.406445, 24.738995, 25.322737, 25.415997, 25.276217, 24.98333, 24.64791, 24.51183, 24.092659, 23.900187, 23.811808, 23.723711, 23.767723, 23.811808, 23.988852, 24.092659, 24.033295, 24.226704, 24.738995, 25.121695, 25.229773, 25.276217, 25.167965, 24.937359, 24.891459, 24.784649, 24.51183, 24.226704, 23.988852, 23.900187, 23.811808, 23.621294, 23.57752, 23.66514, 23.723711, 23.66514, 23.811808, 23.403133, 23.35971, 23.533817, 23.66514, 23.94448, 24.27153, 24.693413, 25.075497, 25.322737, 25.619091, 25.713308, 25.760527, 25.950167, ...]])
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-1-24 19:42:55 | 显示全部楼层
这个看不出来,你把代码贴出来吧,必要的话把数据文件也提供出来。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-1-25 08:28:57 | 显示全部楼层
本帖最后由 zyfws 于 2018-1-25 10:50 编辑
MeteoInfo 发表于 2018-1-24 19:42
这个看不出来,你把代码贴出来吧,必要的话把数据文件也提供出来。


数据文件和代码见附件,请帮忙看看

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-1-25 10:24:18 | 显示全部楼层
zyfws 发表于 2018-1-25 08:28
数据文件和代码见附件,请帮忙看看

是软件的bug,已经更新,你可以加入MeteoInfo QQ群下载最新版本。或者临时性的你将代码:
diff_e=(1-RH)*sat_T
改为:
diff_e=(1-RH)*sat_T.array

MeteoInfo网站的更新需要些时间。
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表