differences

Calculates pairwise differences along specified grid(s)

var [ grid ... ] differences

Arguments
labeltypedescription
var variable variable of which pairwise differences are to be calculated
grid grid set grid(s) along which pairwise differences are to be calculated
Returns
var' variable Pairwise differences of var along grid. var' is dependent on the same grids as var, but grid has one less grid point (i.e., last grid point dropped) and the grid point values (i.e., labels) in grid indicate the differences that were calculated.

Description

differences calculates pairwise differences of n values along a specified grid of an input variable (var). In the resulting output (var') the n-1 difference values are assigned to the midpoints of the intervals of the original grid along which the differences were calculated. If x1 is a value in variable "var" at time T=1 and x2 is a value at time T=2, then the difference of the two values along the time grid is calculated as x2 - x1 and the result is assigned to T=1.5. As pairwise differences are calculated along a grid, if one or both of the values in a pair is a missing value, the result of the difference is a missing value.

Example

SOURCES .NOAA .NCEP .EMC .CMB .GLOBAL .Reyn_SmithOIv2 .monthly .ssta
[T]differences


In this example the difference between monthly sea surface temperature anomalies from one month to the next along the time grid (T) are calculated in the global gridded Reynolds and Smith OIv2 SSTA data set.

Live Example Link





See also

Arithmetic Functions: abs add div eexp ln log mag mod mul RESCALE sqrt sqrtsgn sub sum