<div dir="ltr"><div><div><div><div><div><div><div><div>Sorry, I'm I am not looking at any code.<br></div><div><br></div> tcrit = 30.<br><br></div> f = addfile(...)<br></div> T = f->T ; (time,lat,lon)<br><br><br>[1] "setting
values below the threshold to _FillValue" is simple.<br><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml</a><br><br></div> Tcrit = where(T.ge.tcrit, T, T@_FillValue)<br></div> copy_VarMeta(T, Tcrit)<br>===========<br></div><div>[2] You do not need to do [1]<br><br></div><div>Maybe you could use the following function:<br><br></div><div>=========<br><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_numrun_n.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_numrun_n.shtml</a><br></div><b>***Look at the examples***</b><br>=========<br><br></div> T10= where(T.ge.tcrit,1, 0) <br></div><div> T10@long_name = "Exceed=1; No=0"<br></div> copy_VarCoords(T, T10)<br></div> printVarSummary(T10)<br><div><div><pre> r0 = <strong>dim_numrun_n</strong> (T10, <b>0</b>, 0) ; (ntim,nlat,mlon)
r1 = <strong>dim_numrun_n</strong> (T10, <b>1</b>, 0)
<br> copy_VarCoords(T, r0)<br> copy_VarCoords(T, r1)<br><br></pre><pre>;---Pick one grid point to see what is happening<br><br></pre><pre> LAT = ..<br> LON = ..<br> print(T(:,{LAT},{LON})+" "+Tcrit(:,{LAT},{LON})+" "+T10(:,{LAT},{LON}) \<br> +" "r0(:,{LAT},{LON})+" "+r1(:,{LAT},{LON})</pre><div><div> <br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 23, 2018 at 3:29 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="font-family:verdana,helvetica,sans-serif;font-size:16px"><div style="font-family:verdana,helvetica,sans-serif;font-size:16px"><div style="font-family:verdana,helvetica,sans-serif;font-size:16px"><div><div>Dear NCL users,</div><div>I have 3D (time,lat,lon) array of
temperature from which I would like to keep only sequences (consecutive
days) exceeding a certain threshold. This consist concretely in setting
values below the threshold to _FillValue. The length of sequence is
set to 4. So far, have been able to set to _FillValu only individual
days that exceed the threshold. Then I would be pleased if you could
provide me with a method to also set to _FillValue values that are not
into sequences of at least 04 days.</div><div><br></div><div>Please find attached my data and my code.<br></div><div><br></div>Regards<div><br></div><div><br></div><div class="m_7026875322926614417ydp786f0203signature">-----------------------------<br>GUIGMA</div></div></div></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>