My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

NetCDF add-in written in Visual Basic for MS Excel

Context

NetCDF (network Common Data Form) is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. NetCDF is provided by Unidata.

Objective

This web page intends to simplify the use of NetCDF data in Excel, providing a ready to use solution for manipulating this type of data.

For developers, the open-source (GPL V3 license) can be downloaded directly or checked out with Mercurial.

The NetCDF add-in

This add-in is written in VBA 6.0 (so it won't work with Office 2010 64 bits) and is designed for Excel 2007 running with the Microsoft Windows operating system.

It allows to open NetCDF data (classical format, versions 3.x) with Excel for read / write access. Nevertheless, please remind that you will always be limited by Excel's own memory limitations, i.e. trying to open huge data files may result in crashing Excel...

Supported structures and Types

Supported data structures

  • Values
  • Vectors with dimension length up to 1,048,576
  • Numerical Matrices with up to 4 dimensions
  • 2-D matrices with dim1 length up to 1,048,576 and dim2 length up to 16,384 (or vice versa)
  • 3-D matrices with dim1 length up to 16,384 and dim2*dim3 length up to 1,048,576
  • 4-D matrices with dim1*dim2*dim3*dim4 length up to 1,048,576
  • Character Matrices with up to 4 dimensions (the last one has to be the - constant - number of characters of the strings)

Supported data types

  • NC_BYTE (the equivalent of the C type « signed char »)
  • NC_INT
  • NC_FLOAT
  • NC_DOUBLE
  • NC_CHAR (be careful : NetCDF character strings are stored in fixed length vectors)

Installing the software

Just download the add-in, execute the installer, accept the license agreement and that's all. You should then have a short-cut on your desktop allowing you to launch an empty Excel workbook including the add-in.

Reading an entire NetCDF file

In the NetCDF menu, select « Open File » , then browse to the desired nc file. DON'T TRY TO USE THE NATIVE EXCEL "OPEN FILE" MENU, IT JUST WON'T WORK!

Reading a specific variable or a slice of variable in a NetCDF file

In the NetCDF menu, select « Read Variable » , browse to the desired nc file and select the variable you want to read. It is possible to select a slice of data to be read.

Writing a NetCDF file

Important notice : if you make changes to the data in Excel, you should be careful to strictly respect the structure of the Excel workbook, as described in the "NC_Info" tab. In the NetCDF menu, select « Save File » , then browse to the desired location.

Known limitations and problems

  • Rounding errors may occur with data stored as floating point values.
  • Character strings : in Excel, strings are written in the cells of the spreadsheet with double quotes and are of a fixed length (strings are completed with blanks if necessary).

Powered by Google Project Hosting