[Next] [Previous] [Top]

Freud User Manual

CHAPTER 11 Data Formats

netCDF data
Raw Data Files
GrADS files

Freud can read data in a number of formats--netCDF, raw ASCII or binary, and several specialized, proprietary types. There is no need for the user to specify the format when loading a file--Freud automatically figures it out.

netCDF data

The netCDF programming library allows data to be stored as variables of a certain type. Several types are defined by the netCDF standard, including short integer, long integer, float, character, and double. Freud can only load variables that are short or float types, although it will display attributes that are short, long, float, character, or double. Variables that contain short data are assumed to be packed, and are converted to float data by using the netCDF attributes scale_factor and add_offset to convert the data according to the formula:

	newdata = data*scale_factor + add_offset
Freud also uses the missing_value attribute to specify the value for missing data. If this attribute isn't specified, the value of the _FillValue attribute is used; if this isn't specified, a warning message is displayed when the file is loaded.

Freud will only display netCDF variables that are functions of two dimensions. If the variable is a function of more than two dimensions, Freud will still display the variable as long as only two of the dimensions have sizes greater than one.

Freud assumes that the first dimensions with a size greater than one is the latitude or y dimension; the next dimension greater than one is taken to be the longitude or x dimension.

Raw Data Files

Raw ascii or binary data files can be loaded by using a descriptor file that describes the attributes of the raw data file. The descriptor file is specified when loading data, not the actual data file. Following is an example of a descriptor file:

#freud

frdataset {
 { x 5 0 5}
 { y 5 0 5}
 { t 2 0 1}
 { varname testit }
 { filename test.bin }
 { type binary }
 { missing 3.0 }
}
The first line of the file must contain:

#freud
frdataset is just a Tcl command
(see "Command Line Interface" on page 61). The arguments to frdataset consist of a list of lists; the first string of each list specifies some attribute of the data. There should only be one frdataset command per file. Note: There must be a space between `frdataset' and the first `{`; this is a limitation of the TCL language.

The x, y, and t attributes indicate the dimensionality of the dataset. x and y must be specified, but t is optional. There can be three dimensions in a raw data file. The x dimension is the innermost dimension (varies the most rapidly), followed by the y and then the t dimension. The first argument indicates the size of the dimension; the second the starting value, and the third the step. So, in this example, the x dimension contains the values:

(0,5,10,15,20)
as does the y dimension; the t dimension contains the values:

(0,1)
Irregularly spaced (but rectilinear) grids can be accommodated by using the values keyword; for instance, if the x coordinate were specified as:

{ x values 0 5 15 20 50 }
than x is assumed to take the values (0,5,15,20,50}.

The varname attribute is used to specify the variable name; this is the variable name as it will appear in the data browser. It is a required attribute.

The filename attribute is also required, and is used to specify the file containing the raw data. The data file must be in the same directory as the descriptor file as no path specifiers are allowed in the name (i.e. test.bin is legal, but /freud/test.bin is not legal).

The type attribute, which indicates the data type of the data file, is optional and can be either binary or ascii. The default is binary. Note that there are different types of binary files; by binary, I mean nothing but data (no Fortran control characters, for instance).

The missing attribute is optional and indicates the value of missing data. If it is not present, the value of HUGE_VAL in the standard Unix include file math.h is used. On some machines (Sun) this is IEEE infinity; on others, it is something like 1e38.

GrADS files

Freud can also read a subset of GrADS data descriptor files (GrADS is a visualization and analysis program that is available from Brian Doty at the Center for Ocean-Land-Atmosphere Interactions in Maryland). Freud does not support the following GrADS descriptor file items:


Freud User Manual - 02 FEB 96
[Next] [Previous] [Top]

Generated with CERN WebMaker