爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4954|回复: 4

ncl 求助

[复制链接]
发表于 2014-6-30 14:47:42 | 显示全部楼层 |阅读模式
GrADS
系统平台: ubuntu
问题截图: -
问题概况: 出错
我看过提问的智慧: 看过
自己思考时长(天): 1

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

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

x
本帖最后由 lovechang1314 于 2014-7-1 21:37 编辑

http://blog.sina.com.cn/s/blog_44f7c0840100on44.html
根据这个教程自己随便找了一天的温度数据14062317.000
制作出来如图

三个问题:
1.贝加尔湖?还有另外一个湖的颜色被填充
2.没有出现博客中的图例
3.在ubuntu中运行时出现如下警告----


脚本如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
;****************************************
;read the data array
lines=asciiread("/usr/local/ncl/14062317.000",-1,"string")
station=stringtofloat(str_get_field(lines(5::),1," "))
lon=stringtofloat(str_get_field(lines(5::),2," "))
lat=stringtofloat(str_get_field(lines(5::),3," "))
height=stringtofloat(str_get_field(lines(5::),4," "))
R=stringtofloat(str_get_field(lines(5::),5," "))
;read end
;****************************
;
olon = new(66,"float");
olat = new(40,"float");
data1 =new((/40,66/),"float")
do i=0,65
olon(i)=72+i
end do
do l=0,39
olat(l)=17+l
end do
olon!0="lon"
olon@long_name="lon"
olon@units="degrees-east"
olon&lon=olon

olat!0="lat"
olat@long_name="lat"
olat@units="degrees_north"
olat&lat=olat
R@FillValue=999999.000000
rscan=(/10,5,3/)
data1=obj_anal_ic_deprecated(lon,lat,R,olon,olat,rscan,False)

;*************************creanm end
cmap =(/ \
(/ 255./255, 255./255, 255./255/), \  ; 0 - White background.
(/ 0./255  , 0./255  ,0./255 /), \  ; 1 - Black foreground.
(/ 255./255, 0./255  ,0./255 /), \  ; 2 - Red.
(/ 0./255  , 0./255  , 255./255/), \  ; 3 - Blue.
(/ 164./255, 244./255, 131./255/), \  ; 4 - Ocean Blue.
(/ 0./255  , 0./255  ,255./255 /), \  ; 5 - Bar 1
(/ 0./255  , 153./255, 255./255/), \  ; 6 - Bar 2
(/ 0./255, 153./255, 153./255/), \  ; 7 - Bar 3
(/ 0./255  , 255./255, 0./255 /), \  ; 8 - Bar4
(/ 255./255, 255./255  , 102./255/), \  ; 9 - Bar 5
(/ 255./255, 153./255  ,102./255 /), \  ; 10 - Bar 6
(/ 255./255, 0./255  ,255./255 /) \  ; 11 - Bar7
/)

wks_type="png"
wks=gsn_open_wks(wks_type,"/usr/local/ncl/")
gsn_define_colormap(wks,cmap)

res = Ture
res@gsnAddCyclic=False
res@mpDateSetName="Earth..4"
res@mpDataBaseVersion="MediumRes"
res@mpOutlineOn=True
res@mpOutlineSpecifiers=(/"China:states","Taiwan"/)

res@mpMinLatF=17
res@mpMaxLatF=55
res@mpMinLonF=72
res@mpMaxLonF=136

res@mpProjection="LambertConformal"
res@mpLambertMeridianF=110.0
res@mpLimitMode="LatLon"
res@mpLambertParallel1F=.001
res@mpLambertParallel2F=89.999
res@mpAreaMaskingOn=True
res@mpMaskAreaSpecifiers=(/"China:states","Taiwan"/)
res@mpOceanFillColor=0

res@cnFillOn=True
res@cnLinesOn=False
res@cnLineLabelsOn=False
res@cnFillDrawOrder="PreDraw"

res@cnLevelSelectionMode="ExplicitLevels"
res@cnLevels=(/-30.,-20.,-10.,0.,10.,20./)
res@cnFillColors=(/5,6,7,8,9,10,11/)

res@lbLabelBarOn=True
res@lbLabelStrings=(/"-30:S:o:N","-20:S:o:N","-10:S:o:N","0:S:o:N","10:S:o:N","20:S:o:N"/)
res@lbOrientation="vertical"

res@vpXF=0
res@vpYF=0.95
res@vpWidthF=1.0
res@vpHeightF=0.8
res@tiMainFont="helvetica"
res@tiMainOffsetYF=0.02
res@tiMainString="open T"

map=gsn_csm_contour_map(wks,data1,res)

end


ncl.png
warning.jpg

app1.ncl

2.74 KB, 下载次数: 2

密码修改失败请联系微信:mofangbao
发表于 2014-6-30 20:51:30 | 显示全部楼层
本帖最后由 longlivehj 于 2014-6-30 20:53 编辑


res@mpInlandWaterFillColor = 0  ;用白色填充内陆湖水

R@_FillValue = 999999.000000
ncl里面missing value的设置是用“_FillValue”属性,注意前面的下划线。
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

发表于 2014-6-30 20:34:29 | 显示全部楼层
直接将脚本帖出来吧,这样方便大家帮你,不然还要花费大家5个金币
密码修改失败请联系微信:mofangbao
发表于 2014-7-1 09:22:38 | 显示全部楼层
同求                                         
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-7-1 21:37:46 | 显示全部楼层
尽头的尽头 发表于 2014-6-30 20:34
直接将脚本帖出来吧,这样方便大家帮你,不然还要花费大家5个金币

不好意思 不知道这个下载还要5金币 对不起
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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