爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6156|回复: 4

ncl图片因为缺测值而导致部分地区锯齿状

[复制链接]

新浪微博达人勋

发表于 2017-6-14 20:51:59 | 显示全部楼层 |阅读模式
NCL
系统平台: ncl
问题截图:
问题概况: 缺测值和填充区域交界处是锯齿状的,导师说太难看了,叫我改掉,想法是把缺测引起的锯齿状区域变圆滑
我看过提问的智慧: 看过
自己思考时长(天): 3

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

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

x
初学ncl感觉这个问题很偏,论坛上也没有处理的帖子供我参考,求大神指点
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-6-15 07:37:21 | 显示全部楼层
导师给你外插的方法没有?要不没有数据没法弄啊
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-6-15 13:41:23 | 显示全部楼层
您的意思是用外部数据差值到这个图里面么?导师给我的是热浪数据叫我画一个eof出来,空白的地方是缺测的,估计也没有什么数据可以补全。。。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-6-15 14:02:13 | 显示全部楼层
begin
f=addfile("hwf.nc","r")
;f1=addfile("runeof_ts.nc","c")
ap=f->ap
b=dim_rmvmean_n_Wrap(ap,0)
b!0="time"
b!1="lat"
b!2="lon"
time=ispan(1950,2014,1)
lon=fspan(-180,180,96)
lat=fspan(-90,90,73)
b&time=time
b&lon=lon
b&lat=lat
b&time@lon_name="year"
b&time@units="year"
b&lon@long_name="lon"
b&lon@units="degrees_east"
b&lat@long_name="lat"
b&lat@units="degrees_north"
y=runave_n_Wrap(b, 3, 0, 0)
copy_VarCoords(b,y)
printVarSummary(y)
optEOF = False
optETS = False      
neval  =2
eof= eofunc_Wrap(y({lat|20:50},{lon|70:140},{time|:}),neval,optEOF)
eof_ts=eofunc_ts_Wrap (y({lat|20:50},{lon|70:140},{time|:}),eof, optETS)
eof_ts=-eof_ts/10
eof=-10*eof
;f1->ts=eof_ts
print(max(eof(0,:,:)))
print(max(eof(1,:,:)))
print(min(eof(0,:,:)))
print(min(eof(1,:,:)))
;print(eof_ts(0,:))
wks = gsn_open_wks("png","1950_2014hwfeof(2)")
res2=True
res2@gsnDraw = False
res2@gsnFrame = False
res2@gsnAddCyclic        = False
res2@mpCenterLonF         = 100  
res2@mpLimitMode       = "LatLon"
res2@mpMinLatF         = 20         
res2@mpMaxLatF         = 50
res2@mpMinLonF         = 70
res2@mpMaxLonF         = 138
res2@cnFillOn       = True
res2@cnFillPattern ="Explicit"
res2@cnLevelSelectionMode="ManualLevels"
res2@cnMinLevelValF=-1.0
res2@cnMaxLevelValF=1.4
res2@cnLevelSpacingF=0.2
res2@cnFillColors=(/2,18,34,50,66,82,145,161,177,193,209,225,241,255/)
res2@mpDataBaseVersion="Ncarg4_1"       ;ÖDμè·Ö±æÂê
res2@mpDataSetName="Earth..4"           ;μú4°æμØí¼£¬óDÖD1ú±ß½çêy¾Y
res2@mpOutlineOn            = True
res2@mpOutlineSpecifiers=(/"China:states","Taiwan"/)   ;ÖD1ú±ß½çóDÎêìa£¬è±2ØÄÏ¡¢ì¨íå
res2@mpOutlineBoundarySets ="NoBoundaries"

res2@cnSmoothingOn      =True
res2@cnRasterSmoothingOn= True
;gsn_define_colormap(wks,"leng")
;res2@tiMainString    = "hwfeof(0)1950-2014dtrend"
res2@tmXBMode = "Explicit"
res2@tmXBValues = (/"70","80","90","100","110","120","130","140"/)
res2@tmXBLabels  = (/"70E","80E", "90E", "100E","110E","120E","130E","140E"/)
;res2@cnLevelSelectionMode="ManualLevels"
;res2@cnMinLevelValF=-1.0
;res2@cnMaxLevelValF=1.4
;res2@cnLevelSpacingF=0.2
res2@cnMissingValFillColor="white"


rts2           = True
rts2@gsnDraw = False
rts2@gsnFrame = False
rts2@vpHeightF = 0.40        ; Changes the aspect ratio
rts2@vpWidthF  = 0.80
rts2@vpXF      = 0.80        ; change start locations
rts2@vpYF      = 0.75        ; the plot
rts2@tiYAxisString = ""                  
rts2@tiXAxisString = "year"
rts2P                      = True            ; modify the panel plot
rts2P@gsnMaximize          = True            ; large format
rts2@trYMaxF=15
rts2@trYMinF=-15
  
rts2@gsnYRefLine           = 0.              ; reference line   
rts2@gsnXYBarChart         = True            ; create bar chart
rts2@gsnAboveYRefLineColor = "red"           ; above ref line fill red
rts2@gsnBelowYRefLineColor = "blue"          ; below ref line fill blue

rts2@tmXBMode = "Explicit"
rts2@tmXBValues=(/"1950","1960","1970","1980","1990","2000","2010"/)
  rts2@tmXBLabels=(/"1950","1960","1970","1980","1990","2000","2010"/)
;rts2@tiMainString    = "AP_Ts_02:1950-2014"
rts2@gsnLeftString  = "EOF "+(1+1)
;rts2@gsnRightString = sprintf("%5.1f", eof@pcvar(1)) +"%"


plots = new(2,graphic)

  res2@tiMainString = "1950_2014hwfeof2"
  res2@gsnLeftString  = "EOF2 "
  ;cmap2 = read_colormap_file("14")
;res2@cnFillColors = cmap2
  ;gsn_define_colormap(wks,"14")
res2@gsnRightString = sprintf("%5.1f", eof@pcvar(1)) +"%"
  plots(0) = gsn_csm_contour_map(wks,eof(1,:,:),res2)



plots(1)= gsn_csm_xy (wks,time,eof_ts(1,:),rts2)   






  pres = True
  ;pres@tiMainString = "1950_2014hwf_eof"
  pres@gsnMaximize = True
  pres@gsnPanelDebug=True
  pres@gsnPanelRowSpec = True
  pres@gsnPanelLabelBar = False
  pres@lbBoxLinesOn = False
  gsn_panel(wks,plots,(/1,2/),pres)
end  
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-6-15 14:02:33 | 显示全部楼层
上面是我的程序
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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