# windowaverage¶

Result = windowaverage(expression, windowlength)

expression

spatial scalar

windowlength

spatial, non spatial scalar

Result

spatial scalar

## Options¶

--unittrue or --unitcell

--unittrue

windowlength is measured in true length (default)

--unitcell

windowlength is measured in number cell lengths

## Operation¶

For each cell its windowaverage is computed as follows. A square window with the cell in its centre is defined by windowlength. The windowlength is the length of the window in horizontal and vertical directions. For each cell i which is entirely or partly in the window the fraction of the cell in the window is determined. This is the area of the part of the cell in the window divided by the total area of a cell. Call this fraction(i); let expression(i) be the expression value of cell i. Now, the windowaverage(c) of the centercell is computed by taking a fraction weighted average of the values on expression:

$windowavaverage(c) = { { \sum^n_{i=1} ( fraction(i) * expression(i) ) } \over \sum^n_{i=1} fraction(i) }$

where n is the number of cells which is entirely or partly in the window. For each cell c its windowaverage is computed and assigned to the corresponding cell on Result.

## Group¶

This operation belongs to the group of Neigbourhood operators; window operators

## Examples¶

1. • pcrcalc
binding
Result1 = Result1.map;
Expr = Expr.map;
initial
report Result1 = windowaverage( Expr, 6);

• python
Result1 = windowaverage( Expr, 6)
 Result1.map Expr.map  2. • pcrcalc
binding
Result2 = Result2.map;
Expr = Expr.map;
WinLen2 = WinLen2.map;
initial
report Result2 = windowaverage( Expr, WinLen2);

• python
 Result2.map Expr.map WinLen2.map   