[ncl-talk] query ( CONVERSION ASCII TO NetCDF)

Yuqiang Zhang yuqiangzhang.thu at gmail.com
Mon Sep 22 08:05:53 MDT 2014


Hi Kunal,

 

In line 30, “ncl 30> TotCH4_A = data(:,2) “. You variable “TotCH4_A” is only assigned one dimension’s value, so you can’t assign two dimension through line 33 & 34. 

 

Regards,

Yuqiang

 

From: ncl-talk-bounces at ucar.edu [mailto:ncl-talk-bounces at ucar.edu] On Behalf Of Kunal Bali
Sent: Monday, September 22, 2014 8:53 AM
To: Karin Meier-Fleischer
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] query ( CONVERSION ASCII TO NetCDF)

 

Dear NCL user 

I tried this script from NCL but still getting error 


ncl 28> Longitude = data(:,1)
ncl 29> Latitude = data(:,0)  
ncl 30> TotCH4_A = data(:,2)  
ncl 31> ncdf = addfile("/home/kunal/simple1.nc","c")
ncl 32> filedimdef(ncdf,"time",-1,True)              
ncl 33> TotCH4_A!0 = "Latitude"
ncl 34> TotCH4_A!1 = "Longitude"
fatal:Variable (TotCH4_A) has (1) dimensions can not write to dimension (1)
fatal:["Execute.c":8565]:Execute: Error occurred at or near line 34







Kunal Bali

Research Scholar 

Radio & Atmospheric Science Division 

CSIR - National Physical Laboratory

New Delhi - 110012

 

 

 

 

 

On Mon, Sep 22, 2014 at 5:32 PM, Karin Meier-Fleischer <meier-fleischer at dkrz.de> wrote:

Hi Kunal,

 

Please, take a look at the 'output netcdf' examples page, method_1

 

http://ncl.ucar.edu/Applications/method_1.shtml

Try this:

 

 

lat = data(:,0)

lat = data(:,1)

values= data(:,2)

 <http://ncl.ucar.edu/Document/Functions/Built-in/system.shtml> system("/bin/rm -f simple.nc") ; remove any pre-existing file 

ncdf = addfile("simple.nc" ,"c") ; output netCDF file
 <http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml> filedimdef(ncdf,"time",-1,True) ; recommended
values!0 = "lat"
values!1 = "lon"
values&lat = lat
values&lon = lon 
ncdf->values = values

 

Bye, Karin

 


Am 22.09.2014 um 11:40 schrieb Kunal Bali <kunal.bali9 at gmail.com>:

Dear NCL users

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 ??

I have data in 3 column ( Latitude Longitude Values)

More Detail

Variable: data
Type: float
Total Size: 777600 bytes
            194400 values
Number of Dimensions: 2
Dimensions and sizes:    [64800] x [3]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    9.96921e+36



So is there any ways to convert ASCII to netcdf format ???

Thank You




Kunal Bali

Research Scholar 

Radio & Atmospheric Science Division 

CSIR - National Physical Laboratory

New Delhi - 110012

 

 

 

 

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140922/7d20f4b2/attachment.html 


More information about the ncl-talk mailing list