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

Kunal Bali kunal.bali9 at gmail.com
Mon Sep 22 23:04:15 MDT 2014


Dear NCL users

I am still not getting how to do the conversion from ASCII to netcdf ??

Kunal Bali
Research Scholar
Radio & Atmospheric Science Division
CSIR - National Physical Laboratory
New Delhi - 110012






On Mon, Sep 22, 2014 at 7:35 PM, Yuqiang Zhang <yuqiangzhang.thu at gmail.com>
wrote:

> 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)
>
> system <http://ncl.ucar.edu/Document/Functions/Built-in/system.shtml>("/bin/rm
> -f simple.nc") ; remove any pre-existing file
>
> ncdf = addfile("simple.nc" ,"c") ; output netCDF file
>
> filedimdef <http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml>(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: dataType: floatTotal Size: 777600 bytes            194400
> valuesNumber of Dimensions: 2Dimensions 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/20140923/4d65c62c/attachment.html 


More information about the ncl-talk mailing list