- 积分
- 8040
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-9-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
主要是做显著性检验之后打点的程序。以下是主要程序部分
---------------------------------------------分割线---------------------------------------------------------
procedure add_markers(wks,plot,x,y)
local pmres, str
begin
pmres = True
pmres@gsMarkerIndex=1 ;cross
pmres@gsMarkerThicknessF = 5.
pmres@gsMarkerColor = "black"
str = unique_string("polymarker") ; "unique_string" will return a unique
; string every time it is called from
; within a single NCL session.
;
; You can then use this unique string as an attribute variable name
; that gets attached to the plot variable. This ensures that this
; value will live for the duration of the script.
;
plot@$str$ = gsn_add_polymarker(wks, plot, x, y, pmres)
end
这部分主要是定义一个打点的procedure
-----------------------------------------------------以下是主程序部分----------------------------------------------------------
begin
wks = gsn_open_wks("eps" ,"test") ; open a ps file
gsn_define_colormap(wks,"posneg_2") ; choose colormap
plot = new(1,graphic)
等等省略
plot(0) = gsn_csm_contour_map_ce(wks,x,res)
--------------------------------先画出不带显著性检验的原图(底图)------------------------------------------------
do i = 0,ny-1
do j = 0,nx-1
if (.not. ismissing(z_signif(i,j))) .and. (z_signif(i,j) .ge. 95)
add_markers(wks,plot(0),lon(j),lat(i))
end if
end do
end do
------------------------遍历每个格点,凡是通过显著性检验的格点调用打点procedure----------------------------------
res_panel= True
res_panel@gsnPanelFigureStrings= (/"(a)"/) ; add strings to panel
res_panel@gsnPanelFigureStringsFontHeightF = .03
res_panel@amJust = "TopLeft"
res_panel@gsnPanelLabelBar = True ; add common colorbar
res_panel@lbLabelFontHeightF = .018
res_panel@lbTitleString = "W m~S~-2~N~ 10yr~S~-1~N"
res_panel@lbTitlePosition = "Right"
res_panel@lbTitleDirection = "Across" ; title direction
res_panel@lbTitleFontHeightF= .018 ; make title smaller
res_panel@pmLabelBarWidthF = 1.0
gsn_panel(wks,plot,(/1,1/),res_panel)
-------------------------------------------------------加上色标,标题等-----------------------------------------------------
end
这段程序如果打点量较小还可以,如果量大的话则可能要几个小时才能画完。
求各位高手提出优化意见
谢谢!!!! |
|