- 积分
- 150
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-3-30
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想做风矢量和时间序列的相关,但画出来的风矢量图的风向都为西南风,不知道程序有什么问题,附上程序,求各位大佬帮忙指点!
begin
uv700 = addfile("uv700.nc","r")
data = asciiread("pc1.txt",(/42/),"float")
u = short2flt(uv700->u(:,{0:40},{70:130}))
v = short2flt(uv700->v(:,{0:40},{70:130}))
; printVarSummary(u)
u_SON = new((/42,161,241/), "float")
v_SON = new((/42,161,241/), "float")
do i=0,41
u_SON(i,:,:) = dim_avg_n(u(i*3:i*3+2,:,:),0) ;秋季平均
v_SON(i,:,:) = dim_avg_n(v(i*3:i*3+2,:,:),0)
end do
;去趋势
; u_SONd = new((/42,161,241/), "float")
; v_SONd = new((/42,161,241/), "float")
; do i=0,160
; do j=0,240
; u_SONd(:,i,j) = dtrend_n(u_SON(:,i,j), False, 0)
; v_SONd(:,i,j) = dtrend_n(v_SON(:,i,j), False, 0)
; end do
; end do
u_SONd1 = dim_avg_n(u_SON,0)
v_SONd1 = dim_avg_n(v_SON,0)
printVarSummary(u_SONd1)
;分别和uv风做相关
r_u = new((/161,241/), "float")
r_v = new((/161,241/), "float")
do i=0,160
do j=0,240
r_u(i,j) = escorc(data(:),u_SON(:,i,j))
r_v(i,j) = escorc(data(:),v_SON(:,i,j))
end do
end do
t_u = rtest(r_u,42,0)
t_v = rtest(r_v,42,0)
;print(min(t_u))
lat1 = fspan(0,40,161) ;设定全球图的网格点经纬度信息
lat1!0 = "lat"
lat1@units = "degrees_north"
lat1@long_name = "longitude"
lon1 = fspan(70,130,241)
lon1!0 = "lon"
lon1@units = "degrees_east"
lon1@long_name = "longitude"
t_u!0 = "lat"
t_u!1 = "lon"
t_u&lat = lat1
t_u&lon = lon1
copy_VarCoords(t_u,t_v)
copy_VarCoords(t_u,r_u)
copy_VarCoords(t_u,r_v)
copy_VarCoords(t_u,u_SONd1)
copy_VarCoords(t_u,v_SONd1)
;分别和uv风做相关
wks = gsn_open_wks("png","改700hPa相关")
sres = True
sres@gsnDraw = False
sres@gsnFrame = False
sres@cnLineLabelsOn = False
sres@cnLinesOn = False
sres@cnInfoLabelOn = False
sres@cnFillOn = False
sres@lbLabelBarOn = False
sres@cnInfoLabelOn = False
sres@cnFillDotSizeF = 0.004
res_map = True
res_map@mpFillOn=False
res_map@gsnDraw = False
res_map@gsnFrame = False
res_map@mpMinLatF = 0
res_map@mpMaxLatF = 40
res_map@mpMinLonF = 70
res_map@mpMaxLonF = 130
res_map@mpOutlineOn =True
res_map@mpOutlineBoundarySets="National"
res_map@mpDataBaseVersion="MediumRes"
res_map@mpDataSetName="Earth..4"
res_map@mpAreaMaskingOn=True
res_map@mpMaskAreaSpecifiers=(/"China:states","Taiwan"/)
res_map@mpOutlineSpecifiers="China:states"
res_map@cnLineDrawOrder="PreDraw"
res_map@mpNationalLineThicknessF=1
res_map@mpProvincialLineThicknessF=1
/;res_map@gsnAddCyclic=False
res_map@cnLevelSelectionMode="ExplicitLevels"
res_map@cnLevels=(/0.01,0.05,0.1/)
res_map@cnFillOn=True
;/
res_vc = True
res_vc@gsnAddCyclic = False
res_vc@vcMinMagnitudeF = 0.0 ;需要绘制矢量箭头的最小值
res_vc@vcGlyphStyle = "LineArrow" ;设置箭头参考样式
res_vc@vcRefAnnoOn = True
res_vc@vcRefMagnitudeF = 0.5
res_vc@vcMinDistanceF = 0.015 ;控制稀疏
res_vc@vcLineArrowThicknessF = 2.5
res_vc@vcRefLengthF = 0.01
cnres = True
cnres@gsnDraw = False
cnres@gsnFrame = False
cnres@gsnShadeFillType = "color"
cnres@gsnShadeLow = "deepskyblue1"
cmres = True ;通过95%检验
cmres@gsnDraw = False
cmres@gsnFrame = False
cmres@gsnShadeFillType = "color"
cmres@gsnShadeLow = "deepskyblue2"
cvres = True ;通过99%检验
cvres@gsnDraw = False
cvres@gsnFrame = False
cvres@gsnShadeFillType = "color"
cvres@gsnShadeLow = "deepskyblue3"
/;
plot=gsn_csm_contour_map(wks,t_u,res_map)
plot=gsn_csm_contour_map(wks,t_v,res_map)
;/
p1 = gsn_csm_contour(wks,t_u,sres)
p1 = gsn_contour_shade(p1,0.1,-999, cnres) ;u通过90%检验
p2 = gsn_csm_contour(wks,t_v,sres)
p2 = gsn_contour_shade(p2,0.1,-999, cnres) ;v通过90%检验
sres@cnLevelSelectionMode="ExplicitLevels"
sres@cnLevels=0.05
p3 = gsn_csm_contour(wks,t_u,sres)
p3 = gsn_contour_shade(p3,0.05,-999, cmres) ;u通过95%检验
p4 = gsn_csm_contour(wks,t_v,sres)
p4 = gsn_contour_shade(p4,0.05,-999, cmres) ;v通过95%检验
sres@cnLevelSelectionMode="ExplicitLevels"
sres@cnLevels=0.01
p5 = gsn_csm_contour(wks,t_u,sres)
p5 = gsn_contour_shade(p5,0.01,-999, cvres) ;u通过99%检验
p6 = gsn_csm_contour(wks,t_v,sres)
p6 = gsn_contour_shade(p6,0.01,-999, cvres) ;v通过99%检验
map = gsn_csm_map(wks,res_map)
vector = gsn_csm_vector(wks,t_u,t_v,res_vc)
overlay(map,p1)
overlay(map,p2)
overlay(map,p3)
overlay(map,p4)
overlay(map,p5)
overlay(map,p6)
overlay(map,vector)
draw(map)
frame(wks)
end
|
-
风向都为西南风,很奇怪。
|