- 积分
- 3367
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-4-12
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
以前画图时时不时就会遇到一下的warning:
check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all. (0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: (0)
总结下经验:
1.首先看自己读的数据是不是没有设置
lat@units="degrees_north"
lon@units="degrees_east" ,可以通过print一下文件来看,如果没有的话就加上命令再运行
2.有时属性已经存在却还是会warning,这种情况下可以将逐个变量读出来重新赋值一下
如:a1=addfile ("/vol6/home/xiaobin/zhangdq/SWH analysis/linear trend/1850-2005 SWH linear regression coefficient.nc","r")
zz1=a1->lin a1文件里的lat和lon是有经纬度信息的,但不知道为什么有时候运行会有问题,这个时候比较好的方法就是重新设一个变量再赋值一次:
a1=addfile ("/vol6/home/xiaobin/zhangdq/SWH analysis/linear trend/1850-2005 SWH linear regression coefficient.nc","r")
zz1=a1->lin
lat=a1->lat
lon=a1->lon
lat@units="degrees_north"
lon@units="degrees_east"
z1 = new((/91,181/),double)
z1!0="lat"
z1!1="lon"
z1&lat=lat
z1&lon=lon
do j=0,180,1
do i=0,90,1
z1(i,j)=zz1(i,j)
end do
end do
这样就可以啦~
这个方法有点笨,不过亲测有效,如果大家还有更好的方法欢迎多多交流~
|
|