<div dir="ltr"><div><div>Likely, you have zero or near-zero values in the original time series.<br><br></div>This make filtering problematical. If you have any negatives weights you may have filtered values less than 0,0.<br><br></div><div>The reason I pointed you to Example 8 was so you could see the response function of your parameters you set..<br><br></div><div>Run the attached script. It produces 2 plots one for each 'sigma' factor. <br><br></div><div>You may have to resort to<br><br></div><div> prc_filt = where(prc_filt.lt.0.0, 0.0, prc_filt)<br><br></div><div>Good luck<br></div><div><br></div><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 5, 2017 at 12:37 PM, Kiswendsida Hyacinthe GUIGMA <span dir="ltr"><<a href="mailto:karongseba@gmail.com" target="_blank">karongseba@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:verdana,helvetica,sans-serif;font-size:16px"><div id="m_8392780780582619306yui_3_16_0_ym19_1_1512501861679_9557"><span></span>Thank you dear Dennis for your help. I am sorry if my questions look too basic. I already read the filtering examples. <br></div><div dir="ltr" id="m_8392780780582619306yui_3_16_0_ym19_1_1512501861679_9602">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. <br></div><div id="m_8392780780582619306yui_3_16_0_ym19_1_1512501861679_9582" class="m_8392780780582619306signature">-----------------------------<br>GUIGMA</div><div><div class="h5"> <div class="m_8392780780582619306qtdSeparateBR"><br><br></div><div style="display:block" class="m_8392780780582619306yahoo_quoted"> <div style="font-family:verdana,helvetica,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div dir="ltr"><font size="2" face="Arial"> On Tuesday, 5 December 2017, 19:03, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:<br></font></div> <br><br> <div class="m_8392780780582619306y_msg_container"><div id="m_8392780780582619306yiv8018064329"><div><div dir="ltr"><div><div><div><div><div>Please look at the filtering examples:<br clear="none"> <a rel="nofollow" shape="rect" href="https://www.ncl.ucar.edu/Applications/filter.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Applications/filter.shtml</a><br clear="none"><br clear="none"></div> In particular, run Example 8<br clear="none"><br clear="none"></div>[1] yes, of course ... more weights can create a sharper cutoff but there is a larger loass od data at the beginning and end.<br clear="none"><br clear="none"></div>[2] re: <span id="m_8392780780582619306yiv8018064329gmail-m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">practical criterion .... That is up to you as a scientist.<br clear="none"><br clear="none">--<br clear="none"></span></div><span id="m_8392780780582619306yiv8018064329gmail-m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">Note ncl-talk is not the place to learn about filtering.<br clear="none"><br clear="none"></span></div><span id="m_8392780780582619306yiv8018064329gmail-m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">Good luck<br clear="none"></span><div><div><span id="m_8392780780582619306yiv8018064329gmail-m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866"><br clear="none"><br clear="none"></span></div></div></div><div class="m_8392780780582619306yiv8018064329gmail_extra"><br clear="none"><div class="m_8392780780582619306yiv8018064329gmail_quote">On Tue, Dec 5, 2017 at 9:14 AM, Kiswendsida Hyacinthe GUIGMA <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:karongseba@gmail.com" target="_blank">karongseba@gmail.com</a>></span> wrote:<br clear="none"><blockquote class="m_8392780780582619306yiv8018064329gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_8392780780582619306yiv8018064329yqt0581134612" id="m_8392780780582619306yiv8018064329yqt42637"><div><div style="color:#000;background-color:#fff;font-family:verdana,helvetica,sans-serif;font-size:16px"><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3785"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3864">Dear NCL users,</span></div><div dir="ltr" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3823"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">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 <br clear="none"></span></div><div dir="ltr" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3884"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">1-is there any relationship between the number of weights to choose and the cutoff frequencies?</span></div><div dir="ltr" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3929"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">2-is there any practical criterion to choose the number of weights? I know that this number influences the loss of data.</span></div><div dir="ltr" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4139"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">Below is my code:</span></div><div dir="ltr" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4147"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866"><br clear="none">------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ----------------</span></div><div dir="ltr" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3965"><span id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3866">;import the file<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4027" clear="none">gpcp=addfile("gpcp_Sahel.nc"," r")<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4028" clear="none">rr=gpcp->precip<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4029" clear="none">;filter parameters<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4030" clear="none">ihp=2 ;bandpass<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4031" clear="none">sigma=1.0 ; Lanczos sigma<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4032" clear="none">nWgt = 81 ; number of weights -> means 40 data lost at the beginning and 40 data lost at the end. <br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4033" clear="none">fca = 1./90. ; start freq ;highpass= 90 days<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4034" clear="none">fcb = 1./10. ; last freq; lowpass= 10 days<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4035" clear="none">wgt = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4036" clear="none">printVarSummary(wgt)<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4037" clear="none">xBPF = wgt_runave_n_Wrap ( rr, wgt, 0, 0) ; 10-90 day bp performed across time dimension(0) of rr (meaning the time dimension)<br id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4038" clear="none"></span></div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3786"><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4166"> ----------------------------- ------------------------------ ------------------------------ ------------------------------ ------------------------------ ----------------</div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4167"><br clear="none"></div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4168"><br clear="none"></div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4157"><br clear="none"></div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4158"><br clear="none"></div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4169"><br clear="none"></div><div id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_4170">Cheers,<br clear="none"></div></div><div class="m_8392780780582619306yiv8018064329m_-6632467413770190592signature" id="m_8392780780582619306yiv8018064329m_-6632467413770190592yui_3_16_0_ym19_1_1512489722799_3869"><br clear="none">GUIGMA</div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><br></div> </div> </div> </div></div></div></div></div></blockquote></div><br></div>