- 积分
- 9405
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-2-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 qq469015280 于 2016-3-14 18:37 编辑
用Fourier Analysis 滤波,官网例子
;----------------------------------------------------------------------
; fanal_3.ncl
;
; Concepts illustrated:
; - Calculating wave information of a monthly climatology
;---------------------------------------------------------
; Calculate wave information of a monthly climatology
; . Plot wave numbers 1, 2, 3
;---------------------------------------------------------
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"
id = "./"
in = addfile(id+"ERAI.1989-2005.climo.subset.nc","r") ; climatology: 1989-2005
z = in->Z300 ; (time,lat,lon) ; ( 12 ,121,240)
dimz = dimsizes(z)
nmos = dimz(0)
;****************************************
; Calculate amplitude of each harmonic
;****************************************
; reorder: ezfftf works on right dim
CF = ezfftf (z) ; ezfftf works on right dim
printVarSummary(CF) ; [2] x [12] x [121] x [120]
cf = CF
cf(:,:,:,1:) = 0.0 ; set waves 2 and higher to 0.0
z_wave1 = ezfftb (cf, 0.0) ; [12] x [121] x [240]
copy_VarMeta(z, z_wave1) ; [time | 12] x [lat | 121] x [lon | 240]
cf = CF
cf(:,:,:,0:0) = 0.0 ; set wave 1 to 0.0
cf(:,:,:,2: ) = 0.0 ; set wave 3 and higher to 0.0
z_wave2 = ezfftb (cf, 0.0) ; [12] x [121] x [240]
copy_VarMeta(z, z_wave2) ; [time | 12] x [lat | 121] x [lon | 240]
cf = CF
cf(:,:,:,0:1) = 0.0 ; set wave 1 and 2 to 0.0
cf(:,:,:,3: ) = 0.0 ; set wave 4 and higher to 0.0
z_wave3 = ezfftb (cf, 0.0) ; [12] x [121] x [240]
copy_VarMeta(z, z_wave3) ; [time | 12] x [lat | 121] x [lon | 240]
;****************************************
; Create plot
;****************************************
month = (/"January","Feb","Mar","Apr","May","Jun"\
,"July" ,"Aug","Sep","Oct","Nov","Dec"/)
plot = new (3,"graphic")
pltType = "ps"
pltName = "fanal_wave"
wks = gsn_open_wks(pltType, pltName)
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
res = True ; individual plot
res@gsnDraw = False
res@gsnFrame = False
res@gsnSpreadColors = True
res@cnFillOn = True ; turn on color
res@cnLinesOn = False ; turn on line labels
res@cnLineLabelsOn = False ; turn on line labels
res@lbOrientation = "vertical" ; vertical label bar
res@lbLabelAutoStride = True ; choose best stride
resP = True ; panel resources
;resP@gsnPaperOrientation = "portrait"
resP@gsnSpreadColors = True ; use full range of colormap
resP@gsnMaximize = True
do nmo=0,nmos-1,6
res@gsnLeftString = "Wave 1"
symMinMaxPlt (z_wave1(nmo,:,:),16,False,res)
plot(0) = gsn_csm_contour_map_ce(wks,z_wave1(nmo,:,:),res)
res@gsnLeftString = "Wave 2"
symMinMaxPlt (z_wave2(nmo,:,:),16,False,res)
plot(1) = gsn_csm_contour_map_ce(wks,z_wave2(nmo,:,:),res)
res@gsnLeftString = "Wave 3"
symMinMaxPlt (z_wave3(nmo,:,:),16,False,res)
plot(2) = gsn_csm_contour_map_ce(wks,z_wave3(nmo,:,:),res)
resP@txString = "ERA-Interim: 1989-2005: Z300: "+month(nmo)
gsn_panel(wks,plot,(/3,1/),resP)
end do
但是我的数据是海温,缺测是地形,出现以下错误
这种情况应该怎么改啊??
|
|