[ncl-talk] convert_to_netcdf

Douglas Lowe Douglas.Lowe at manchester.ac.uk
Mon Nov 20 09:17:45 MST 2017


Dear Kunal Bali,

It is definitely possible - the UK nation emissions data is provided in a similar csv text format to the file you attached, and I have previously converted this to netcdf format using NCL.

You need to use the readAsciiHead function to read the header, and then the readAsciiTable function to read the table (using the parameters that you have gained from reading the header information). Once you have the data in a 2D array then it can be written into a netcdf file, after you've defined the file.

My scripts wont be directly applicable to your task (as they also conversion of BNG coordinates to longitude & latitude coordinates), but if you would like to use them as a template to guide you in writing your scripts then email me, and I'd be happy to send you a copy.

Regards,
Doug

----------------------------------------------------------------------

Message: 1
Date: Mon, 20 Nov 2017 21:13:08 +0530
From: Kunal Bali <kunal.bali9 at gmail.com>
To: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
Subject: [ncl-talk] convert_to_netcdf
Message-ID:
        <CAOiHCtRKsHCjTnje+28ntzjMObLiVt5j9U5Xst3DUrVQDjyWQg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear NCL users,

Is it possible to convert attached .asc file format to netcdf? It seems
like CDL format?

Could anyone please let me know that?


regards
Kunal Bali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171120/9d8be42d/attachment.html>
-------------- next part --------------
ncols  241
nrows  291
xllcenter  91.33
yllcenter  5.00
cellsize  0.1
NODATA_value  -999
133.0 136.0 138.0 141.0 144.0 147.0 150.0 152.0 155.0 157.0 159.0 162.0 164.0 167.0 159.0 147.0 135.0 123.0 111.0 98.0 86.0 84.0 81.0 79.0 76.0 74.0 71.0 70.0 70.0 70.0 71.0 71.0 72.0 72.0 84.0 101.0 118.0 134.0 151.0 168.0 185.0 197.0 209.0 222.0 234.0 246.0 258.0 266.0 266.0 266.0 266.0 265.0 265.0 265.0 254.0 237.0 221.0 204.0 188.0 171.0 155.0 156.0 158.0 160.0 161.0 163.0 164.0 165.0 162.0 159.0 156.0 153.0 150.0 147.0 144.0 140.0 137.0 133.0 130.0 126.0 123.0 120.0 117.0 114.0 111.0 ......
------------------------------

Subject: Digest Footer

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


------------------------------

End of ncl-talk Digest, Vol 168, Issue 44
*****************************************


More information about the ncl-talk mailing list