dimavg - "Averages" variables over a selected set of dimensions.

SYNOPSIS

dimavg  [ parameter=value ... ]  [ inputfile outputfile ]
dimavg  [ parameter=value ... ]  [ inputfile ... directory ]

Parameters are: include_varsdims_to_avgmethodstand_devkeep_Nsbig_mem.

DESCRIPTION

dimavg "averages" variables over a selected set of dimensions. Thus, it collapses dimensions in a data set, replacing the dimension with an "average" value of the data from the selected dimensions. The term "average" is meant to imply one of four operations; mean, min, max, median. In the case of 'mean', dimavg can optionally compute the standard deviation about the mean.

The dimension averaging operation can be performed on any or all the dataset dimensions and any or all the dataset's variables. For each variable, only its dimensions which match those in the list of specified dimensions (dims_to_avg) are collapsed. One output data set is produced for each input dataset. Data equal to bad_value (see datasets) are not considered in the "averaging" operation. An option is provided to allow the number of good values that went into the calculation of the "average" value to be written to the output data set. For the output variable named 'outvar', this variable is named N_'outvar' and is completely parallel to 'outvar'. Similarly, when standard deviations are calculated, the output variable is named SD_'outvar'.

PARAMETERS

include_vars

Specifies which variables in the input dataset(s) to 'average' and write to the output datasets. Each variable in this list does not have to have each dimension specified by dims_to_avg. Variables not specified in this list are not passed through to the output dataset. Variables in this list that do not have any of the dims_to_avg dimensions are passed through and copied to the output dataset.

The default is all variables in the input dataset(s).

dims_to_avg

Specifies the list of dimensions in the input dataset(s) to collapse.

There is no default.

method

Specifies the method of "averaging".

Valid responses are [ mean, min, max, median ]. The default is mean.

stand_dev

If method=mean, then stand_dev specifies whether also to compute the standard deviations about the means. For each output variable named 'x', a parallel variable named SD_'x' is written to the output dataset containing the standard deviations of the means.

Valid responses are [ yes, no ]. The default is no.

keep_Ns

If keep_Ns=yes, dimavg stores the number of good data values that went into the calculation of each "averaged" data value. For each output variable named 'x', a parallel variable named N_'x' is written to the output dataset containing the number of good values. If method= mean, it will consist of the number of values used to compute each mean. If method=max, it will consist of the number of good values (values not equal to bad_value, see Datasets) considered in finding the maximum.

Valid responses are [ yes, no ]. The default is no.

big_mem

OPTIONAL. If big_mem=yes, dimcorr reads all data into memory and then accesses the data along the given dimensions dims from memory rather than from disk. In some cases, when dims includes some of a variable's higher order dimensions (e.g., day for a variable with dimensions day, line and sample), this can greatly speed up the computation as long as sufficient memory exists.

Valid responses are [ yes, no ]. The default is no. This parameter can only be set by an explicit specification on the command line.

EXAMPLES

As an example, let's assume we have a global four dimensional dataset, with
dimensions x, y, z and t (longitude, latitude, height and time).

  If we want a time and depth averaged mean, we would specify z and t to be
  the dimensions to averaged over.

  If we want to look at a depth-averaged, time-latitude diagram of our
  data set, we would specify x and z to be the dimensions to average over.

  If we want a time series of the globally averaged value of our dataset,
  we would specify x, y and z to be the dimensions to averaged over.

SEE ALSO

datasets, spectral, sample, composite, emath, nhood, xvu, samplam, laminate.


Last Update: $Date: 1998/05/28 18:09:21 $