# upstream¶

upstream

Sum of the cell values of its first upstream cell(s)

Result = upstream(ldd, material)

ldd
spatial ldd
material
spatial, non spatial scalar
Result
spatial scalar

## Operation¶

For each cell the neighbour cells that have a local drain direction on ldd towards the cell are determined. These are cells that drain directly to the cell. On Result the cell is assigned the sum of the material values of these first upstream cells. This is done for each cell.

## Notes¶

A cell with a missing value on ldd or material is assigned a missing value on Result. Additionally the downstream neighbour of a missing value cell on material is assigned a missing value on Result.

## Group¶

This operation belongs to the group of Neighbourhood operators; local drain directions

## Examples¶

1. • pcrcalc
binding
Result = Result.map;
Ldd = Ldd.map;
Expr = Expr.map;
initial
report Result = upstream(Ldd, Expr);

• python