<div dir="ltr">Dear Guido<br><br>Thanks for the information. <br>Actually, I need to extract the data as ASCII or CSV file of the selected polygon box<br><br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio & Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<br></div><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, May 27, 2016 at 5:35 PM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@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 style="word-wrap:break-word">Dear Kunal,<div>I didn’t answer to the first email because I am not really familiar with <font face="Menlo">shapefile</font> and masking over nations boundaries, but I guess there is a lot of documentation on the website. Is your a polygon just an approximation because you don’t know how to mask using the shape file or is it really what you wanted to do?</div><div><br></div><div>In order to extract the data you can either create a new variable where you mask the region outside of the polygon or where you put all the data inside of the polygon. I would use the first approach, since what you get is a variable with the same dimensions, but maybe the second one is easier. Since you have two arrays with <font face="Menlo">lon</font>,<font face="Menlo">lat</font> coordinates can’t you just create a new variable, called <font face="Menlo">var2</font>, which is a subset of <font face="Menlo">var</font>? </div><div><br></div><div>Assuming that var has dimension <font face="Menlo">(time, lat, lon)</font> you can simply do that</div><div><br></div><div><font face="Menlo">var2=var(:,{lat},{lon})</font></div><div><font face="Menlo"><br></font></div><div>The <font face="Menlo">{}</font> means that you are using coordinate indexing, it should work also with array although I’m not 100% sure. With this method you will get a variable with different dimensions. Otherwise you can try to mask using logical staments. Assuming you have (<font face="Menlo">clon,clat)</font> coordinates in your file (I used different names because of your definition in the script) you can try something similar</div><div><br></div><div><font face="Menlo">var2=mask(var, lon.ge.min(clon) .AND. lon.le.max(clon) .AND. lat.ge.min(clat) .AND. lat.le.max(clat), False)</font></div><div><br></div><div>Cheers</div><div><br></div><div><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Guido Cioni</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://guidocioni.altervista.org" target="_blank">http://guidocioni.altervista.org</a> </div>
</div>
<br><div><blockquote type="cite"><div><div class="h5"><div>On 27 May 2016, at 12:31, Kunal Bali <<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><div><div>Dear NCL<br><br></div>I tried to make the polygon of the selected region. I don't know i did it correctly or not, please let me know is it correct way to do or not.<br><br></div>Second thig is that I need to extract the data from selected polygon. Could anyone please let me know how to do it ?<br><br><br><div><div>Regards<br clear="all"></div><div><div><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><br></div><div><div style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></div></div></div></div></div></div></div>
</div></div></div></div>
</div></div><span><polygon.ncl></span><span><polygon.png></span>_______________________________________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><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></div></blockquote></div><br></div></div></blockquote></div><br></div>