[ncl-talk] Lanczos Filtering

Dennis Shea shea at ucar.edu
Tue Dec 5 13:19:26 MST 2017


Likely,  you have zero  or near-zero values in the original time series.

This make filtering problematical. If you have any negatives weights you
may have filtered values less than 0,0.

The reason I pointed you to Example 8 was so you could see the response
function of your parameters you set..

Run the attached script. It produces 2 plots one for each 'sigma' factor.

You may have to resort to

   prc_filt = where(prc_filt.lt.0.0, 0.0, prc_filt)

Good luck



On Tue, Dec 5, 2017 at 12:37 PM, Kiswendsida Hyacinthe GUIGMA <
karongseba at gmail.com> wrote:

> Thank you dear Dennis for your help. I am sorry if my questions look too
> basic. I already read the filtering examples.
> The fact is that using their method (you can see my code in my previous
> post), from daily rainfall data I got negative values after filtering, what
> is abnormal.
> -----------------------------
> GUIGMA
>
>
> On Tuesday, 5 December 2017, 19:03, Dennis Shea <shea at ucar.edu> wrote:
>
>
> Please look at the filtering examples:
>    https://www.ncl.ucar.edu/Applications/filter.shtml
>
>    In particular, run Example 8
>
> [1] yes, of course ... more weights can create a sharper cutoff but there
> is a larger loass od data at the beginning and end.
>
> [2] re: practical criterion .... That is up to you as a scientist.
>
> --
> Note ncl-talk is not the place to learn about filtering.
>
> Good luck
>
>
>
> On Tue, Dec 5, 2017 at 9:14 AM, Kiswendsida Hyacinthe GUIGMA <
> karongseba at gmail.com> wrote:
>
> Dear NCL users,
> I am very new on NCL and I am trying to filter my rainfall data using
> Lanczos Filter (bandpass 10-90 day filtering). My question concerns the
> processing of the weights. I would like to know
> 1-is there any relationship between the number of weights to choose and
> the cutoff frequencies?
> 2-is there any practical criterion to choose the number of weights? I know
> that this number influences the loss of data.
> Below is my code:
>
> ------------------------------ ------------------------------
> ------------------------------ ------------------------------
> ------------------------------ ----------------
> ;import the file
> gpcp=addfile("gpcp_Sahel.nc"," r")
> rr=gpcp->precip
> ;filter parameters
> ihp=2 ;bandpass
> sigma=1.0 ; Lanczos sigma
> nWgt    = 81  ; number of weights -> means 40 data lost at the beginning
> and 40 data lost at the end.
> fca     = 1./90.            ; start freq ;highpass= 90 days
> fcb     = 1./10.                        ; last  freq; lowpass= 10 days
> wgt     = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )
> printVarSummary(wgt)
> xBPF    = wgt_runave_n_Wrap ( rr, wgt, 0, 0)      ; 10-90 day bp performed
> across time dimension(0) of rr (meaning the time dimension)
>  ----------------------------- ------------------------------
> ------------------------------ ------------------------------
> ------------------------------ ----------------
>
>
>
>
>
> Cheers,
>
> GUIGMA
>
> ______________________________ _________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/ mailman/listinfo/ncl-talk
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171205/220140b4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FILWGTS.guigma.ncl
Type: application/octet-stream
Size: 6765 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171205/220140b4/attachment.obj>


More information about the ncl-talk mailing list