爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6862|回复: 4

[作图] 如何在nc文件里插入经纬度

[复制链接]
发表于 2020-4-9 14:55:09 | 显示全部楼层 |阅读模式

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

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

x
要拿这个站点数据画一个散点图,但是站点数据没有具体的经纬度,如何在nc文件中加入经纬度信息,档头如下
档头.png
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2020-4-9 14:57:34 | 显示全部楼层
        check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north' check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:  'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east' Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-4-9 14:59:39 | 显示全部楼层
上面是我试运行过一次给的报错 也是说文件里没有经纬度信息 有没有大佬帮忙解答一下
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2020-4-9 15:08:32 | 显示全部楼层
大概这样如果不是全球数据的话记得加上res@gsnAddCyclic = False
;------设定经度坐标---------
lon = ispan(70, 140, 1)
lon!0 = "lon"
lon@long_name = "longtitude"
lon@units = "degrees_east"
;-------设定纬度坐标--------
lat = ispan(0, 60, 1)
lat!0 = "lat"
lat@long_name = "latitude"
lat@units = "degrees_north"
;-----设置变量元数据-------
data!0 = "lat"
data!1 = "lon"
data&lon = lon
data&lat = lat
data&lon@units = "degrees_east"
data&lat@units = "degrees_north"
data@long_name = "Correlation Coefficient"
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-4-9 15:20:07 | 显示全部楼层
一大碗年糕 发表于 2020-4-9 15:08
大概这样如果不是全球数据的话记得加上res@gsnAddCyclic = False
;------设定经度坐标---------
lon = is ...

好的好的 我去试一下 谢谢!!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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