<div dir="ltr"><div class="gmail_default" style="font-size:small">Kunal,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can use the gc_inout function, in which you give it a series of lat/lon pairs and a lat/lon polygon, and it returns True or False for each lat/lon pair, depending on whether it is inside or outside the polygon.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">You will need to turn your data's lat/lon locations into 1D arrays of lat/lon pairs for this to work.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've attached an example that shows how to do this for data that is rectilinear (i.e. you have lat / lon coordinate arrays attached to the data variable).</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This example writes the new data values to a file called "file.txt" and it also creates some plots of the original data and masked data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I will likely turn this example into a new one on the "Masking" example page:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/mask.shtml">http://www.ncl.ucar.edu/Applications/mask.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 7, 2017 at 12:01 AM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@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>Dear NCL users,<br><br></div>I need to extract the data from the given box in 3 columns (lat, lon, values)<br><br><div><div>could anyone please provide some information on that?<br></div><div><br></div><div>the black box coordinates are as<br><br> lonv = (/77.98,77.96,79.01,80.02,80.<wbr>01,79.64,79.63,79.01,77.98/)<br> <br> latv = (/31.00,29.70,29.15,28.82,30.<wbr>05,30.01,30.61,30.64,31.00/)<br><br></div><div>Thank You<br></div><div><br><img src="cid:ii_izz6kr2h0_15aa78b3c6431cc0" style="margin-right:0px" height="200" width="200"><br><br><br></div><div>Regards<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><div><div><div class="m_-8007418046318825859gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:tahoma,verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
</div></font></span></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>