<div dir="ltr"><div>Dear NCL users<br><br></div>I tried previous mail scripts for converting ASCII to netcdf format , the file is generating but its without data points.Only variable names generating. <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 Tue, Sep 23, 2014 at 1:28 PM, Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi Kunal,<br>
<br>
the answer was given in an earlier mail:<br>
<br>
<tt>1. read the ASCII data variable, lat and lon<br>
2. create a output file: netcdf =
addfile("<a href="http://simple.nc" target="_blank">simple.nc</a>","c")</tt><tt><br>
</tt><tt>3. write your data variable to the output file: </tt><tt>ncdf->values
= values</tt><br>
<br>
<br>
Please read the 'output to netcdf' examples for more details:<br>
<a href="http://ncl.ucar.edu/Applications/o-netcdf.shtml" target="_blank">http://ncl.ucar.edu/Applications/o-netcdf.shtml</a><br>
<br>
Bye,<br>
Karin<br>
<br>
<div>Am 23.09.14 07:04, schrieb Kunal Bali:<br>
</div><div><div class="h5">
<blockquote type="cite">
<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,</span></p>
<p class="MsoNormal"><span style="color:#1f497d"> </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"></span></p>
<span>
<p class="MsoNormal"><span style="color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="color:#1f497d">Regards,</span></p>
<p class="MsoNormal"><span style="color:#1f497d">Yuqiang</span></p>
<p class="MsoNormal"><span style="color:#1f497d"> </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)</span></p>
<p class="MsoNormal"> </p>
</span>
<div>
<div>
<p class="MsoNormal">Dear NCL user </p>
</div>
<div>
<div>
<p class="MsoNormal">I tried this script from NCL
but still getting error </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>
</p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><br clear="all">
</p>
<div>
<div>
<div>
<p class="MsoNormal">Kunal Bali</p>
</div>
<div>
<p class="MsoNormal">Research Scholar </p>
</div>
<div>
<p class="MsoNormal">Radio & Atmospheric
Science Division </p>
</div>
<div>
<p class="MsoNormal">CSIR - National
Physical Laboratory</p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">New Delhi -
110012</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:9.0pt;font-family:"Tahoma","sans-serif""> </span></p>
</div>
</div>
</div>
<p class="MsoNormal"> </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:</p>
<div>
<div>
<p class="MsoNormal">Hi Kunal,</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Please, take a look at
the 'output netcdf' examples page,
method_1</p>
</div>
<div>
<p class="MsoNormal"> </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:</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">lat = data(:,0)</p>
</div>
<div>
<p class="MsoNormal">lat = data(:,1)</p>
</div>
<div>
<p class="MsoNormal">values= data(:,2)</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 </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></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></pre>
<pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values!0 = "lat"</span></pre>
<pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values!1 = "lon"</span></pre>
<pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values&lat = lat</span></pre>
<pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">values&lon = lon </span></pre>
<pre style="border:none;padding:0in;border-color:transparent"><span style="font-family:"UICTFontTextStyleBody","serif"">ncdf->values = values</span></pre>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Bye, Karin</p>
</div>
<div>
<div>
<p class="MsoNormal"> </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>>:</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</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
??</p>
</div>
<p class="MsoNormal">I have
data in 3 column ( Latitude
Longitude Values)</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></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b>So
is there any ways to convert
ASCII to netcdf format ???</b></p>
</div>
<p class="MsoNormal"><b>Thank You</b></p>
<div>
<div>
<div>
<p class="MsoNormal"><br clear="all">
</p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Kunal
Bali</p>
</div>
<div>
<p class="MsoNormal">Research
Scholar </p>
</div>
<div>
<p class="MsoNormal">Radio
&
Atmospheric
Science
Division </p>
</div>
<div>
<p class="MsoNormal">CSIR
- National
Physical
Laboratory</p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">New Delhi - 110012</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:9.0pt;font-family:"Tahoma","sans-serif""> </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></p>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
</div></div></div>
<br>_______________________________________________<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><br>
<br></blockquote></div><br></div>