R: Coordinate systems

Coordinate systems {RandomFields} | R Documentation

## Coordinate systems

### Description

Implemened Coordinate Systems

### Implemented coordinate systems

- Cartesian coordinate system

- Earth coordinate systems
  The earth is considered as an ellipsoid; The first angle takes values in [0, 360), the second angle takes values in [-90, 90].

- Spherical coordinate systems
  The earth is considered as an ellipsoid; The first angle takes values in [0, 2π), the second angle takes values in [-π/2, π/2].

### Transformations between the system

- Earth to cartesian
  The 3-dimensional resulting coordinates are either given in ‘km’ or in ‘miles’.

- Gnomonic an orthographic projections
  The 2-dimensional resulting coordinates are either given in ‘km’ or in ‘miles’. The projection direction is given by the `zenit`.

- Earth to spherical
  In this case the Earth is considered as a ball.

Cartesian systems cannot be transformed to earth or spherical coordinate systems, nor a spherical system to earth coordinates.

### Options

`coord_system`

  character. One of the values `"auto"`, `"cartesian"`, `"earth"`

  If `"auto"`, then the coordiates are considered as `"cartesian"` except the names of the given coordinates indicate a different system. Currently, only `"longitude"` and `"latidute"` (or abbreviations of them) are excepted as names for given coordinates and indicate an earth coordinate systems. See the examples below.

  Default: `"auto"`

`coordnames`

  integer vector of length 2 or an increasing sequence of integers or character. This parameter gives the coordinate columns in a data frame, either by starting column and ending column or the sequence or by names. In the first case, single codeNAs might be included, meaning ‘from the beginning’ or ‘until the end’. If both values are `NA`, then, depending on the context, either an error message is returned or it is assumed that the first columns give the coordinates.

`coordunits`

  any string. If `coordinate_system = "earth"` and longitude and latitude are transformed to 3d cartesian coordinates, `coordunits` determines whether the radius is given in kilometers (`"km"`) or miles (`"miles"`). If empty, then `"km"` is chosen.

  Default: `""`

`new_coord_system`

  One of the values `"keep"`, `"cartesian"`, `"earth"`, `"plane"`.

  1. `"keep"`
     The `coord_system` is kept (except an explicite transformation is given, see `RMtrafo`.

     Note that some classes of models, e.g. completely monotone functions and compactly supported covariance models with range less than π are valid models on a sphere. In this case the models are considered as models on the sphere. See spherical models for lists.

  2. `"cartesian"`
     If `coord_system` is `"earth"` the coordinates are transformed to cartesian coordinates before any model is considered.

  3. `"orthographic"`, `"genomic"`
     If `coord_system` is `"earth"` the locations are projected to a plane before any model is considered.

  Default: `"keep"`

`new_coordunits`

  internal and should not be set by the user.

  Default: `""`

`polar_coord`

  logical. If `FALSE` the spherical coordinates agree with the earth coordinate parametrisation, except that we radians are used for spherical coordinates instead of degrees for the earth coordinates.

  If `TRUE` the spherical coordinates signify polar coordinates.

  Default : `FALSE`

`varnames`

  integer vector of length 2 or an increasing sequence of integers or character. This parameter gives the data columns in a data frame, either by starting column and ending column or the sequence or by names. In the first case, single codeNAs might be included, meaning ‘from the beginning’ or ‘until the end’. If both values are `NA`, then for keywords ‘data’, ‘value’ and ‘variable’ will be searched for. If none of them are found, depending on the context, either an error message is returned or it is assumed that the last columns give the data.

`varunits`

  vector of characters. The default units of the variables.

  Default: `""`

`xyz_notation`

  logical or `NA`. Used by `RMuser` only.

  `NA` : automatic choice (if possible)

  `false` : notation (x, y) should not be understood as as kernel definition, not as xyz notation

  `true`: xyz notation used

`zenit`

  two angles of the central projection direction for the gnomonic projection (http://en.wikipedia.org/wiki/Gnomonic_projection, http://de.wikipedia.org/wiki/Gnomonische_Projektion) and the orthographic projection, (http://en.wikipedia.org/wiki/Orthographic_projection_in_cartography, http://de.wikipedia.org/wiki/Orthografische_Azimutalprojektion).

  If `any(is.na(zenit))` then either the value of either of the components may not be `NA`, whose value will be denoted by p.

  If p=1 then the mean of the locations is calculated; if p=Inf then the mean of the range is calculated.

  Default: `c(1, NA)`

### Author(s)

Martin Schlather, schlather@math.uni-mannheim.de http://ms.math.uni-mannheim.de/de/publications/software

### References

Covariance models in a cartesian system

- Schlather, M. (2011) Construction of covariance functions and unconditional simulation of random fields. In Porcu, E., Montero, J.M. and Schlather, M., Space-Time Processes and Challenges Related to Environmental Problems. New York: Springer.

Covariance models on a sphere

- Gneiting, T. (2013) Strictly and non-strictly positive definite functions on spheres. Bernoulli, 19, 1327-1349.

Tail correlation function

- Strokorb, K., Ballani, F., and Schlather, M. (2014) Tail correlation functions of max-stable processes: Construction principles, recovery and diversity of some mixing max-stable processes with identical TCF. Extremes, Submitted.

### See Also

`RMtrafo`, `RFearth2cartesian`, `RPdirect`, `models valid on a sphere`, `RFoptions`

### Examples

    RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
    ##                   RFoptions(seed=NA) to make them all random again

    z <- 1:4
    x <- cbind(z, 0)
    y <- cbind(0, z)
    model <- RMwhittle(nu=0.5)
    RFcov(model, x, y, grid=FALSE)##  standard is (cartesian) models

    ## same as above, but explicite:
    RFcov(model, x, y, grid=FALSE, coord_sys="cartesian")

    ## model is valid not on a sphere; x,y coordinates are
    ## transformed from earth coordinates to sphereical coordinates
    RFcov(model, x, y, grid=FALSE, coord_sys="earth")

    ## now comparable the scale chosen sucht that the covariance
    ## values are comparable to those int the cartesian case
    RFcov(RMS(model, s= 1 / 180 * pi), x, y, grid=FALSE,
          coord_sys="earth")

    ## projection onto a plane first. Then the scale is interpreted
    ## in the usual, i.e. cartesian, sense:
    RFoptions(zenit = c(2.5, 2.5))
    RFcov(model, x, y, grid=FALSE,
          coord_sys="earth", new_coord_sys="orthographic")

    ## again, here the scale is chosen to comparable to cartesian case
    ## here the (standard) units are [km]
    RFcov(RMS(model, s= 6350 / 180 * pi), x, y, grid=FALSE,
          coord_sys="earth", new_coord_sys="orthographic")

    ## as above, but in miles
    RFcov(RMS(model, s= 3750 / 180 * pi), x, y, grid=FALSE,
          coord_sys="earth", new_coord_sys="orthographic",
          new_coordunits="miles")

[Package RandomFields version 3.1.50 Index]