<div dir="ltr"><div>Dear NCL users<br><br></div>I am still not getting how to do the conversion from ASCII to netcdf ??<br></div><div class="gmail_extra"><br clear="all"><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><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>
<br><div class="gmail_quote">On Mon, Sep 22, 2014 at 7:35 PM, Yuqiang Zhang <span dir="ltr"><<a href="mailto:yuqiangzhang.thu@gmail.com" target="_blank">yuqiangzhang.thu@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 link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="color:#1f497d">Hi Kunal,<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">In line 30, “</span><b>ncl 30> TotCH4_A = data(:,2)</b> “. You variable “TotCH4_A” is only assigned one dimension’s value, so you can’t assign two dimension through line 33 & 34. <span style="color:#1f497d"><u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">Regards,<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">Yuqiang<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>] <b>On Behalf Of </b>Kunal Bali<br><b>Sent:</b> Monday, September 22, 2014 8:53 AM<br><b>To:</b> Karin Meier-Fleischer<br><b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br><b>Subject:</b> Re: [ncl-talk] query ( CONVERSION ASCII TO NetCDF)<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></span><div><div><p class="MsoNormal">Dear NCL user <u></u><u></u></p></div><div><div class="h5"><p class="MsoNormal">I tried this script from NCL but still getting error <u></u><u></u></p><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>ncl 28> Longitude = data(:,1)<br>ncl 29> Latitude = data(:,0) <br>ncl 30> TotCH4_A = data(:,2) <br>ncl 31> ncdf = addfile("/home/kunal/<a href="http://simple1.nc" target="_blank">simple1.nc</a>","c")<br>ncl 32> filedimdef(ncdf,"time",-1,True) <br>ncl 33> TotCH4_A!0 = "Latitude"<br>ncl 34> TotCH4_A!1 = "Longitude"<br><b>fatal:Variable (TotCH4_A) has (1) dimensions can not write to dimension (1)<br>fatal:["Execute.c":8565]:Execute: Error occurred at or near line 34<br></b><br><br><u></u><u></u></p></div></div></div></div></div><div><div class="h5"><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><p class="MsoNormal">Kunal Bali<u></u><u></u></p></div><div><p class="MsoNormal">Research Scholar <u></u><u></u></p></div><div><p class="MsoNormal">Radio & Atmospheric Science Division <u></u><u></u></p></div><div><p class="MsoNormal">CSIR - National Physical Laboratory<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">New Delhi - 110012<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:9.0pt;font-family:"Tahoma","sans-serif""><u></u> <u></u></span></p></div></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Mon, Sep 22, 2014 at 5:32 PM, Karin Meier-Fleischer <<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>> wrote:<u></u><u></u></p><div><div><p class="MsoNormal">Hi Kunal,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Please, take a look at the 'output netcdf' examples page, method_1<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><a href="http://ncl.ucar.edu/Applications/method_1.shtml" target="_blank">http://ncl.ucar.edu/Applications/method_1.shtml</a><br><br>Try this:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">lat = data(:,0)<u></u><u></u></p></div><div><p class="MsoNormal">lat = data(:,1)<u></u><u></u></p></div><div><p class="MsoNormal">values= data(:,2)<u></u><u></u></p></div><div><p class="MsoNormal"><a href="http://ncl.ucar.edu/Document/Functions/Built-in/system.shtml" target="_blank"><span style="text-decoration:none">system</span></a>("/bin/rm -f <a href="http://simple.nc" target="_blank">simple.nc</a>") ; remove any pre-existing file <u></u><u></u></p></div><div><div style="border:solid windowtext 1.0pt;border-bottom:solid windowtext 6.0pt;padding:0in 0in 0in 0in"><pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">ncdf = addfile("<a href="http://simple.nc" target="_blank">simple.nc</a>" ,"c") ; output netCDF file</span><u></u><u></u></pre><pre style="border:none;padding:0in;border-color:transparent"><a href="http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml" target="_blank"><span style="font-family:"UICTFontTextStyleBody","serif";text-decoration:none">filedimdef</span></a><span style="font-family:"UICTFontTextStyleBody","serif"">(ncdf,"time",-1,True) ; recommended</span><u></u><u></u></pre><pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values!0 = "lat"</span><u></u><u></u></pre><pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values!1 = "lon"</span><u></u><u></u></pre><pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values&lat = lat</span><u></u><u></u></pre><pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values&lon = lon </span><u></u><u></u></pre><pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">ncdf->values = values</span><u></u><u></u></pre></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Bye, Karin<u></u><u></u></p></div><div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>Am 22.09.2014 um 11:40 schrieb Kunal Bali <<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>>:<u></u><u></u></p></div><div><div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><div><div><div><div><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Dear NCL users<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">I want to convert ASCII to .nc file format. Could any one please provides me the link for this query or give any detail about this ??<u></u><u></u></p></div><p class="MsoNormal">I have data in 3 column ( Latitude Longitude Values)<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">More Detail<br><br><b>Variable: data<br>Type: float<br>Total Size: 777600 bytes<br> 194400 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [64800] x [3]<br>Coordinates: <br>Number Of Attributes: 1<br> _FillValue : 9.96921e+36<br><br></b><u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><b>So is there any ways to convert ASCII to netcdf format ???</b><u></u><u></u></p></div><p class="MsoNormal"><b>Thank You</b><u></u><u></u></p><div><div><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><div><div><div><div><p class="MsoNormal">Kunal Bali<u></u><u></u></p></div><div><p class="MsoNormal">Research Scholar <u></u><u></u></p></div><div><p class="MsoNormal">Radio & Atmospheric Science Division <u></u><u></u></p></div><div><p class="MsoNormal">CSIR - National Physical Laboratory<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">New Delhi - 110012<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:9.0pt;font-family:"Tahoma","sans-serif""><u></u> <u></u></span></p></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><div><p class="MsoNormal">_______________________________________________<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><u></u><u></u></p></div></blockquote></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div>