<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""></div><div class=""><div class=""><br class=""></div><div class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline">Guido Cioni</div><div class=""><a href="http://guidocioni.altervista.org" class="">http://guidocioni.altervista.org</a>&nbsp;</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline"></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Il giorno 27 mag 2016, alle ore 17:51, Kunal Bali &lt;<a href="mailto:kunal.bali9@gmail.com" class="">kunal.bali9@gmail.com</a>&gt; ha scritto:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">I am not getting it exactly how to do this one. <br class=""></div>Could any one please help me out to do this. <br class=""></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Kunal Bali<br class=""></div><div class="">Research Scholar <br class=""></div><div class="">Radio &amp; Atmospheric Science Division <br class=""></div><div class="">CSIR - National Physical Laboratory<br class=""></div><div class="">New Delhi - 110012<br class=""></div><div class="">India<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; border-collapse: collapse; font-family: Tahoma, Verdana; font-size: 12px;" class=""><font color="#1F497D" class=""><br class=""></font></div></div></div></div></div></div></div>
<br class=""><div class="gmail_quote">On Fri, May 27, 2016 at 6:12 PM, Guido Cioni <span dir="ltr" class="">&lt;<a href="mailto:guidocioni@gmail.com" target="_blank" class="">guidocioni@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Once you have the correct variable you can write it to an CSV file by using the write table function.<div class=""><br class=""></div><div class=""><div style="line-height:normal;background-color:rgb(255,255,255)" class=""><font face="Menlo" color="#222222" class=""><span style="font-size:12.8px" class="">&nbsp;alist=[/clon,</span>clat<span style="font-size:12.8px" class="">,</span></font><font color="#222222" class=""><span style="font-size:12.8px" class=""></span></font><span style="color:rgb(34,34,34);font-family:Menlo;font-size:12.8px" class="">var2/]</span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;line-height:normal;background-color:rgb(255,255,255)" class=""><span style="font-family:Menlo;font-size:12.8px" class="">&nbsp;</span><span style="font-family:Menlo;font-size:12.8px" class="">write_table</span><span style="font-family:Menlo;font-size:12.8px" class="">(“file.csv”,"w",</span><span style="font-family:Menlo;font-size:12.8px" class="">alist,”%f,%f,%f,%f")</span></div><span class="HOEnZb"><font color="#888888" class=""><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;line-height:normal;background-color:rgb(255,255,255)" class=""><div style="word-wrap: break-word;" class=""><div style="font-family:Helvetica;font-size:14px;word-wrap:break-word" class=""></div></div></div><div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class="">Guido Cioni</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="http://guidocioni.altervista.org/" target="_blank" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div></font></span><div class=""><div class="h5">
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On 27 May 2016, at 14:24, Kunal Bali &lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank" class="">kunal.bali9@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" class="">Dear Guido<br class=""><br class="">Thanks for the information. <br class="">Actually, I need to extract the data as ASCII or CSV file of the selected polygon box<br class=""><br class=""><br class=""></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div data-smartmail="gmail_signature" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Kunal Bali<br class=""></div><div class="">Research Scholar <br class=""></div><div class="">Radio &amp; Atmospheric Science Division <br class=""></div><div class="">CSIR - National Physical Laboratory<br class=""></div><div class="">New Delhi - 110012<br class=""></div><div class="">India<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px" class=""><font color="#1F497D" class=""><br class=""></font></div></div></div></div></div></div></div>
<br class=""><div class="gmail_quote">On Fri, May 27, 2016 at 5:35 PM, Guido Cioni <span dir="ltr" class="">&lt;<a href="mailto:guidocioni@gmail.com" target="_blank" class="">guidocioni@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Dear Kunal,<div class="">I didn’t answer to the first email because I am not really familiar with <font face="Menlo" class="">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 class=""><br class=""></div><div class="">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" class="">lon</font>,<font face="Menlo" class="">lat</font> coordinates can’t you just create a new variable, called <font face="Menlo" class="">var2</font>, which is a subset of <font face="Menlo" class="">var</font>?&nbsp;</div><div class=""><br class=""></div><div class="">Assuming that var has dimension <font face="Menlo" class="">(time, lat, lon)</font> you can simply do that</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">var2=var(:,{lat},{lon})</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">The <font face="Menlo" class="">{}</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" class="">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 class=""><br class=""></div><div class=""><font face="Menlo" class="">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 class=""><br class=""></div><div class="">Cheers</div><div class=""><br class=""></div><div class=""><div class="">
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class="">Guido Cioni</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="http://guidocioni.altervista.org/" target="_blank" class="">http://guidocioni.altervista.org</a>&nbsp;</div>

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class=""><div class="">On 27 May 2016, at 12:31, Kunal Bali &lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank" class="">kunal.bali9@gmail.com</a>&gt; wrote:</div><br class=""></div></div><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">Dear NCL<br class=""><br class=""></div>I tried to make the&nbsp; 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 class=""><br class=""></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 class=""><br class=""><br class=""><div class=""><div class="">Regards<br clear="all" class=""></div><div class=""><div class=""><div class=""><div data-smartmail="gmail_signature" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Kunal Bali<br class=""></div><br class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px" class=""><font color="#1F497D" class=""><br class=""></font></div></div></div></div></div></div></div>
</div></div></div></div>
</div></div><span class="">&lt;polygon.ncl&gt;</span><span class="">&lt;polygon.png&gt;</span>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div>
<span id="cid:070721BD-FA50-4DAC-8FF6-34293648DB18@fritz.box">&lt;FRP.nc&gt;</span></div></blockquote></div><br class=""></div></body></html>