- 积分
- 5997
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-3-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
- begin
- setvalues NhlGetWorkspaceObjectId()
- "wsMaximumSize": 600000000
- end setvalues
- f1 = addfile("ETOPO2v2g_f4.nc", "r")
- var1 = f1->z(:,:)
- lon = f1->x(:)
- lon@units = "degrees_east"
- lat = f1->y(:)
- lat@units = "degrees_north"
- var1!0 = "lat" ;第一维的名称
- var1&lat = lat ;第一维的值,直接从文件中的变量u中提取
- var1!1 = "lon" ;第二维的名称
- var1&lon = lon ;第二维的值
- wks = gsn_open_wks("png","plot3")
- gsn_define_colormap(wks,"WhiteBlueGreenYellowRed");WhiteBlueGreenYellowRed
- res = True
- res@gsnMaximize = True ;-- maximize graphics output
- res@gsnLeftString=" "
- res@gsnRightString=" "
- res@lbLabelStride = 1 ;-- every other label
- res@lbBoxMinorExtentF = 0.15
- res@gsnAddCyclic=False ;-- decrease the height of the labelbar
- res@pmLabelBarOrthogonalPosF = -0.07 ;-- move the labelbar upward
- res@gsnPolar="SH"
- res@cnFillOn = True ;-- turn on contour fill
- res@cnLinesOn = False ;-- turn off contour lines
- res@cnLineLabelsOn = False ;-- turn off line labels
- res@cnLevelSelectionMode = "ManualLevels" ;-- set contour levels manually
- res@cnMinLevelValF = 0 ;-- minimum contour level
- res@cnMaxLevelValF =4500 ;-- maximum contour level
- res@cnLevelSpacingF = 200 ;-- contour level spacing
- res@mpCenterLonF = 0 ;-- center at lon=10
- res@mpMaxLatF = -60
- res@mpDataBaseVersion = "MediumRes" ;-- map resolution "MediumRes"
- ;res@mpGridAndLimbOn = True ;-- plot grid lines
- res@mpGridLineColor = "grey30" ;-- set grid line color
- res@mpPerimOn = False ;-- don't draw the box around the plot
- ;res@mpLandFillColor = "transparent"
- ;res@mpOceanFillColor = "white"
- ;res@mpFillDrawOrder = "PostDraw"
- res@tiMainString = " " ;-- title string
- res@tiMainFontHeightF = 0.02 ;-- title font size
-
- ;-- draw the contour map
- plot = gsn_csm_contour_map_polar(wks, var1, res)
- lats = (/-69.37/)
- lats1 = (/-68.87/)
- lons = (/76.37/)
- mkres = True
- mkres@gsMarkerColor = "Blue"
- mkres@gsMarkerSizeF = 20 ; Increase marker sizes.
- mkres@gsMarkerIndex = 1
- dum = gsn_add_polymarker(wks,plot,lons,lats,mkres)
- txres = True
- txres@txFontHeightF = 0.009
- txres@txJust = "CenterLeft"
- text_id = gsn_add_text(wks,plot,"Zhongshan",lons,lats1,txres)
- draw(plot)
- frame(wks)
- end
复制代码
ncl画了一下高程图,过程可能需要三分钟吧,python需要十几秒,gmt也需要几分钟,学什么我就不用说了吧.
|
-
|