- 积分
- 1891
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-11-5
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
begin
cdf = addfile("D:/ncl_lianxi/201706.grib2","r")
levels = cdf->lv_ISBL0
taus = cdf->initial_time0_hours
rh = cdf->RH_P0_L100_GLL0(:,:,{40},{120})
ugrid = cdf->UGRD_P0_L100_GLL0(:,:,{40},{120})
vgrid = cdf->VGRD_P0_L100_GLL0(:,:,{40},{120})
tempht = cdf->TMP_P0_L100_GLL0(:,:,{40},{120})
;***********************************************
; smooth temperature and humidity.
;***********************************************
smothtemp = smth9(tempht, 0.50, -0.25, False)
smothrh = smth9(rh, 0.50, -0.25, False)
;***********************************************
; open a workstation and define colormap using rgb triplets
;***********************************************
wks = gsn_open_wks("png","D:/ncl_lianxi/meteo") ; send graphics to PNG file
colors = (/ \
(/255,255,255/), \
(/255,255,255/), (/255,255,255/), (/240,255,240/), \
(/220,255,220/), (/190,255,190/), (/120,255,120/), \
(/ 80,255, 80/), (/ 50,200, 50/), (/ 20,150, 20/) /) / 255.
;***********************************************
; Create a different resource list for each of the 5 plots
;***********************************************
rh_res = True
temp_res = True
uv_res = True
rain_res = True
tempsfc_res = True
;***********************************************
; Here are the resources that rh_res, temp_res, and uv_res share.
;***********************************************
rh_res@trYReverse = True ; Reverse the Y values.
rh_res@gsnDraw = False ; Don't draw individual plot.
rh_res@gsnFrame = False ; Don't advance frame.
rh_res@vpXF = 0.15 ; x location
rh_res@vpYF = 0.90 ; y location
rh_res@vpWidthF = 0.7 ; width
rh_res@vpHeightF = 0.40 ; height
temp_res = rh_res ; copy shared resources to other lists
uv_res = rh_res
;***********************************************
; Relative humidity only resources
;***********************************************
rh_res@cnFillOn = True ; turns on color fill
rh_res@cnFillPalette = colors ; set color map
rh_res@cnLineLabelsOn = True ; no contour labels
rh_res@tiMainString = "Meteogram for LGSA, 28/12Z" ; title
rh_res@cnFillOn = True ; turns on the color
rh_res@sfXArray = taus ; Define X/Y axes values that
rh_res@sfYArray = levels ; all three data fields are on
rh_res@tiYAxisString = "Pressure (mb)" ; Y axes label.
; y-left axis changes
rh_res@tmYLMode = "Explicit" ; Define own tick mark labels.
rh_res@tmYLValues = levels ; location of explicit labels
rh_res@tmYLLabels = levels
rh_res@tmYLMinorOn = False ; No Y-left minor tick marks.
; x-bottom axis changes
rh_res@tmXBMode = "Explicit" ; Define own tick mark labels.
rh_res@tmXBValues = taus ; location of explicit labels
rh_res@tmXBLabelAngleF = 90. ; change label angle
rh_res@tmXBMinorOn = False ; No minor tick marks.
rh_res@tmXBLabelJust = "CenterCenter" ; label justification
rh_res@tmXBLabelFontHeightF = .016 ; Font size
rh_res@tiXAxisString = "" ; turn off x-axis string
;***********************************************
; Temperature only resources
;***********************************************
temp_res@sfXArray = taus ; Define X/Y axes values that
temp_res@sfYArray = levels ; all three data fields are on
temp_res@cnLineLabelsOn = True ; no contour labels
temp_res@cnLineThicknessF= 3.0 ; line thickness
temp_res@cnLineColor = "Red" ; color of contour lines
;***********************************************
; wind barb only resources
;***********************************************
uv_res@vfXArray = taus ; Define X/Y axes values that
uv_res@vfYArray = levels ; all three data fields are on
uv_res@vcRefAnnoOn = False ; turns off the ref vector
uv_res@vcRefLengthF = 0.040 ; set length of ref vector
uv_res@vcGlyphStyle = "WindBarb" ; turn on windbarbs
uv_res@vcMonoWindBarbColor = True ; to color the windbarbs with
; respect to speed use False
uv_res@vcMapDirection = False ; needed to disassociate the coordinate plane from the wind barbs
;***********************************************
;********************************************************
; Create the five plots (they won't get drawn here, because gsnDraw
; was set to False for all of them.
;********************************************************
rhfill = gsn_contour(wks,smothrh,rh_res)
templine = gsn_contour(wks,smothtemp,temp_res)
windlayer = gsn_vector(wks,ugrid,vgrid,uv_res)
;********************************************************
; three of the above plots become one overlay plot
;********************************************************
overlay(rhfill,templine) ; result is templine over rhfill
overlay(rhfill,windlayer) ; result is windlayer over the other two
draw(rhfill) ; draw this overlay result
frame(wks) ; finally advance the frame once all on page
end
脚本如上,就是稍微改了一下读取的数据,删掉了一点。求大神指点
|
-
-
|