sim1D.query: Query an Object of Class 'sim1D'

Description Usage Arguments Value Author(s) Examples

Description

Query an object of class 'sim1D' holding the output of a dynamic, 1D model.

Usage

1
2
sim1D.query(obj, item, rangeT = c(NA, NA), rangeX = c(NA, NA),
  partly = FALSE, attrib = TRUE)

Arguments

obj

Object created with sim1D.create.

item

Name of a state variable or process (character string).

rangeT

Time range. Data outside this range are dropped.

rangeX

Range of spatial coordinates (e.g. depths). Data outside this range are dropped.

partly

Logical. If TRUE, the result contains data for those boxes/layers that are partly within the range rangeX. If FALSE, only data for boxes/layers being entirely within rangeX are returned.

attrib

Logical. Controls whether the return values has additional attributes set (see below).

Value

A numeric matrix where rows represent time and columns represent boxes/layers. The matrix has neither row names nor column names, but if attrib is TRUE, the following attributes are set:

Author(s)

David Kneis david.kneis@tu-dresden.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
gr <- makeGrid(dz0=0.01, dzMax=0.02, zMax=0.1, beta=1)
times <- 0:2
vars <- c("A","B")
pros <- c("X","Y")
values <- matrix(1:(length(times)*nrow(gr)*(length(vars)+length(pros))),
  nrow=length(times))
dyn <- cbind(times, values)
colnames(dyn) <- c("time", paste(rep(vars, each=nrow(gr)), 1:nrow(gr),sep="."),
  paste(rep(pros, each=nrow(gr)), 1:nrow(gr),sep="."))
obj <- sim1D.create(dyn, namesVars=vars, namesPros=pros, xMin=gr$zUp, xMax=gr$zLw)
sim1D.query(obj, item="X")

dkneis/diatools documentation built on May 15, 2019, 9:12 a.m.