asc2cdf User's Guide

ASCII to netCDF converter


Synopsis

asc2cdf [-d yyyy-mm-dd] [-b time_t] [-g globalAttrFile] [-a] [-i] [-l] [-m] [-r n] [-s n] [-:] [-v] [-h] ASCII_file netCDF_file

Description

asc2cdf is a program for uploading ASCII data into a netCDF file that follow the NCAR-RAF/nimbus conventions. Files are then useable by ncplot and the suite of nc* programs at RAF. With no options, asc2cdf expects the file to look like something produced by n2asc. A top row with variable names, and time in the HH:MM:SS format in the left column.
UTC             ATX           DPBC          GLAT          GLON          CONCF_IBR     
15:26:01     2.048569e+01  1.396061e+01  4.725823e+01  1.133886e+01  1.408615e-01
15:26:02     2.050103e+01  1.396254e+01  4.725826e+01  1.133879e+01  0.000000e+00
15:26:03     2.050156e+01  1.396496e+01  4.725829e+01  1.133871e+01  0.000000e+00
15:26:04     2.049350e+01  1.397820e+01  4.725832e+01  1.133864e+01  0.000000e+00
15:26:05     2.048074e+01  1.398546e+01  4.725835e+01  1.133857e+01  0.000000e+00
Columns should be seperated with any combination of commas, spaces and tabs. The data maybe in any format acceptable to atof(3), which is just about anything.

Command Line Options

The -m option tells asc2cdf that time in the left column will be in seconds since midnight format (with rounding). This is automatically turned on with the -a, -i or -l option.

The -b option defines a base_time in Unix seconds since January 1st 1970. This is useful when trying to merge data back into a netCDF file, where ncmerge complains about no overlapping time segments. The default value is 0. This option has no affect when the -a, -i or -l option is enabled.

The -d option lets the user specify a flight date. This can be used in place of the -b option. If both options are specified, the -d will take precedence. Date must be in ISO-8601 compliant format.

The -r option defines the data rate. Values between 0 and 1 are for data which comes less frequently than once per second (e.g. .1 is 10 second data). Values greater than 1 are for samples per second (e.g. 50 is for 50Hz data). The default is 1.

The -s option tells asc2cdf to skip 'n' lines before getting to the data. This option is ignored if -a or -l option has been specified. The default is 1.

The -a option tells asc2cdf that the input file will be following the NASA Data Exchange Format (Ames). Please note:

Example:

 19 1001
Webster, Chris
NCAR Research Aviation Facility

HIPPO-Global
  1  1
2009 01 16  2009 03 25
1.0
Time in seconds from 00Z
  4
1.0 1.0 1.0 1.0
99999 99999 99999 99999
Vertical Differential Pressure, Radome (hPa)
Attack Angle, Radome Diff. Pressure (degree)
IRS Altitude (m)
Avionics GPS Altitude (MSL) (m)
  0
  1
UTC      ADIFR  AKRD  ALT  ALT_G
66890 0.0071611 0 34.8615 72.3047
66891 0.0185372 0 34.8279 72.5152
66892 -0.00574668 0 34.8234 72.744

The -i option tells asc2cdf that the input file will be following the ICARTT Format.

The -: option tells asc2cdf to interprete the time stamp as HHMMSS instead of HH:MM:SS.
The -l option tells asc2cdf that the input file will be following the NASA Data Exchange Format (Langley).

The -: option tells asc2cdf to interprete the time stamp as HHMMSS instead of HH:MM:SS.

The -g option tells netCDF to read a file containing key/value pairs to be added as global attributes to the netCDF. e.g.
Source=NCAR Research Aviation Facility
Address=P.O. Box 3000, Boulder, CO 80307-3000
Phone=(303) 497-1030
Investigator=Teresa Campos
ProjectName=RICO
Platform=N130AR
ProjectNumber=135
FlightNumber=rf18
coordinates=LONC LATC PALT Time
landmarks=17.1415 -61.7783 ANU,17.6075 -61.82395 SPol

The -v flag is for verbose output.

The -h flag is for histogram, and outputs NASA Ames formatted data that has all the variable names the same, and a comment line like "CELLSIZES = 1.0f, ...", to be a vector in the netCDF file suitable for plotting with ncpp. Note that to plot with ncpp, the variable name and units must be something ncpp recognized and both counts and concentration must be present in the same file. This option doesn't deal with all that, just turns columnar histogram data from a nasa Ames file into a single netCDF var.

Requirements

asc2cdf should compile under any platform. netCDF 3.0 or later is required to compile.

Author

Christopher J. Webster
National Center for Atmospheric Research
Research Aviation Facility.
(303) 497-1044

email Chris Webster

Last update: Mon Mar 30 17:39:39 MDT 2009