From BAWiki

Basic Information

Name of Program



April 2018


September 2022


data conversion
synoptic data sets
CF NetCDF format
CSV format (comma separated values)
tabular data
support of DMQS metadata and variables
automatic adjustment of number of data READ to chunk size of input data

Acknowledgment: This project took advantage of netCDF software developed by UCAR/Unidata (

Short Description of Functionality

Program NC2TABLE allows selective data extraction from CF NetCDF files to CSV files. Extracted data ares stored in tabular form and may be subsequently used in spread sheet programs like MS EXCEL.

General Introduction

Geophysical variables f_i stored in (netCDF) data files are typically dependent on different numbers of coordinates. According to the CF metadata standard, time and date as well as geographical location are the required minimum.

General form of a variable (function):

f = f_i(t,x[,z][,l][,c])

In the above definition, t means time, x stands for the (horizontal) location, z is either height or depth, l symbolizes a label (e. g. a sediment fraction) and c is typically representing (other) classes, e. g. for a probability distribution.

Expressions function and variable are synonymously used in the following.

Structure of Tables

Tables consist out of rows and columns. Tables are best suited for the following data presentations:

  1. Table Type 1 (functional profile): The dependence of f_i on two different coordinates is displayed. The values of (optionally) present other coordinates are frozen in. Example: water level in dependence on (discrete) space x_m and (discrete) time t_n.
    Typical combinations for axes are:
    • Time series (Ts): f(t,x) Ts for several locations, f(t,z) Ts for several vertical layers, f(t,l) Ts for multiple sediment fractions and f(t,c) Ts for various classes (probability distribution) or frequencies (spectrum).
    • Dependence on horizontal position: f(x,z) variation over height or depth, f(x,l) variation over sediment fractions and f(x,c) variation over classes (probability distribution) or frequencies (spectrum).
    • Dependence on vertical position: f(z,l) variation over sediment fractions and f(z,c) variation over classes (probability distribution) or frequencies (spectrum).
    • Other: f(l,c) probability distribution for various sediment fractions.
  2. Table Type 2 (comparison of functions): The dependence of several functions f_i, with i=1,n_i, in dependence on a single coordinate can be displayed. All other coordinate values remain frozen in. Example: time series of water level, current velocity and salinity for a specific location.

Program NC2TABLE supports both above mentioned types of tables. For date and time data items the time zone used can be selected via file nc2table.dat.


  1. general input data (file type nc2table.dat);
  2. geophysical data (file type


  1. ASCII tables (file type nc2table.csv) in CSV file format;
  2. Metadata (filetype nc2table.txt) in readable form (text file);
  3. (optional) informative printer file of program execution (file type nc2table.sdr)
  4. (optional) trace of program execution (file type nc2table.trc)


Binary data are extracted an printed in tabular form according to the user requirements.

Just in case HDF error is detected during read of a data record, the program tries to reconstruct the wanted data set from adjacent (in time) records for the same variable. This type of repair works for time dependent variables only.

Program(s) to run before this Program


Program(s) to run after this Program

spread sheet program, text editor

Additional Information



Additional software


Original Version

G. Lang


Working group POS


template files available in $PROGHOME/examples/nc2table

back to Program Descriptions