阅读每月的南方涛动指数(只有达尔文市)
使用不同的过滤器长度(49[实线],121[虚线]),生成两个低通过滤器,(理想情况下)将消除24个月(2年)以内的波动。
使用不同的过滤器长度(121[实线],241[虚线]),生成两个低通过滤器,(理想情况下)将消除小于120个月(10年)的波动。
蓝色(49权)和红色(121权)曲线是为24个月的过滤器。在这种情况下,使用长得多的过滤器(121 vs 49)并不能获得很多。
此外,使用49点过滤器在末端返回更多的数据。
绿色(121权)和黑色(241权)曲线是用于120个月的过滤器。响应函数相差不大,因此,年代际曲线相差不大。
; ***************************** ; filters_2.ncl ; ************************************* ;
; 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"
; ***********************************************
begin
f = addfile ("./SOI.nc" , "r")
dsoi = f->SOI_DARWIN
ihp = 0 ; low_pass
sigma = 1.0 ; Lanczos sigma
nWgt = 49 ; loose 24 months each end
fca = 1./24. ; 2 years
wgtq = filwgts_lanczos (nWgt, ihp, fca, -999., sigma )
nWgt = 121 ; loose 60 months each end
fca = 1./24. ; 2 years
wgtr = filwgts_lanczos (nWgt, ihp, fca, -999., sigma )
nWgt = 121 ; loose 60 months each end
fca = 1./120. ; decadal
wgts = filwgts_lanczos (nWgt, ihp, fca, -999., sigma )
nWgt = 241 ; loose 120 months each end
fca = 1./120. ; decadal
wgtt = filwgts_lanczos (nWgt, ihp, fca, -999., sigma )
ntim = dimsizes( dsoi )
yPlot = new ( (/4,ntim/) , typeof(dsoi), getFillValue(dsoi) )
yPlot(0,:) = wgt_runave ( dsoi, wgtq, 0 ) ; 2 year
yPlot(1,:) = wgt_runave ( dsoi, wgtr, 0 ) ; 2 year
yPlot(2,:) = wgt_runave ( dsoi, wgts, 0 ) ; 10 year
yPlot(3,:) = wgt_runave ( dsoi, wgtt, 0 ) ; 10 year
; ****************** ; create new date array for use on the plot ; *******************
pltType = "png" ; send graphics to PNG file
pltName = "filters"
date = f->time ; yyyymm
ntim = dimsizes(date)
yrfrac = yyyymm_to_yyyyfrac (date, 0)
delete(yrfrac@long_name)
delete(dsoi@long_name)
plot = new ( 2, "graphic")
wks = gsn_open_wks (pltType,pltName)
res = True ; plot mods desired
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame yet
res@vpHeightF = 0.4 ; change aspect ratio of plot
res@vpWidthF = 0.8
res@trYMinF = -3.0 ; min value on y-axis
res@trYMaxF = 3.0 ; max value on y-axis
res@trXMinF = 1860 ; min value on x-axis
res@trXMaxF = 2016 ; max value on x-axis
res@vpXF = 0.1 ; start plot at x ndc coord
res@gsnYRefLine = 0.0 ; create a reference line
res@gsnCenterString = "Darwin Southern Oscillation Index"
plot(0) = gsn_csm_xy (wks,yrfrac,dsoi,res)
res@xyMonoDashPattern= True
res@xyLineThicknessF = 2
res@xyLineColors = (/ "blue", "red", "green", "black" /)
res@gsnCenterString = "Low Pass Filtered: 2-year and 10-year"
plot(1) = gsn_csm_xy (wks,yrfrac,yPlot,res)
resP = True
resP@gsnMaximize = True
gsn_panel(wks,plot,(/2,1/),resP)
end