- 积分
- 3616
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 指甲钳 于 2024-3-4 16:52 编辑
如题,用的FNL1*1的资料。为什么画出来的风向杆间隔像是5*5的呢?
; These files are loaded by default in NCL V6.2.0 and newer
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/myfoo.ncl"
begin
;>---------------------------------------<
; 输入数据地址
;>---------------------------------------<
filename = "e:/data/baoyu/fnl_20240229_12_00.grib2"
shp_filename = "gis/guangdong/guangdong.shp"
f = addfile(filename + ".grib2", "r")
hgt = f->HGT_P0_L100_GLL0({50000}, :, :)
hgt = hgt * 0.14
u = f->UGRD_P0_L100_GLL0({85000}, ::4, ::4)【此处读取UV的时候设置为4个间隔了,应为1】
v = f->VGRD_P0_L100_GLL0({85000}, ::4, ::4)
;>---------------------------------------<
; 读取时间
;>---------------------------------------<
time = u@initial_time
DATE = grib_stime2itime (time)
;>---------------------------------------<
; 设置图片格式和文件名
;>---------------------------------------<
wks = gsn_open_wks("x11", DATE+"-500hgt&850wind-1")
gsn_define_colormap(wks,"wind_8")
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnLeftString = ""
res@gsnRightString = ""
;>---------------------------------------<
;>---------------------------------------<
; 等值线设置
;>---------------------------------------<
cnres = res
cnres@cnSmoothingOn = True ;
cnres@cnSmoothingDistanceF = 0.001
cnres@cnLevelSelectionMode = "ManualLevels"
cnres@cnMinLevelValF = 500
cnres@cnMaxLevelValF = 600
cnres@cnLevelSpacingF = 4
cnres@cnInfoLabelOn = False
cnres@cnLineLabelsOn = True
cnres@cnLineLabelFontHeightF = 0.01
cnres@cnLineThicknessF = 2.0
cnres@cnLineLabelInterval = 1
cnres@cnLineColor = "red"
cnres@tiMainOn = False
;cnres@tiMainString = DATE+"-850Wind & 500Height"
;cnres@tiMainPosition = "right"
;cnres@tiMainFontHeightF = 0.015
;cnres@tiMainJust ="CenterRight"
;>---------------------------------------<
;>---------------------------------------<
; 风速阴影图设置
;>---------------------------------------<
mm_ff= wind_speed(u, v)
mres = True
mres@gsnAddCyclic = False
mres@gsnDraw = False ; don't draw yet
mres@gsnFrame = False
mres@cnFillOn = True
mres@cnLinesOn = False
mres@gsnSpreadColors = True
mres@cnLevelSelectionMode = "ExplicitLevels"
mres@cnLevels = (/8,12,16,20,24,28,32/)
mres@cnSmoothingOn = True
mres@cnSmoothingDistanceF = 0.001
mres@cnSmoothingTensionF = -2.5
mres@lbBoxLinesOn = False
mres@lbLabelFontHeightF = 0.01
mres@lbBoxMinorExtentF = 0.15
mres@pmLabelBarOrthogonalPosF = -0.03
;mres@lbTitleString = "wind speed"
mres@lbTitleFontHeightF = 0.01
mres@lbOrientation = "vertical"
mres@gsnLeftString = "850Wind & 500Height"
mres@gsnRightString = DATE
;>---------------------------------------<
;>---------------------------------------<
; 风向杆设置
;>---------------------------------------<
;u = u*2.5
;v = v*2.5
vcres = res
vcres@gsnAddCyclic = False
;vcres@vcRefMagnitudeF = 50. ;调整箭头大小?
vcres@vcRefLengthF = 0.04
;vcres@vcGlyphStyle = "FillArrow"
vcres@vcGlyphStyle = "WindBarb"
vcres@vcMinDistanceF =0.0025
vcres@vcRefAnnoOn = False
vcres@vcWindBarbLineThicknessF = 1.5
vcres@vcMinMagnitudeF = 0.01
vcres@vcWindBarbTickLengthF = 0.5
vcres@vcWindBarbLineThicknessF = 3
vcres@vcWindBarbTickSpacingF = 0
vcres@vcWindBarbColor = "BLUE"
;>---------------------------------------<
; 地图设置
;>---------------------------------------<
mpres = res
mpres@mpFillOn = False
mpres@mpMinLatF = 15.
mpres@mpMaxLatF = 30.
mpres@mpMinLonF = 100.
mpres@mpMaxLonF = 125.
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpDataSetName = "Earth..4"
mpres@mpOutlineSpecifiers = (/"China:states"/)
mpres@pmTickMarkDisplayMode = "Always"
mpres@tmXBMajorLengthF = 0.005
mapplot = gsn_csm_map(wks, mpres)
wsplot=gsn_csm_contour(wks,mm_ff,mres)
cnplot = gsn_csm_contour(wks, hgt, cnres)
thick_specified_contourF(cnplot,588,4,-1)
vcplot = gsn_csm_vector(wks, u, v, vcres)
;>---------------------------------------<
;>---------------------------------------<
;>---------------------------------------<
; 广东地区
;>---------------------------------------<
lnres = True
lnres@gsLineColor = "black"
lnres@gsLineThicknessF = 2.0
line_mask = gsn_add_shapefile_polylines(wks, cnplot, shp_filename, lnres)
overlay(mapplot, wsplot)
overlay(mapplot, cnplot)
overlay(mapplot, vcplot)
draw(mapplot)
frame(wks)
end
|
-
850风场
|