# Functional list of applications and operations¶

## Point operators¶

### Boolean operators¶

- and, &, pcrand
Performs a Boolean-and operation on two expressions, on a cell-by-cell basis.

- not, ~, pcrnot
Performs a Boolean-not operation on two expressions, on a cell-by-cell basis.

- or, |, pcror
Performs a Boolean-or operation on two expressions, on a cell-by-cell basis.

- xor, ^, pcrxor
Performs a Boolean-xor operation on two expressions, on a cell-by-cell basis.

### Comparison operators¶

- eq or ==
Performs a relational-equal-to operation on two expressions, on a cell-by-cell basis.

- ge or >=
Performs a relational-greater-than-or-equal-to operation on two expressions, on a cell-by-cell basis.

- gt or >
Performs a relational-greater-than operation on two expressions, on a cell-by-cell basis.

- le or <=
Performs a relational-less-than-or-equal-to operation on two expressions, on a cell-by-cell basis.

- lt or <
Performs a relational-less-than operation on two expressions, on a cell-by-cell basis.

- ne or !=
Performs a relational-not-equal-to operation on two expressions, on a cell-by-cell basis.

### Conditional statements¶

- if then else
For each cell a Boolean expression determines whether the value of the first expression or the value of a second expression is assigned to the result

- if then
Return missing values if condition is not met.

- repeat { …} until (pcrcalc)
Conditional iteration in pcrcalc.

### Missing value creation, detection, alteration¶

- cover
Substitutes missing values on an expression for values selected from one or more different expression(s), on a cell-by-cell basis.

- defined
Assigns a Boolean TRUE for non missing values on the input expression and FALSE for missing values, on a cell-by-cell basis.

- lddmask
Cuts a local drain direction map resulting in a (smaller) sound local drain direction map.

- nodirection
For an expression of directional data type, returns TRUE for cells without a direction and FALSE otherwise for cells with a direction.

- if then
Return missing values if condition is not met.

- inversedistance
Interpolate values

### Relations in tables¶

- lookup…
For each cell, compares the cell value(s) of one or more expression(s) with the search key in a table and assigns a new value linked to that record in the key which matches the value(s) of the input expression

- lookuplinear
Assigns table key values with possible interpolation between key values.

- table
Creates on basis of one or more maps a table with a score for each key in the table. The score is the total area of the cells that match the key in the table.

### Order¶

- order
Returns ordinal numbers to cells in ascending order.

- markwhilesumge, markwhilesumle
Marks each cell in specified order until the sum reaches a specified limit.

- areaorder
Within each area ordinal numbers to cells in ascending order.

- argorder,argorderwithid
Identify highest value by argument order

- argorderarealimited,argorderwithidarealimited
Identify highest value by argument order with a limit per argument

- argorderaddarealimited argorderwithidaddarealimited
Variation on argorder

- pred
For each cell returns an ordinal number which is the ordinal number of the next lower ordinal class (predecessor) on the expression.

- succ
For each cell returns an ordinal number which is the ordinal number of the next higher ordinal class (predecessor) on the expression.

### Maximize, minimize¶

### Arithmic operators, trigonometric, exponential, logarithmic functions¶

- *
Multiplies the values of two expressions and sends this product to the result, on a cel-by-cell basis.

- **
Calculates the Nth power of the first expression, where N is the value on a second expression and sends it to the result, on a cell-by-cell basis.

- -
Subtracts the value of the second expression from the value of the first expression and assigns it to the result, on a cell-by-cell basis.

- +
Adds the values of two expressions and assigns this sum to the result, on a cell-by-cell basis.

- / or div
Divides the value of a first expressions by the value of a second expression and assigns this quotient to the result, on a cell-by-cell basis.

- abs
Calculates the absolute value of an expression, on a cell-by-cell basis.

- acos
Calculates the inverse cosine value of an expression, on a cell-by-cell basis.

- asin
Calculates the inverse sine value of an expression, on a cell-by-cell basis.

- atan
Calculates the inverse tangent value of an expression, on a cell-by-cell basis.

- cos
Calculates the cosine of an expression, on a cell-by-cell basis.

- exp
Calculates the base

_{e}exponential of an expression, on a cell-by-cell basis.- fac
Faculty or factorial of a natural positive number

- idiv, //
Divides (integer division) the values on a first expression by the values on a second expression and assigns this quotient to the result, on a cell-by-cell basis.

- ln
Calculates the natural logarithm (base

_{e}) exponential of an expression, on a cell-by-cell basis.- log10
Calculates the (base

_{e}) logarithm of an expression, on a cell-by-cell basis.- mod, %
Divides (integer division) the values on a first expression by the values on a second expression and assigns the remainder to the result, on a cell-by-cell basis.

- sin
Calculates the sine of an expression, on a cell-by-cell basis.

- sqr
Calculates the square of an expression, on a cell-by-cell basis.

- sqrt
Calculates the square root of an expression, on a cell-by-cell basis.

- tan
Calculates the tangent of an expression, on a cell-by-cell basis.

### Rounding¶

- roundup
For each cell, the value of an expression is rounded upwards. Values of the results will be whole numbers.

- rounddown
For each cell, the value of an expression is rounded downwards. Values of the results will be whole numbers.

- roundoff
For each cell, the value of an expression is rounded off. Values of the results will be whole numbers.

### Data types: Conversion and assignment¶

- boolean
Converts from nominal, ordinal, scalar, directional or ldd data type to a boolean data type or generates a map of boolean data type with one constant value.

- directional
Converts from boolean, nominal, ordinal, scalar or ldd data type to a directional data type or generates a map of directional data type with one constant value.

- ldd
Converts from boolean, nominal, ordinal, scalar or directional data type to a ldd data type or generates a map of ldd data type with one constant value.

- nominal
Converts from boolean, ordinal, scalar, directional or ldd data type to a nominal data type or generates a map of nominal data type with one constant value.

- ordinal
Converts from boolean, nominal, scalar, directional or ldd data type to a ordinal data type or generates a map of ordinal data type with one constant value.

- scalar
Converts from boolean, nominal, ordinal, directional or ldd data type to a scalar data type or generates a map of scalar data type with one constant value.

- spatial
Conversion of a non-spatial value to a spatial data type.

### Random number generation - cells¶

### Coordinates, unique ID’s¶

- uniqueid
For each cell that is TRUE on a Boolean expression, assigns a unique whole value

- xcoordinate
For each cell that is TRUE on a Boolean expression, assigns the xcoordinate of the cell

- ycoordinate
For each cell that is TRUE on a Boolean expression, assigns the ycoordinate of the cell

## Neighbourhood operators¶

### Windows operations¶

- shift, shift0
Shifts the value of each cell a specified number of cells in the assigned direction.

- window4total
Sum the values of the four surrounding cells.

- windowaverage
For each cell, finds the average of cell values within a specified square neighbourhood and assigns it to the corresponding cell for the result

- windowdiversity
For each cell, finds the number of unique values within a specified square neighbourhood and assigns it to the corresponding cell for the result

- windowhighpass
Increases spatial frequency within a specified square neighbourhood. For each cell, it calculates the sum of cell values of an expression in a specified surrounding neighbourhood; this is subtracted from the cell values itself multiplied by twice the number of cells in the surrounding neighbourhood. The result of this calculation is assigned to the corresponding cell for the result.

- windowmajority
For each cell, finds the most often occurring cell values within a specified square neighbourhood and assigns it to the corresponding cell for the result

- windowmaximum
For each cell, finds the maximum cell value within a specified square neighbourhood and assigns it to the corresponding cell for the result

- windowminimum
For each cell, finds the minimum cell value within a specified square neighbourhood and assigns it to the corresponding cell for the result

- windowtotal
For each cell, finds the sum of cell values within a specified square neighbourhood and assigns it to the corresponding cell for the result

### Derivatives of elevation maps¶

- aspect
For each cell, calculates the aspect using elevations from a digital elevation model.

- horizontan
Calculates the maximum tangent of the angles of neighbouring cells in the direction of the sun.

- lddcreate
Creates a local drain direction map expression using the 8 points pour algorithm with flow directions from each cell to its steepest downslope neighbour. Pits can be removed with pit removing threshold map(s).

- lddcreatedem
Creates a modified digital elevation model which fits the local drain direction map generated on the basis of the original digital elevation model (the elevation model is the input of the operation).

- plancurv
For each cell, calculates the planform curvature (i.e. curvature transverse to the slope) using elevations from a digital elevation model.

- profcurv
For each cell, calculates the profile curvature (i.e. curvature in the direction of the slope) using elevations from a digital elevation model.

- slope
For each cell, calculates the slope using elevations from a digital elevation model.

### Spread operations¶

- influencesimplegauss
Simple unweighted gaussian decrease of influence from sources.

- spread
For each cell, calculates the friction-distance of the shortest material-distance path over a map with friction material from an identified source cell or cells to the cell under consideration.

- spreadmax
Like spread but with a maximum distance argument.

- spreadldd
For each cell, calculates the friction-distance of the shortest material-distance path over a map with friction material from an identified source cell or cells to the cell under consideration, where only paths are considered in downstream direction from the source cells.

- spreadlddzone
For each cell, determines the shortest friction-distance path over a map with friction from an identified source cell or cells to the cell under consideration, where only paths are considered in downstream direction from the source cells. The value of the source cell at the start of this shortest material-distance path is assigned to the cell under consideration.

- spreadzone
Determines for each cell the shortest friction-distance path over a map with friction material from an identified source cell or cells to the cell under consideration. The value of the source cell at the start of this shortest friction-distance is assigned to the cell under consideration.

### Operations with local drain direction maps¶

- ldddist
Calculates for each cell the material-distance of the path over a map with friction from the cell under consideration to the downstream nearest TRUE cell.

- slopelength
For each cell assigns the accumulative-material-distance of the longest accumulative-material-path upstream over the local drain direction network to one of the cells against the divide of its catchment.

*transport of material:*

- accuflux
For each cell calculates the accumulated amount of material that flows out of the cell into its neighbouring downstream cell. This accumulated amount is the amount of material in the cell itself plus the amount of material in upstream cells of the cell.

- accucapacityflux and accucapacitystate
Transport input of material downstream over a local drain direction network; material is transported from one cell to its downstream cell when the transport capacity is exceeded, the remaining material is stored.

- accufractionflux and accufractionstate
Transport input of material downstream over a local drain direction network; a fraction of the material is transported to its downstream cell, the remaining material is stored.

- accuthresholdflux and accuthresholdstate
Transport material downstream over a local drain direction network when transport threshold is exceeded

- accutriggerflux and accutriggerstate
Transport input of material downstream over a local drain direction network; transport from one cell to its downstream cell only takes place if the amount of the material input to the cell exceeds the transport trigger of the cell: if the trigger is exceeded, all material is transported, else all material is stored.

- accutraveltimestate, accutraveltimeflux
Transports material downstream over a distance dependent on a given velocity.

- accutraveltimefractionstate, accutraveltimefractionflux, accutraveltimefractionremoved
Transports a fraction of material downstream over a distance dependent on a given velocity.

- dynamicwaveq, dynamicwaveh
Dynamic Wave equation

- dynwavestate, dynwaveflux, lookuppotential, lookupstate
Dynamic wave equation as state and flux.

- kinematic
Kinematic Wave equation

- kinwavestate, kinwaveflux
Kinematic Wave equation as state and flux

*miscellaneous operations:*

- catchment
Determines the catchment(s) (watershed, basin) of each one or more specified cells, subcatchments are not identified.

- catchmenttotal
Total catchment for the entire upstream area

- downstream
Returns the value of the neighbouring downstream cell.

- downstreamdist
Returns the distance to the first cell downstream.

- lddrepair
Repairs an unsound local drain direction map.

- path
Determines for each TRUE cell on a Boolean input expression the path over the local drain direction network downstream to its pit; on the result, each cell which is on a path is assigned a TRUE.

- pit
Assigns a Boolean TRUE to all pit cells on a local drain direction network.

- streamorder
Assigns the stream order index to all cells on a local drain direction network.

- subcatchment
Determines the (sub-)catchment(s) (watershed, basin) of each one or more specified cells, subcatchments are identified.

- transient
Simulates transient groundwater flow according to the implicit finite difference method.

- upstream
For each cell, assigns the sum of the cell values of its upstream cell(s).

### Operations for visibility analysis¶

- extentofview
Determines the total length of the lines in a number of directions from the cell under consideration to the first cell with a different value.

- view
Assigns a TRUE or FALSE value for each cell on the result according to the visibility of that cell from one or more viewpoint cells in a 3D landscape defined by a digital elevation model.

## Area operations¶

### Operations over areas¶

- areaarea
For each cell, assigns the area of the area to which the cell belongs. Areas are identified by cell values on a expression with classes.

- areaaverage
For each cell, assigns the average value of the cells that belong to the same area to the cell itself. Areas are identified by cell values on a expression with classes.

- areadiversity
For each cell, assigns the number of unique cell values that belong to the same area to the cell itself. Areas are identified by cell values on a expression with classes.

- areamajority
For each cell, assigns the most often occurring cell value of cells that belong to the same area to the cell itself. Areas are identified by cell values on a expression with classes.

- areamaximum
For each cell, assigns the maximum value of the cells that belong to the same area to the cell itself. Areas are identified by cell values on a expression with classes.

- areaminimum
For each cell, assigns the minimum value of the cells that belong to the same area to the cell itself. Areas are identified by cell values on a expression with classes.

- areatotal
For each cell, assigns the sum of cells of cells that belong to the same area to the cell itself. Areas are identified by cell values on a expression with classes.

- clump
Identifies all continuous groups of with the same value (‘clumps’); cells belonging to one clump are assigned the same new unique value.

### Random number generation - areas¶

- areanormal
Assigns to each area one value taken from a normal distribution with a mean 0 and a standard deviation 1.

- areauniform
Assigns to each area one value taken from a uniform distribution with a mean 0 and a standard deviation 1.

## Map operations¶

### Operations over maps¶

- mapmaximum
Determines the maximum cell value of all cells values.

- mapminimum
Determines the minimum cell value of all cells values.

- maptotal
Sums all cell values

- maparea
Calculates the total area represented by the non missing value cells.

- cellarea
Assigns the area of one cell.

- celllength
Assigns the length which is identical in vertical and horizontal direction of one cell.

### Random number generation - map¶

- mapnormal
Assigns to all cells one non spatial value taken from a normal distribution with a mean 0 and a standard deviation 1.

- mapuniform
Assigns to all cells one non spatial value taken from a uniform distribution with a mean 0 and a standard deviation 1.

## Time operations¶

### Time operations¶

- time
Assigns for each time step the time at that time step.

- timeinput
Assigns for each time step one of a set of maps in the database. Each time step, the map is taken with the extension that refers to the time at the time step.

- timeinput…
For each time step assigns cell values read from a time series that is linked to a map with unique identifiers. Per time step, the time series gives for each unique identifier a cell value that is assigned to cells on the map with a corresponding unique identifier.

- timeinputsparse
Returns a map for each timestep where map-timesteps combinations can be missing.

- timeinputmodulo
Returns a map for each timestep using a modulo index into a shorter map stack.

- lookupmapstack
Reads a variable assigned map number from a map stack.

- timeoutput
For each cell writes the expression value of an uniquely identified cell or cells to a time series. After a model run, the time series contains for each identified cell a list of expression cell values per time step.

- timeslice
Assigns the timeslice.

## Data management¶

### map creation, changing attributes¶

- mapattr
Generates a new PCRaster map with attributes specified by the user or changes location attributes of an existing PCRaster map.

### Conversion of data¶

- asc2map
Converts from ascii file format (including ARC/INFO and GENAMAP ascii output) to PCRaster map format.

- col2map
Converts from column file format (including simplified Geo-EAS format) to PCRaster map format.

- map2asc
Converts from PCRaster map format to ascii file format (including ascii input format for ARC/INFO.

- map2col
Converts from PCRaster map format to column file format (including simplified Geo-EAS format).

### Cutting and joining together PCRaster maps¶

- resample
Cuts one PCRaster map or joins several PCRaster maps by resampling to the cells of the resulting PCRaster map.

### Generation of legends¶

- legend
Attaches a legend to or changes the legend of one or more maps.

### Screen output¶

Visualisation of maps and timeseries can be done with aguila