<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Thanks for the help so far, Barry.
<div><br>
</div>
<div>Does anyone else have any ideas on how to resolve this?</div>
<div><br>
</div>
<div>Thanks</div>
<div>Ty<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF979281" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Barry Lynn [barry.h.lynn@gmail.com]<br>
<b>Sent:</b> 13 September 2018 16:03<br>
<b>To:</b> Ty Buckingham<br>
<b>Subject:</b> Re: [ncl-talk] Getting the grid point values of certain values in a masked array<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Ty:
<div><br>
</div>
<div>Please (always) send to NCL-Talk.  I need to go and I won't be able to respond right now.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Sep 13, 2018 at 4:38 PM Ty Buckingham <<a href="mailto:ty.buckingham@manchester.ac.uk" target="_blank" rel="noopener noreferrer">ty.buckingham@manchester.ac.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">This where statement: </div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"> 
<div><span style="font-family:Menlo; font-size:11px; background-color:rgb(255,255,255)">  avo_masked  = where(avo_zoom.gt.0.006,1,avo_zoom@_FillValue)</span></div>
<div><span style="font-family:Menlo; font-size:11px; background-color:rgb(255,255,255)"><br>
</span></div>
<div><span style="background-color:rgb(255,255,255)"><font size="2">Is working just fine. I've attached a snippet of what the output from this looks like (it's over 58,000 values so I haven't printed them all). What I'd like to do next is to disregard all of
 the co-ordinates equal to 9.96921e+36 and just keep the coordinates for the values that equal 1. For example, from the snippet I'd like the co-ordinates (387,37-39) and none of the others. This where statement:</font></span></div>
<div><span style="background-color:rgb(255,255,255)"><font size="2"><br>
</font></span></div>
<div><span style="background-color:rgb(255,255,255)"><font size="2">  </font></span><span style="font-family:Menlo; font-size:11px; background-color:rgb(255,255,255)"> avo_gridpts = where(avo_masked.eq.1,avo_masked,0)</span></div>
<div><span style="font-family:Menlo; font-size:11px; background-color:rgb(255,255,255)"><br>
</span></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)">Gives me the same result as the first where statement. </span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)"><br>
</span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)">To try and explain it visually - I'm using vorticity (avo in the script) as a proxy for the location of a cold front in my data. I then want all of the coordinates for where avo is 1 so i can
 have a list of coordinates that refer to the location of my cold front.</span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)"><br>
</span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)">Thanks</span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)">Ty</span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)"><br>
</span></font></div>
<div><font size="2"><span style="background-color:rgb(255,255,255)"><br>
</span></font></div>
<div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div id="m_-9190439371195195708divRpF99979" style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Barry Lynn [<a href="mailto:barry.h.lynn@gmail.com" target="_blank" rel="noopener noreferrer">barry.h.lynn@gmail.com</a>]<br>
<b>Sent:</b> 13 September 2018 14:21<br>
<b>To:</b> Ty Buckingham<br>
<b>Cc:</b> ncl-talk<br>
<b>Subject:</b> Re: [ncl-talk] Getting the grid point values of certain values in a masked array<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi:
<div><br>
</div>
<div>But you haven't explained why the where statement is not working for. </div>
<div><br>
</div>
<div>Can you print out the values that go into the where statement and  result from the where statement and send a sample.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Sep 13, 2018 at 4:18 PM Ty Buckingham <<a href="mailto:ty.buckingham@manchester.ac.uk" rel="noopener noreferrer" target="_blank">ty.buckingham@manchester.ac.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">I have the coordinates for all of the values - including both the masked and filled values. 
<div><br>
</div>
<div>What I want is to isolate all the coordinates where the value = 1 and save these coordinates as a 1D array and ignore all the coordinates where the value =/= 1. </div>
<div><br>
</div>
<div>Ty</div>
<div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div id="m_-9190439371195195708m_591655923805250467divRpF759433" style="direction:ltr">
<font face="Tahoma" size="2" color="#000000"><b>From:</b> Barry Lynn [<a href="mailto:barry.h.lynn@gmail.com" rel="noopener noreferrer" target="_blank">barry.h.lynn@gmail.com</a>]<br>
<b>Sent:</b> 13 September 2018 14:15<br>
<b>To:</b> Ty Buckingham<br>
<b>Cc:</b> ncl-talk<br>
<b>Subject:</b> Re: [ncl-talk] Getting the grid point values of certain values in a masked array<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi:
<div><br>
</div>
<div>When you extract the data, you should check and see what the coordinates are.</div>
<div><br>
</div>
<div>If there are none, they can be added.</div>
<div><br>
</div>
<div>Barry</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Sep 13, 2018 at 3:18 PM Ty Buckingham <<a href="mailto:ty.buckingham@manchester.ac.uk" rel="noopener noreferrer" target="_blank">ty.buckingham@manchester.ac.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Yes, there's no problem with the data itself, I'm just not sure how to extract values that equal 1 into a new array so they keep their lat/lon values.
<div><br>
</div>
<div>Thanks</div>
<div>Ty<br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div id="m_-9190439371195195708m_591655923805250467m_4018091804752849522divRpF908109" style="direction:ltr">
<font face="Tahoma" size="2" color="#000000"><b>From:</b> Barry Lynn [<a href="mailto:barry.h.lynn@gmail.com" rel="noopener noreferrer" target="_blank">barry.h.lynn@gmail.com</a>]<br>
<b>Sent:</b> 13 September 2018 12:44<br>
<b>To:</b> Ty Buckingham; ncl-talk<br>
<b>Subject:</b> Re: [ncl-talk] Getting the grid point values of certain values in a masked array<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi:
<div><br>
</div>
<div>Have you tried using PrintMinMAX(Variable, False) to see the range of your data?</div>
<div><br>
</div>
<div>Barry</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Sep 13, 2018 at 1:53 PM Ty Buckingham <<a href="mailto:ty.buckingham@manchester.ac.uk" rel="noopener noreferrer" target="_blank">ty.buckingham@manchester.ac.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">I'm not entirely sure of the syntax. If I try something like:
<div><br>
</div>
<div>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span>  avo_masked  = where(avo_zoom.gt.0.006,1,avo_zoom@_FillValue)</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
</p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<span>  avo_gridpts = where(avo_masked.eq.1,avo_masked,0)</span></p>
<p style="margin-right:0px; margin-left:0px; font-size:11px; line-height:normal; font-family:Menlo; background-color:rgb(255,255,255)">
<br>
</p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2">I still get all of the false values and their corresponding grid points, when I only want avo_gridpts to contain the values equal to 1 and their corresponding grid point values.</font></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2"><br>
</font></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2">Thanks</font></p>
<p style="margin-right:0px; margin-left:0px; line-height:normal; background-color:rgb(255,255,255)">
<font size="2">Ty</font></p>
<div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div id="m_-9190439371195195708m_591655923805250467m_4018091804752849522m_1216321998368030659divRpF145979" style="direction:ltr">
<font face="Tahoma" size="2" color="#000000"><b>From:</b> Barry Lynn [<a href="mailto:barry.h.lynn@gmail.com" rel="noopener noreferrer" target="_blank">barry.h.lynn@gmail.com</a>]<br>
<b>Sent:</b> 13 September 2018 10:50<br>
<b>To:</b> Ty Buckingham<br>
<b>Subject:</b> Re: [ncl-talk] Getting the grid point values of certain values in a masked array<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi:
<div><br>
</div>
<div>There should be.  If you want to find only those values, then set the middle part of your where statement equal to that. </div>
<div><br>
</div>
<div>However, unless  the values are exact you might have a problem finding them.  Then, you might multiply by 1000 and then include the integer function.</div>
<div><br>
</div>
<div>Barry</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Sep 13, 2018 at 12:46 PM Ty Buckingham <<a href="mailto:ty.buckingham@manchester.ac.uk" rel="noopener noreferrer" target="_blank">ty.buckingham@manchester.ac.uk</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Hi Barry,<br>
<br>
It is indeed. Is there anyway to extract the grid points of all the values equal to 0.006 and ignore the rest?<br>
<br>
Thanks<br>
Ty<br>
________________________________________<br>
From: Barry Lynn [<a href="mailto:barry.h.lynn@gmail.com" rel="noopener noreferrer" target="_blank">barry.h.lynn@gmail.com</a>]<br>
Sent: 13 September 2018 06:00<br>
To: Ty Buckingham<br>
Cc: ncl-talk<br>
Subject: Re: [ncl-talk] Getting the grid point values of certain values in a masked array<br>
<br>
Hi:<br>
<br>
The where statement:<br>
<br>
<br>
avo_masked  = where(avo_zoom.gt.0.006,0.006,avo_zoom@_FillValue)<br>
<br>
<br>
will set every grid with a value of 0.006 or greater equal to 0.006.<br>
<br>
<br>
Is that what you wanted to do?<br>
<br>
<br>
Barry<br>
<br>
On Thu, Sep 13, 2018 at 12:18 AM Ty Buckingham <<a href="mailto:ty.buckingham@manchester.ac.uk" rel="noopener noreferrer" target="_blank">ty.buckingham@manchester.ac.uk</a><mailto:<a href="mailto:ty.buckingham@manchester.ac.uk" rel="noopener noreferrer" target="_blank">ty.buckingham@manchester.ac.uk</a>>>
 wrote:<br>
Hi all,<br>
<br>
I have a masked array and wish to get the grid points (or lat/lons) of all of the values that are above a certain threshold. I've been messing around with 'where' and 'if' statements but can't quite get it.<br>
<br>
I've attached my script.<br>
<br>
Any help?<br>
<br>
Thanks in advance!<br>
Ty<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" rel="noopener noreferrer" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" rel="noopener noreferrer" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
<br>
<br>
--<br>
Barry H. Lynn, Ph.D<br>
Senior Associate Scientist, Lecturer,<br>
The Institute of the Earth Science,<br>
The Hebrew University of Jerusalem,<br>
Givat Ram, Jerusalem 91904, Israel<br>
Tel: 972 547 231 170<br>
Fax: (972)-25662581<br>
<br>
C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" rel="noreferrer" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="m_-9190439371195195708m_591655923805250467m_4018091804752849522m_1216321998368030659gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Barry H. Lynn, Ph.D
<div>
<div>Senior Associate Scientist, Lecturer,</div>
<div>
<div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)">
</div>
<span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div>
</div>
<div><span style="color:rgb(136,136,136)"><br>
</span></div>
<div>C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" rel="noopener noreferrer" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="m_-9190439371195195708m_591655923805250467m_4018091804752849522gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Barry H. Lynn, Ph.D
<div>
<div>Senior Associate Scientist, Lecturer,</div>
<div>
<div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)">
</div>
<span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div>
</div>
<div><span style="color:rgb(136,136,136)"><br>
</span></div>
<div>C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" rel="noopener noreferrer" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="m_-9190439371195195708m_591655923805250467gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Barry H. Lynn, Ph.D
<div>
<div>Senior Associate Scientist, Lecturer,</div>
<div>
<div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)">
</div>
<span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div>
</div>
<div><span style="color:rgb(136,136,136)"><br>
</span></div>
<div>C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" rel="noopener noreferrer" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="m_-9190439371195195708gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Barry H. Lynn, Ph.D
<div>
<div>Senior Associate Scientist, Lecturer,</div>
<div>
<div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)">
</div>
<span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div>
</div>
<div><span style="color:rgb(136,136,136)"><br>
</span></div>
<div>C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" rel="noopener noreferrer" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Barry H. Lynn, Ph.D
<div>
<div>Senior Associate Scientist, Lecturer,</div>
<div>
<div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)">
</div>
<span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div>
</div>
<div><span style="color:rgb(136,136,136)"><br>
</span></div>
<div>C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" target="_blank" rel="noopener noreferrer">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>