- 积分
- 61
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-27
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
grib文件原件
上图是grib2文件, 变量的结构,其中坐标变量有x,y(没有lon,lat)
但是grib2中指定了,这个是兰伯特投影,还有一些参数,这个图怎么画?
grib2转成nc文件
上图是grib2文件转成的nc文件,变量中有gridlon_0,gridlat_0(都是二维数组1801x1901),温度值也是一个二维数组(1801x1901)
画出来的图
上图是我尝试着画出来的,感觉不大对,
部分ncl代码:load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
;----------------------------------------------------------------------
; This function creates a cylindrical equidistant map of Australia
; so you you can add polylines, polygons, or point data to it later.
;----------------------------------------------------------------------
;----------------------------------------------------------------------
; Main code
;----------------------------------------------------------------------
begin
path = "/usr/local/ncl/NCL/nc_read/"
filename = "out.nc"
path=path+filename
;------------------------------------------------------------------------------------------------------------------
;read data from grb
a = addfile(path,"r")
datas=a->TMP_P0_L103_GLC0
;-----------------------------------------------------------------------------------------------------------------
;--- Open workstation.
xwks="png"
wks = gsn_open_wks(xwks,"shapefiles")
gsn_define_colormap(wks,"custom_grib2_20160817")
;============================================
res = True
res@tfDoNDCOverlay=True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
res@mpOutlineOn = True ;show outline (boundary)
res@mpFillOn = True
res@mpDataBaseVersion = "MediumRes"
res@cnFillOn = True
res@cnLineLabelsOn = True ; turn off contour lines
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels=(/270.6,277.3,284.1,290.9,297.6,304.4,311.1/)
;---Turn on fancier tickmark labels.
res@pmTickMarkDisplayMode = "Always"
;------------------------------------------------------------------------------------------------
res@mpProjection="LambertConformal"
res@mpLambertParallel1F = 30.
res@mpLambertParallel2F = 60.
res@mpLambertMeridianF = 102.
;---Zoom in on area of interest
res@mpLimitMode = "Corners"
res@tiMainString = " " ;map name
;---------------------------------------------------------------------------------------------------------
;---Create map.
map=gsn_csm_contour_map(wks,datas,res)
;=================================================
cnres = True
cnres@china = True ;draw china map or not叠加中国边界(shp)
chinamap = add_china_map(wks,map,cnres)
;---Drawing the map will also draw the attached polygons.
draw(map)
frame(wks)
end
|
|