[ncl-talk] lanczos higpass filter in ncl
Dennis Shea
shea at ucar.edu
Mon Jan 16 08:21:13 MST 2017
I think you want to use:
http://www.ncl.ucar.edu/Document/Functions/Contributed/wgt_runave_n_Wrap.shtml
----
Replace these two lines:
*prec_lz = wgt_runave_Wrap(ua, wgt,0)*
copy_VarMeta(ua,prec_lz)
With:
*prec_lz = wgt_runave_n_Wrap(ua, wgt,0,0)*
Please read the documentation for:
http://www.ncl.ucar.edu/Document/Functions/Contributed/wgt_runave_n_Wrap.shtml
On Mon, Jan 16, 2017 at 4:34 AM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:
> Hi All,
>
> I'm trying to do a 120 day lanczos highpass filter in ncl.
>
> *I'm getting the following errors:*
>
>
> Variable: ua
> Type: float
> Total Size: 22352400 bytes
> 5588100 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 6209] x [lat | 30] x [lon | 30]
> Coordinates:
> time: [2557.5..8765.5]
> lat: [14.5..-14.5]
> lon: [0.5..29.5]
> Number Of Attributes: 4
> long_name : Anomalies: GPCP: daily precipitation
> units : mm/day
> _FillValue : -99999
> missing_value : -99999
>
> Variable: wgt
> Type: float
> Total Size: 244 bytes
> 61 values
> Number of Dimensions: 1
> Dimensions and sizes: [61]
> Coordinates:
> Number Of Attributes: 2
> resp : <ARRAY of 125 elements>
> freq : <ARRAY of 125 elements>
> *fatal:wgt_runave: The length of wgt must be less than or equal to the
> rightmost dimension of x*
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 6753 in
> file /usr/local/ncl-6.3.0/lib/ncarg/nclscripts/csm/contributed.ncl
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 22 in
> file highpass.ncl
>
>
> *Question:*
> I'm getting the error at the wgt_runave_Wrap. I also tried using the
> wgt_runave_n_Wrap. No error but this function returns undefined values in
> the output netcdf file.
> Has anyone experienced this problem before? I tried to look for this error
> over the net, but found no solution. Any suggestion on how to solve this?
>
>
> *Here's my code:*
> begin
> f = addfile("test1.nc", "r")
> time = f->time
> date = ut_calendar(time,-2)
> ua = f->gpcp_anom(:,:,:)
> printVarSummary(ua)
> lat= f->lat
> lon= f->lon
>
> fcb= -999
> fca=0.00833
> nwt=61
> ihp=1
> nsigma=1.
>
> wgt = filwgts_lanczos(nwt,ihp,fca,fcb,nsigma)
> printVarSummary(wgt)
> *prec_lz = wgt_runave_Wrap(ua, wgt,0)*
> copy_VarMeta(ua,prec_lz)
> prec_lz at long_name = "Highpass Pass:120day"
> ncdf = addfile("highfilt.nc","c")
> fAtt = True
> fAtt at title = "61wgt HPass Filter"
> fAtt at source_file = "gpcp_daily_1997-2013.nc"
> fAtt at Conventions = "None"
> fAtt at creation_date = systemfunc("date")
> fileattdef(ncdf,fAtt) ; copy file attributes
> filedimdef(ncdf,"time",-1,True)
> ncdf->prec_lz = prec_lz
> end
>
>
> Many thanks,
>
> I'll appreciate any help.
>
> *Lyndon*
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170116/267878bd/attachment.html
More information about the ncl-talk
mailing list