爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7053|回复: 2

[作图] NCL绘制SST差值场图出现空白

[复制链接]

新浪微博达人勋

发表于 2018-7-11 11:20:42 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 板板板板转 于 2018-7-11 15:12 编辑

用HadIsst资料绘制2001~2017与1979~2000年的差值场,图中出现空白(图3)。
为了排除错误 我把其中一个时间段更换为2001~2016年,留白变成另一个区域(图2);也尝试过把差值场输出成nc文件,用panoply查看,显示也没问题(图1)。所以基本可以排除是缺测问题
想问问留白是什么原因导致的?该如何解决?


sst.png
sstpart2.png
sstpart1.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-7-11 15:06:03 | 显示全部楼层
本帖最后由 板板板板转 于 2018-7-11 15:10 编辑

贴上部分程序如下
pre1 = new((/16,80,360/), float)
do i = 2001,2016
pre1(i-2001,:,:) = (pre(5+(i-2001)*12,:,:)+pre(6+(i-2001)*12,:,:)+pre(7+(i-2001)*12,:,:)+pre(8+(i-2001)*12,:,:))/4.0
end do
copy_VarMeta(pre(0,:,:),pre1(0,:,:))
pre1!0 = "year"
pre1&year = ispan(2001, 2016, 1)
comp1 = dim_avg_n_Wrap(pre1(:,:,:), 0)


pre2 = new((/22,80,360/), float)
do i = 1979,2000
pre2(i-1979,:,:) = (pre3(5+(i-1979)*12,:,:)+pre3(6+(i-1979)*12,:,:)+pre3(7+(i-1979)*12,:,:)+pre3(8+(i-1979)*12,:,:))/4.0
end do
copy_VarMeta(pre3(0,:,:),pre2(0,:,:))
pre2!0 = "year"
pre2&year = ispan(1979, 2000, 1)
comp2 = dim_avg_n_Wrap(pre2(:,:,:), 0)
comp = comp1 - comp2
copy_VarMeta(comp1, comp)
comp!0 = "lat"
comp&lat = pre3&latitude
comp!1 = "lon"
comp&lon = pre3&longitude
;输出为nc文件
;fout = addfile("comp.nc", "c")
;comp@units = "mm"
;fout->COMP = comp
;exit()
varX = dim_variance_n_Wrap(pre1(:,:,:), 0)
varY = dim_variance_n_Wrap(pre2(:,:,:), 0)
iflag = False
tval_opt = False
prob = ttest(comp1, varX, 15, comp2, varY, 21, iflag, tval_opt)

copy_VarMeta(pre3(0,:,:), prob(:,:))
wks = gsn_open_wks("png", "sstpart2")
gsn_define_colormap(wks,"BlueRed")
res = True
res@gsnAddCyclic = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnLeftString = ""
res@gsnRightString = ""
resc = res
;地图
res@mpFillOn = False
res@mpCenterLonF = 180
res@mpDataBaseVersion     = "MediumRes"  ; Medium resolution database
res@mpOutlineOn           = True         ; Turn on map outlines
res@mpProjection          = "CylindricalEquidistant"
res@mpGeophysicalLineThicknessF = 0.75
res@pmTickMarkDisplayMode = "Always"
res@mpGridAndLimbOn = True
res@mpMaxLatF = 60
res@mpMaxLonF = 240
res@mpMinLatF = -20
res@mpMinLonF = 0
res@mpGridLatSpacingF = 15
res@mpGridLonSpacingF = 15
res@mpGridLineDashPattern = 2
res@mpGridLineThicknessF = 0.
res@gsnCenterString = "2001-2017 and 1979-2000 sst difference"
;显著性水平检验
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = (/0,0.1/)
;res@cnFillColors = (/"white","gray","white"/)
res@cnInfoLabelOn = False
res@lbLabelBarOn = False
res@cnFillOn = True
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnFillDrawOrder="postDraw"
res@cnMonoFillPattern    = False            ; want multiple patterns                                                               
res@cnFillPatterns       = (/-1,17,-1/)     ; the patterns                                                                        
res@cnMonoFillScale      = False            ; want different densities                                                            
res@cnFillScales         = (/1,1,1/)    ; change densities                                                                        
res@cnMonoFillColor      =True                                                                                                     
res@cnFillDotSizeF       = 0.00007                                                                                                                  
base = gsn_csm_contour_map(wks, prob, res)
;等值线
resc@cnLevelSelectionMode = "ExplicitLevels"
resc@cnLevels = (/-0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 /)
;resc@cnMinLevelValF = -8
resc@cnLinesOn = False
resc@cnFillOn = True
resc@cnLineThicknessF = 2                   ;等值线粗细
resc@gsnContourZeroLineThicknessF = 3       ;不画0值线
resc@cnLineLabelsOn = False                 ;关闭等值线数值标签
;resc@cnLevelSpacingF = 10
;resc@cnLineDashPattern = 1
resc@cnInfoLabelOrthogonalPosF = 0.025       ;移动等值线信息标签的位置
resc@cnSmoothingOn = True
;resc@cnFillOpacityF = 0.7
resc@lbLabelBarOn = True
resc@lbOrientation       = "Horizontal"         ; vertical label bars
resc@lbLabelStride   = 1         ; plot every other colar bar label  
resc@pmLabelBarOrthogonalPosF =  0.2      ;调整色标垂直方向位置
plot = gsn_csm_contour(wks, comp, resc)
overlay(base, plot)
draw(base)
frame(wks)
end

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-12-17 09:15:07 | 显示全部楼层
请问楼主解决了吗
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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