<div dir="ltr"><div class="gmail_default" style="font-size:small">Lili,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the future, please do not post questions to individual developers when you don't get a response on ncl-talk. It's okay to repost to ncl-talk after a few days, because we generally try to answer all questions.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You will need to loop through your array and get the start and end index of each consecutive sequence of numbers, and then use NCL's minind function to get the index of the minimum of this subset, "i = minind(x(beg_index:end_index)". There may be a "cleaner" way to do this, but this script should work.</div><div class="gmail_default" style="font-size:small">
<p class="">See attached script which uses a slightly more complex input array.</p><p class="">--Mary</p></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 20, 2014 at 12:55 AM, Verena Lili <span dir="ltr"><<a href="mailto:verena.prick@gmail.com" target="_blank">verena.prick@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 dir="ltr"><div><div><div>Hi Mary,<br><br></div>I posted this email to ncl talk (see below) and not getting any response since then. Would you please help me on this simple issue?<br></div>I've been struggling to figure this out, but not yet get a conclusive<br>result<br><br></div>thank you<br><br><br><div><div><div><div><div class="gmail_quote">=======================<br>Subject: how to get min index within different sequences<br>To: "<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>" <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><div><div class="h5"><br><br><br><div dir="ltr"><div><div><div>Hallo,<br><br></div>Anyone can suggest how to get the index of the minimum values within different<br></div>sequences:<br><br>e.g.:<br><br></div> x = (/-3, -2, -1, 4, 5, 6, 0, -2, 5/)<br><br> x@_FillValue=-999 <br> x = where(x.gt.3,x, x@_FillValue) ; only x>3<br><div> print(x)<br><br>Variable: x<br>(0) -999<br>(1) -999<br>(2) -999<br>(3) 4<br>(4) 5<br>(5) 6<br>(6) -999<br>(7) -999<br>(8) 5<br><br></div><div>; then, how to get <b>index</b> pointing the minimum value within these two sequences (3)-(5) and (8),<br>so that the out put will be index:<br><br></div><div><b>3 and 8</b><br><br></div><div>Thank you.<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><br clear="all"></div><div><div><div><div><div><br>-- <br><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Regards,</div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Dr. Verena.</div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><font face="verdana, sans-serif">School of Marine and Atmospheric Sciences<br>Stony Brook University</font><div><span style="font-family:verdana,sans-serif">homepage: </span><a href="http://www.somas.stonybrook.edu/" target="_blank">http://www.somas.stonybrook.edu/</a></div></div></div>
</div></div></div></div></div></font></span></div>
</div></div></div><div><div class="h5"><br><br clear="all"><br>-- <br><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Regards,</div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Dr. Verena.</div><div style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><font face="verdana, sans-serif">School of Marine and Atmospheric Sciences<br>Stony Brook University</font><div><span style="font-family:verdana,sans-serif">homepage: </span><a href="http://www.somas.stonybrook.edu/" target="_blank">http://www.somas.stonybrook.edu/</a></div></div></div>
</div></div></div></div></div></div></div>
</blockquote></div><br></div></div>