data2LCs: Iterate over (N+1)D field and get all LC configurations

Description Usage Arguments See Also Examples

View source: R/data2LCs.R

Description

data2LCs gets all PLC or FLC configuration from a (N+1)D field given the LC template. The shape and dimension of this LC template depends on coordinates passed on by setup_LC_geometry.

User-defined LC template

Since data2LCs passes the LC.coordinates array to get_LC_config to iterate over the entire dataset, this functional programming approach allows user-defined light cone shapes (independent of the shapes implemented by setup_LC_geometry).

Just replace the $coordinates from the "LC" class with a user-specified LC template.

Usage

1
data2LCs(field, LC.coordinates = list(PLC = NULL, FLC = NULL))

Arguments

field

spatio-temporal field; either a matrix or a 3-dimensional array with time t as the first dimension, and the spatial coordinates as subsequent dimensions. Make sure to check compute_LC_coordinates for correct formatting.

LC.coordinates

coordinates for LC shape and dimension (usually the $coordinates value from the "LC" class; but also user-defined coordinates are possible here).

See Also

compute_LC_coordinates, setup_LC_geometry

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(1)
AA <- matrix(rnorm(200), ncol = 10)
LC_geom <- setup_LC_geometry(speed = 1, horizon = list(PLC = 2, FLC = 0), shape = "cone")
bb <- data2LCs(t(AA), LC.coordinates = LC_geom$coordinates)
image2(bb$PLC)
plot(density(bb$FLC))

# a time series example
data(nottem)
xx <- nottem
LC_geom <- setup_LC_geometry(speed = 1, horizon = list(PLC = 24, FLC = 3), space.dim = 0)
bb <- data2LCs(xx, LC.coordinates = LC_geom$coordinates)
image2(bb$PLC)
plot(density(bb$FLC))

LICORS documentation built on May 1, 2019, 10:13 p.m.