AvgSpa (Spatial Average)

The AvgSpa function computes the spatial average of a measurement.

Syntax

AvgSpa ( Dest, Swath, Source )

Remarks

The AvgSpa is calculated as:

Where X(j) = Source

If a ClosedNAN Not a number. A data word indicating a measurement or processing error. Voltage overrange, SDI-12 sensor error, and undefined mathematical results can produce NAN. is returned by the datalogger it is not included in the spatial average.

Source and/or Dest can be a ClosedFloat Four-byte floating-point data type. Default datalogger data type for Public or Dim variables. Same format as IEEE4. or ClosedLong Data type used when declaring a variable as an integer. data type, but not a ClosedString A data type used when declaring a variable consisting of alphanumeric characters..

Parameters

Dest (Destination)

The Variable in which to store the results of the instruction. Right-click the parameter to display a list of defined variables.

If this instruction has a Repetitions parameter and it is greater than 1, the results are stored in an array with the variable name. The array must be dimensioned large enough to hold all of the values returned from all of the Reps.

Type: Variable or Array

Swath

The number of values of the array over which to perform the specified operation.

Type: Constant (or expression that evaluates as a constant)

For the AvgSpa function, the Swath parameter is the number of elements to include in the average.

Source

The name of the Variable that is the input for the instruction. Right-click the parameter to display a list of defined variables.

Type: Variable

For the AvgSpa function, the Source is the first variable in the array for which the spatial average should be calculated.

In the case where the Source used is a multidimensional array, a one-dimensional representation of the value is used in the Source.

Example: If the array is declared Public Source(3,4), to indicate Source(3,1) use Source(7).

  Column 1 Column 2 Column 3
Row 1 1 2 3
Row 2 4 5 6
Row 3 7 8 9
Row 4 10 11 12

See also Multi-dimensional Arrays.

This instruction uses Closedhigh precision math A normal single precision float has 24 bits of mantissa. With high precision, a 32 bit extension of the mantissa is saved and used internally, resulting in 56 bits of precision. Instructions that use high precision are Average, AvgRun, AvgSpa, CovSpa, MovePrecise, RMSSpa, StdDev, StdDevSpa, TotalRun, and Totalize.. A normal single precision float has 24 bits of mantissa. With high precision, a 32 bit extension of the mantissa is saved and used internally, resulting in 56 bits of precision. Instructions that use high precision are AddPrecise, Average, AvgRun, AvgSpa, CovSpa, MinRun, MaxRun, MovePrecise, RMSSpa, StdDev, StdDevRun, StdDevSpa, TotalRun, and Totalize.