<p dir="ltr">Sorry I had no time today, I will take a look at that tomorrow. </p>
<div class="gmail_quote">Il 27 mag 2016 7:21 PM, "Kunal Bali" <<a href="mailto:kunal.bali9@gmail.com">kunal.bali9@gmail.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Dear Guido<br><br></div><br></div>The ASCII output from this script is not showing the whole data of the selected box and the values are also repeating in the ASCII file. <br><br></div>Anyways, Thank You so much for your time. I appreciate that.<br><br></div>Thank You<br><div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div 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 10:19 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>attached you find the resulting script. First I subsetted the var over the domain that you specified (the one that is used to plot the polygon) and obtain var2. Then I did some trick to get the <font face="Menlo">lat/lon</font> coordinates printed in the CSV file. </div><div><br></div><div></div></div><br><div style="word-wrap:break-word"><div></div><div><div><br></div><div><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div><br>Guido Cioni</div><div><a href="http://guidocioni.altervista.org" target="_blank">http://guidocioni.altervista.org</a> </div><div><br></div></div><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:14px;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></div>
</div>
<br><div><blockquote type="cite"><div>Il giorno 27 mag 2016, alle ore 17:51, Kunal Bali <<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>> ha scritto:</div><br><div><div dir="ltr"><div>I am not getting it exactly how to do this one. <br></div>Could any one please help me out to do this. <br></div><div class="gmail_extra"><br clear="all"><div><div 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><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>
<br><div class="gmail_quote">On Fri, May 27, 2016 at 6:12 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">Once you have the correct variable you can write it to an CSV file by using the write table function.<div><br></div><div><div style="line-height:normal;background-color:rgb(255,255,255)"><font face="Menlo" color="#222222"><span style="font-size:12.8px"> alist=[/clon,</span>clat<span style="font-size:12.8px">,</span></font><font color="#222222"><span style="font-size:12.8px"></span></font><span style="color:rgb(34,34,34);font-family:Menlo;font-size:12.8px">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)"><span style="font-family:Menlo;font-size:12.8px"> </span><span style="font-family:Menlo;font-size:12.8px">write_table</span><span style="font-family:Menlo;font-size:12.8px">(“file.csv”,"w",</span><span style="font-family:Menlo;font-size:12.8px">alist,”%f,%f,%f,%f")</span></div><span><font color="#888888"><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)"><div style="word-wrap:break-word"><div style="font-family:Helvetica;font-size:14px;word-wrap:break-word"></div></div></div><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"><br>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"><a href="http://guidocioni.altervista.org/" target="_blank">http://guidocioni.altervista.org</a> </div>
</div></font></span><div><div>
<br><div><blockquote type="cite"><div>On 27 May 2016, at 14:24, Kunal Bali <<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>> wrote:</div><br><div><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 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><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>
<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="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"><br>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"><a href="http://guidocioni.altervista.org/" target="_blank">http://guidocioni.altervista.org</a> </div>
</div>
<br><div><blockquote type="cite"><div><div><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><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>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>
<span><FRP.nc></span></div></blockquote></div><br></div></div><br></blockquote></div><br></div>
</blockquote></div>