The TabCDF package consists of two utilities: tab2nc and nc2tab, which convert plain tab-separated value (TSV) text files to NetCDF data and vice versa, respectively. This process is facilitated by a simple scripting language that uses the .tnc extension by convention (TNC scripts). For more information on NetCDF, see
http://www.unidata.ucar.edu/software/netcdf/
Such a scripting language has distinct advantages:
As a simple example of TabCDF's capabilities, suppose we have a file of tab-separated values containing the population of several cities over a century:
1900 1940 1970 2000 Los Angeles 0.102 1.504 2.812 3.695 Washington 0.279 0.663 0.757 0.572 New York 3.437 7.455 7.896 8.008 Seattle 0.081 0.368 0.531 0.563 London 6.528 8.197 7.452 7.322
A corresponding TNC script to describe the layout of the data would be:
{ string empty; int year[n] }
m * { string city[]; float population[][n] }
In contrast, the resulting NetCDF file expressed in CDL is much less compact:
netcdf out {
dimensions:
__string = 11 ;
n = 4 ;
m = 5 ;
variables:
char empty(__string) ;
int year(n) ;
char city(m, __string) ;
float population(m, n) ;
// global attributes:
:__str_len = 11 ;
data:
empty = "" ;
year = 1900, 1940, 1970, 2000 ;
city =
"Los Angeles",
"Washington",
"New York",
"Seattle",
"London" ;
population =
0.102, 1.504, 2.812, 3.695,
0.279, 0.663, 0.757, 0.572,
3.437, 7.455, 7.896, 8.008,
0.081, 0.368, 0.531, 0.563,
6.528, 8.197, 7.452, 7.322 ;
}
See the README more comprehensive instructions.
TabCDF is available for download as a typical installation package for unix-like systems at
http://biit.cs.ut.ee/~arak/pub/software/tabcdf/
Typically, installation consists of unpacking the tarball, changing to the extracted directory and issuing the commands
./configure make make install
TabCDF has two software dependencies:
TabCDF should work on any recent unix-like system, and has been to confirmed to work on the following platforms:
See INSTALL for more information. TabCDF is distributed under terms of the BSD license. See COPYING for details. Changes by version are outlined in the ChangeLog.
Tambet Arak (
),
Meelis Kull (
)
BIIT research group,
University of Tartu