请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 10810|回复: 11

[秀图] NCL画海拔高程!

[复制链接]

新浪微博达人勋

发表于 2020-9-6 16:24:21 | 显示全部楼层 |阅读模式

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

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

x
  1. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  2. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  3. begin
  4.   setvalues NhlGetWorkspaceObjectId()
  5.   "wsMaximumSize": 600000000
  6.   end setvalues
  7.   f1 =  addfile("ETOPO2v2g_f4.nc", "r")
  8.   var1  =  f1->z(:,:)
  9.   lon = f1->x(:)
  10.   lon@units = "degrees_east"
  11.   lat = f1->y(:)
  12.   lat@units = "degrees_north"
  13.   var1!0 = "lat" ;第一维的名称
  14.   var1&lat = lat ;第一维的值,直接从文件中的变量u中提取
  15.   var1!1 = "lon" ;第二维的名称
  16.   var1&lon = lon  ;第二维的值
  17.   wks = gsn_open_wks("png","plot3")
  18.   gsn_define_colormap(wks,"WhiteBlueGreenYellowRed");WhiteBlueGreenYellowRed

  19.   res                       =  True
  20.   res@gsnMaximize           =  True            ;-- maximize graphics output
  21.   res@gsnLeftString=" "
  22.   res@gsnRightString=" "         
  23.   res@lbLabelStride         =  1               ;-- every other label
  24.   res@lbBoxMinorExtentF     =  0.15   
  25.   res@gsnAddCyclic=False         ;-- decrease the height of the labelbar
  26.   res@pmLabelBarOrthogonalPosF = -0.07         ;-- move the labelbar upward
  27.   res@gsnPolar="SH"
  28.   res@cnFillOn              =  True            ;-- turn on contour fill
  29.   res@cnLinesOn             =  False           ;-- turn off contour lines
  30.   res@cnLineLabelsOn        =  False           ;-- turn off line labels
  31.   res@cnLevelSelectionMode  = "ManualLevels"   ;-- set contour levels manually
  32.   res@cnMinLevelValF        =  0      ;-- minimum contour level
  33.   res@cnMaxLevelValF        =4500         ;-- maximum contour level
  34.   res@cnLevelSpacingF       = 200              ;-- contour level spacing
  35.   res@mpCenterLonF          = 0              ;-- center at lon=10
  36.   res@mpMaxLatF          = -60   
  37.   res@mpDataBaseVersion     = "MediumRes"      ;-- map resolution "MediumRes"  
  38.   ;res@mpGridAndLimbOn       =  True            ;-- plot grid lines
  39.   res@mpGridLineColor       = "grey30"         ;-- set grid line color
  40.   res@mpPerimOn             =  False           ;-- don't draw the box around the plot
  41.   ;res@mpLandFillColor             = "transparent"
  42.   ;res@mpOceanFillColor            = "white"
  43.   ;res@mpFillDrawOrder             = "PostDraw"
  44.   res@tiMainString          = " "   ;-- title string
  45.   res@tiMainFontHeightF     =  0.02            ;-- title font size
  46.   
  47. ;-- draw the contour map
  48.   plot = gsn_csm_contour_map_polar(wks, var1, res)
  49.   lats  = (/-69.37/)
  50.   lats1  = (/-68.87/)
  51.   lons  = (/76.37/)
  52.   mkres               =  True
  53.   mkres@gsMarkerColor = "Blue"
  54.   mkres@gsMarkerSizeF = 20        ; Increase marker sizes.
  55.   mkres@gsMarkerIndex = 1
  56.   dum = gsn_add_polymarker(wks,plot,lons,lats,mkres)
  57.   txres               = True
  58.   txres@txFontHeightF = 0.009
  59.   txres@txJust        = "CenterLeft"
  60.   text_id = gsn_add_text(wks,plot,"Zhongshan",lons,lats1,txres)
  61.   draw(plot)
  62.   frame(wks)
  63. end
复制代码

ncl画了一下高程图,过程可能需要三分钟吧,python需要十几秒,gmt也需要几分钟,学什么我就不用说了吧.
plot3.000002.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-9-7 08:32:38 | 显示全部楼层
啊这,GMT这种命令行式的不应该很快么
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-9-7 10:42:52 | 显示全部楼层
灭火器 发表于 2020-9-7 08:32
啊这,GMT这种命令行式的不应该很快么

数据太大了,在gmt里面画的是全球的,但是我把海洋的弄成白色的了!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-9-10 21:34:48 | 显示全部楼层
学python  这不是太明显了{:eb513:}{:eb513:}
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-9-10 21:53:08 | 显示全部楼层
帅帅f 发表于 2020-9-10 21:34
学python  这不是太明显了

大神说的是呀,但是ncl的库还是不错的呀.
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-9-13 07:41:31 | 显示全部楼层
楼主可以分享一下地形数据嘛
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-9-23 09:58:33 | 显示全部楼层
deemo7 发表于 2020-9-13 07:41
楼主可以分享一下地形数据嘛

地形在家园上直接可以下载到,数据800兆,太大!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-9-23 15:26:15 | 显示全部楼层
对方的凤飞飞 发表于 2020-9-23 09:58
地形在家园上直接可以下载到,数据800兆,太大!

有链接吗我去找了网址下不了
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-9-23 16:06:32 | 显示全部楼层
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2020-9-23 17:48:18 | 显示全部楼层
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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