[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting ASCII Grids to NetCdf

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: Converting ASCII Grids to NetCdf
  • Date: Mon, 24 Apr 2006 17:50:07 -0700

Title: Converting ASCII Grids to NetCdf

Hi Folks,

I'm trying to do something relatively simple, but I haven't been able to find any examples of others doing it before me. Just thought I'd ask here before going off and writing the code myself.

What I want to do is take a DEM stored in the  ESRI ASCII Raster format and convert it to a netcdf file. My ascii raster has the standard header format like so:

ncols         5001
nrows         4001
xllcorner     -125
yllcorner     34
cellsize      0.001
NODATA_value  -9999

Anybody got some code to do this? :-)

If not, no biggee, just thought I'd ask.

Cheers,
Andrew

Andrew C. Chase
Software Engineer
Monterey Bay Aquarium Research Institute