- 积分
- 20232
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如图,在热带地区以外的最值闭合中心却通不过显著性检验,反而旁边的区域却通过了,感觉像是检验填色图左移几个格子似的,不知道怎么回事?望各位朋友帮忙解决一下,在此谢谢各位啦!
(代码较长,有些地方略啰唆,代码为:300hPa位势高度与EOF的PC1做回归,并对其做t检验(tval))
十分感谢各位留言的童鞋!!!
- 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"
- begin
- yrStrt = 1979
- yrLast = 1996
- ymStrt = yrStrt*100 + 1
- ymLast = yrLast*100 + 12
- ff=addfile("/disk3/erainterim2.5/monthly/pressure/air.mon.mean.nc","r")
- TIME = ff->time
- YYYY = cd_calendar(TIME,-1)/100 ; entire file
- iYYYY = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
- ST=ff->t(iYYYY,{850},:,:)
- STT=short2flt(ST)-273.15
- copy_VarMeta(ST, STT)
- STT@units= "C"
- STT2=month_to_season(STT,"DJF")
- f=addfile("/disk3/erainterim2.5/monthly/pressure/hgt.mon.mean.nc","r")
- Z=f->z(0:215,:,:,:)
- Z:=short2flt(Z)
- ZDJF=month_to_season(Z, "DJF")
- TT=ZDJF(:,{200},:,:)-ZDJF(:,{850},:,:)
- copy_VarMeta(ZDJF(:,0,:,:), TT)
- printVarSummary(TT)
- printMinMax(TT, False)
- neof = 1 ; number of EOFs
- optEOF = True
- optEOF@jopt = 1 ; This is the default; most commonly used; no need to specify.
- ;optEOF@jopt = 1 ; **only** if the correlation EOF is desired
- optETS = False
- ; =================================================================
- TT2 = TT(:,{-20:20},:)
- rad = get_r2d("float")
- clat = TT2&latitude
- clat = sqrt( cos(rad*clat) ) ; gw for gaussian grid
- printVarSummary(clat)
- ; =================================================================
- ; weight all observations
- ; =================================================================
- xw = TT2*conform(TT2, clat, 1)
- copy_VarMeta(TT2, xw)
- xw@long_name = "hgt: "+Z@long_name
- ; =================================================================
- eof = eofunc_n_Wrap(xw, neof, optEOF, 0)
- eof=-1*eof ; *special* match sign of CPC
- eof2 =eofunc_n_Wrap(STT2,neof,optEOF,0)
- eof2=-1*eof2
- eof_ts = eofunc_ts_n_Wrap (xw, eof, optETS, 0)
- printVarSummary( eof2 ) ; examine EOF variables
- eof_ts = dim_standardize_n( eof_ts, 0, 1) ; normalize
- printMinMax(eof_ts,False)
- ; =================================================================
- ; Regress
- ; =================================================================
- TT3=STT2(latitude|:,longitude|:,time|:)
- tval=new((/73,144/),"float")
- nxy =new((/73,144/),"integer")
- lon = lonGlobeF(144, "lon", "lon", "degrees_east")
- tval!1= "lon"
- tval&lon = lon
- lat = latGlobeF(73, "lat", "lat", "degrees_north")
- tval!0= "lat"
- tval&lat = lat
- lon = lonGlobeF(144, "lon", "lon", "degrees_east")
- nxy!1= "lon"
- nxy&lon = lon
- lat = latGlobeF(73, "lat", "lat", "degrees_north")
- nxy!0= "lat"
- nxy&lat = lat
- eof_regres = eof2 ; create an array w meta data
- do ne=0,neof-1
- eof_regres(ne,:,:) = regcoef(eof_ts(ne,:),TT3, tval,nxy )
- end do
- ; df=16
- ; tval=student_t(tval, df)
- ; printVarSummary(eof_regres)
- ;printMinMax(eof_regres,False)
- printMinMax(tval, False)
-
- ;============================================================
- ; PLOTS
- ;============================================================
- wks = gsn_open_wks("pdf","/disk1/dzz/study/ncl/TT/SATEOF") ; send graphics to PNG file
- gsn_define_colormap(wks,"amwg256")
- plot = new(neof,graphic) ; create graphic array
- plot2= new(neof,graphic) ; only needed if paneling
- ; EOF patterns
- res = True
- res@gsnDraw = False ; don't draw yet
- res@gsnFrame = False ; don't advance frame yet
- ;res@gsnAddCyclic = False ; plotted dataa are not cyclic
-
- res@mpFillOn = False ; turn off map fill
- res@mpOutlineOn = True
- res@mpMinLatF = -40 ; zoom in on map
- res@mpMaxLatF = 80
- res@mpMinLonF = 0
- res@mpMaxLonF = 360
- res@mpCenterLonF = 180
- res@cnFillOn = False ; turn on color fill
- res@cnLinesOn = True ; True is default
- res@cnLineLabelsOn = False ; True is default
- res@gsnContourNegLineDashPattern = 1
- res@cnLineDrawOrder ="PostDraw"
- ;res@cnFillPalette = "BlWhRe" ; set color map
- res@cnLevelSelectionMode = "ManualLevels"
- res@cnMinLevelValF = -1.
- res@cnMaxLevelValF =1.5
- res@cnLevelSpacingF = 0.5
- res@lbLabelBarOn = False ; turn off individual lb's
- res@cnInfoLabelOn = False
- ;res@lbTitleOn = False
- res@cnSmoothingOn = True
- ;res@cnRasterSmoothingOn = True
- ;symMinMaxPlt(eof_regres, 0.5, False, res) ; contributed.ncl
- ;res2@cnRasterSmoothingOn = True
- ; panel plot only resources
- resP = True ; modify the panel plot
- resP@gsnMaximize = True ; large format
- resP@gsnPanelLabelBar = True ; add common colorbar
-
- resP@txString = ""
- res2 = True
- res2@gsnDraw = False
- res2@gsnFrame = False
- res2@cnFillOn = True ; turn on color fill
- res2@cnLinesOn = False ; True is default
- res2@cnLineLabelsOn = False ; True is default
- ;res2@gsnContourNegLineDashPattern = 1
- ;res@cnFillPalette = "BlWhRe" ; set color map
- res2@lbLabelBarOn = False ; turn off individual lb's
- res2@cnLevelSelectionMode = "ExplicitLevels"
- res2@cnLevels = (/-2.120,-1.746,1.746,2.120/)
- res2@cnFillColors = (/22,7,0,177,225/)
- res2@cnInfoLabelOn = False
- ;res2@lbTitleOn = False
- ;res2@cnSmoothingOn = True
- ;*******************************************
- ; first plot
- ;*******************************************
- do n=0,neof-1
- res@gsnLeftString = "(a) T850"
- res@gsnRightString = "CI=0.5 C"
- plot(n)= gsn_csm_contour_map(wks,eof_regres(n,:,:),res)
- plot2(n)=gsn_csm_contour(wks,tval,res2)
- overlay(plot, plot2)
- draw(plot)
- frame(wks)
- end do
- gsn_panel(wks,plot,(/neof,1/),resP) ; now draw as one plot)
- end
复制代码
|
-
|