爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6022|回复: 2

(NCL)关于官网滤波的问题

[复制链接]
发表于 2014-8-14 02:58:44 | 显示全部楼层 |阅读模式
GrADS
系统平台:
问题截图:
问题概况: 根据http://www.ncl.ucar.edu/Applications/Images/filters_3_1_lg.png的这个程序作图,对其中里面参数nWgt该如何理解呢?而且我根据这个程序作图,得出了如下图的对称图,而官网上的例子图形却是不对称的,到底是哪里做错了呢?喜欢大神解答。
我看过提问的智慧: 看过
自己思考时长(天): 10

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 BDRUSH 于 2014-8-14 15:17 编辑

惯例@longlivehj 官网脚本如下: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  
diri    = "/Users/shea/Data/AMWG/"  
vName   = "U_anom"        ; name of variable on the file
fili    = "uwnd.day.850.anomalies.1980-2005.nc"
f       = addfile(diri+fili, "r")
x       = f->$vName$(:,{0},{120});
***********************************************
; create the filter weights and apply
; ***********************************************  
ihp     = 2                             ; band pass  
sigma   = 1.0                           ; Lanczos sigma  
nWgt    = 201                           ; loose 100 each end                             
fca     = 1./100.                       ; start freq
fcb     = 1./20.                        ; last  freq  
wgt     = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )  
xBPF    = wgt_runave ( x, wgt, 0 )      ; 20-100 day
; ***********************************************
; create new date array for use on the plot
; ***********************************************  
date    = cd_calendar(x&time,-2)        ; yyyymmdd  
yrfrac  = yyyymmdd_to_yyyyfrac (date, 0)  
delete(yrfrac@long_name)  
delete(x@long_name)  
pStrt = 19950101      ; 4 years: winter 96-97 MJO gold standard
pLast = 19981231  
iStrt = ind(date.eq.pStrt)        ; user specified dates
iLast = ind(date.eq.pLast)  
delete(date)  
pltType = "ps"
pltName = "filters"  
plot    = new ( 2, "graphic")   
wks     = gsn_open_wks (pltType,pltName)  
res              = True            ; plot mods desired  r
es@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@vpXF         = 0.1             ; start plot at x ndc coord   
res@gsnYRefLine  = 0.0             ; create a reference line      
res@gsnCenterString = "Anomaly U [0, 100E]"   
plot(0) = gsn_csm_xy (wks,yrfrac(iStrt:iLast),x(iStrt:iLast),res)         
res@gsnCenterString  = "Band Pass Filtered: 20-100 day"      
plot(1) = gsn_csm_xy (wks,yrfrac(iStrt:iLast),xBPF(iStrt:iLast),res)         
resP                 = True      
resP@gsnMaximize     = True  
gsn_panel(wks,plot,(/2,1/),resP)
end





密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-14 03:10:48 | 显示全部楼层
额,版区弄错了,该如何修改
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-8-14 16:51:42 | 显示全部楼层
有没有人啊
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表