- 积分
- 820
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-12-14
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2017-6-15 14:02:13
|
显示全部楼层
begin
f=addfile("hwf.nc","r")
;f1=addfile("runeof_ts.nc","c")
ap=f->ap
b=dim_rmvmean_n_Wrap(ap,0)
b!0="time"
b!1="lat"
b!2="lon"
time=ispan(1950,2014,1)
lon=fspan(-180,180,96)
lat=fspan(-90,90,73)
b&time=time
b&lon=lon
b&lat=lat
b&time@lon_name="year"
b&time@units="year"
b&lon@long_name="lon"
b&lon@units="degrees_east"
b&lat@long_name="lat"
b&lat@units="degrees_north"
y=runave_n_Wrap(b, 3, 0, 0)
copy_VarCoords(b,y)
printVarSummary(y)
optEOF = False
optETS = False
neval =2
eof= eofunc_Wrap(y({lat|20:50},{lon|70:140},{time|:}),neval,optEOF)
eof_ts=eofunc_ts_Wrap (y({lat|20:50},{lon|70:140},{time|:}),eof, optETS)
eof_ts=-eof_ts/10
eof=-10*eof
;f1->ts=eof_ts
print(max(eof(0,:,:)))
print(max(eof(1,:,:)))
print(min(eof(0,:,:)))
print(min(eof(1,:,:)))
;print(eof_ts(0,:))
wks = gsn_open_wks("png","1950_2014hwfeof(2)")
res2=True
res2@gsnDraw = False
res2@gsnFrame = False
res2@gsnAddCyclic = False
res2@mpCenterLonF = 100
res2@mpLimitMode = "LatLon"
res2@mpMinLatF = 20
res2@mpMaxLatF = 50
res2@mpMinLonF = 70
res2@mpMaxLonF = 138
res2@cnFillOn = True
res2@cnFillPattern ="Explicit"
res2@cnLevelSelectionMode="ManualLevels"
res2@cnMinLevelValF=-1.0
res2@cnMaxLevelValF=1.4
res2@cnLevelSpacingF=0.2
res2@cnFillColors=(/2,18,34,50,66,82,145,161,177,193,209,225,241,255/)
res2@mpDataBaseVersion="Ncarg4_1" ;ÖDμè·Ö±æÂê
res2@mpDataSetName="Earth..4" ;μú4°æμØí¼£¬óDÖD1ú±ß½çêy¾Y
res2@mpOutlineOn = True
res2@mpOutlineSpecifiers=(/"China:states","Taiwan"/) ;ÖD1ú±ß½çóDÎêìa£¬è±2ØÄÏ¡¢ì¨íå
res2@mpOutlineBoundarySets ="NoBoundaries"
res2@cnSmoothingOn =True
res2@cnRasterSmoothingOn= True
;gsn_define_colormap(wks,"leng")
;res2@tiMainString = "hwfeof(0)1950-2014dtrend"
res2@tmXBMode = "Explicit"
res2@tmXBValues = (/"70","80","90","100","110","120","130","140"/)
res2@tmXBLabels = (/"70E","80E", "90E", "100E","110E","120E","130E","140E"/)
;res2@cnLevelSelectionMode="ManualLevels"
;res2@cnMinLevelValF=-1.0
;res2@cnMaxLevelValF=1.4
;res2@cnLevelSpacingF=0.2
res2@cnMissingValFillColor="white"
rts2 = True
rts2@gsnDraw = False
rts2@gsnFrame = False
rts2@vpHeightF = 0.40 ; Changes the aspect ratio
rts2@vpWidthF = 0.80
rts2@vpXF = 0.80 ; change start locations
rts2@vpYF = 0.75 ; the plot
rts2@tiYAxisString = ""
rts2@tiXAxisString = "year"
rts2P = True ; modify the panel plot
rts2P@gsnMaximize = True ; large format
rts2@trYMaxF=15
rts2@trYMinF=-15
rts2@gsnYRefLine = 0. ; reference line
rts2@gsnXYBarChart = True ; create bar chart
rts2@gsnAboveYRefLineColor = "red" ; above ref line fill red
rts2@gsnBelowYRefLineColor = "blue" ; below ref line fill blue
rts2@tmXBMode = "Explicit"
rts2@tmXBValues=(/"1950","1960","1970","1980","1990","2000","2010"/)
rts2@tmXBLabels=(/"1950","1960","1970","1980","1990","2000","2010"/)
;rts2@tiMainString = "AP_Ts_02:1950-2014"
rts2@gsnLeftString = "EOF "+(1+1)
;rts2@gsnRightString = sprintf("%5.1f", eof@pcvar(1)) +"%"
plots = new(2,graphic)
res2@tiMainString = "1950_2014hwfeof2"
res2@gsnLeftString = "EOF2 "
;cmap2 = read_colormap_file("14")
;res2@cnFillColors = cmap2
;gsn_define_colormap(wks,"14")
res2@gsnRightString = sprintf("%5.1f", eof@pcvar(1)) +"%"
plots(0) = gsn_csm_contour_map(wks,eof(1,:,:),res2)
plots(1)= gsn_csm_xy (wks,time,eof_ts(1,:),rts2)
pres = True
;pres@tiMainString = "1950_2014hwf_eof"
pres@gsnMaximize = True
pres@gsnPanelDebug=True
pres@gsnPanelRowSpec = True
pres@gsnPanelLabelBar = False
pres@lbBoxLinesOn = False
gsn_panel(wks,plots,(/1,2/),pres)
end |
|