<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Dennis,</p>
<p>I need the index values of the closest 9 single pixels.&nbsp;</p>
<p>Your codes are&nbsp;very helpful.<br>
</p>
<p>Thanks very much Dennis.<br>
</p>
<p>Yun<br>
</p>
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Dennis Shea &lt;shea@ucar.edu&gt;<br>
<b>Sent:</b> Monday, May 11, 2015 16:26<br>
<b>To:</b> Yun Yue<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Find the nearest 9 points of a station</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">
<div>
<div>
<div>The index values of the closest single ?swath or grid? pt is given by:<br>
<br>
<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a><br>
<br>
</div>
====================<br>
<br>
</div>
<div>Attached is a slightly mangled function which I modified for your purpose...
<br>
</div>
<div>It is UNTESTED . Look at the code. Fix if necessary.<br>
<br>
<br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, May 11, 2015 at 1:05 PM, Yun Yue <span dir="ltr">
&lt;<a href="mailto:yunyue@huskers.unl.edu" target="_blank">yunyue@huskers.unl.edu</a>&gt;</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 style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi &nbsp;NCL users,<br>
</p>
<p>Say I have a station's lat and lon, I also have MODIS data. In order&nbsp;to find the nearest 9&nbsp;pixels'&nbsp;index to&nbsp;this station,&nbsp;I could calculate distance between every pixel and the station, then find the nearest 9 pixels.<br>
</p>
<p>Is there any NCL&nbsp;function&nbsp;to find 9 pixels' index in a faster way?<br>
</p>
<p>Thank you very much.<span class="HOEnZb"><font color="#888888"><br>
</font></span></p>
<span class="HOEnZb"><font color="#888888">
<p>Yun<br>
</p>
</font></span></div>
</div>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>