- 积分
- 932
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-3-26
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 Hanchen 于 2022-3-15 10:15 编辑
- <div class="blockcode">#Maskout layer
- lchina = shaperead('J - J - J')
- cn_mask = lchina.shapes()
- obsdir = r'D:'
- obsfn = os.path.join(obsdir, 'SURF_CHN_MUL_HOR_N-2016120100.TXT')
- obsf = DataFrame.read_table(obsfn)
- lons = obsf['Lon'][:]
- lats = obsf['Lat'][:]
- odata = obsf['VIS'][:]
- lons = DimArray(lons.values)
- lats = DimArray(lats.values)
- odata = DimArray(odata.values)
- #之前使用micaps数据运行正常,查看数据类型为DimArray
- #所以这里将数据转换为DimArray,但是还是会报错
- #Maskout observation data by China border
- obs, lon, lat = rmaskout(odata, lons, lats, cn_mask)
复制代码 报错如下:
>>> run script...
Traceback (most recent call last):
File "C:\Users\18351\Desktop\MeteoInfo\code\test.py", line 18, in <module>
obs, lon, lat = rmaskout(odata, lons, lats, cn_mask)
File "C:\Users\18351\Desktop\MeteoInfo\MeteoInfo_3.3.3\MeteoInfo\pylib\mipylib\geolib\migeo.py", line 366, in rmaskout
r = GeometryUtil.maskout_Remove(data.asarray(), x.asarray(), y.asarray(), mask)
at org.meteoinfo.ndarray.ArrayString.getDouble(ArrayString.java:342)
at org.meteoinfo.ndarray.IteratorFast.getDoubleNext(IteratorFast.java:80)
at org.meteoinfo.geometry.geoprocess.GeometryUtil.maskout_Remove(GeometryUtil.java:555)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
org.meteoinfo.ndarray.ForbiddenConversionException: org.meteoinfo.ndarray.ForbiddenConversionException
想请问各位大神这是什么原因呀?(使用的数据已经附上)
|
|