GetLatLonField: Latitude and longitude fields

Description Usage Arguments Value Author(s) Source Examples

View source: R/distance-fields.R

Description

Get latitude and longitude field vectors from the latitude and longitude attributes of a "pField" or "pTs" object. These fields follow the same spatial pattern as the input object (i.e., for the first latitude the indices run along all longitudes, then jump to the next latitude, and so further).

Usage

1
GetLatLonField(data, simplify = FALSE)

Arguments

data

a "pField" or "pTs" object for which to return the lat/lon fields.

simplify

if FALSE (the default), the fields are returned as a two component list, otherwise as a 2 x n matrix, where the first row is the latitude and the second row the longitude field.

Value

a two component list or 2 x n matrix.

Author(s)

Thomas Laepple

Source

Function copied from "basis.R" in paleolibary/src/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
field <- pField(lat = seq(0, 90, 10), lon = c(-10, 0, 10))

latlons <- GetLatLonField(field)
latlons$lat2d
latlons$lon2d

# subset incompletely to create a pTs object
field <- field[, 1 : 4]
latlons <- GetLatLonField(field)
latlons$lat2d
latlons$lon2d

EarthSystemDiagnostics/pfields documentation built on Jan. 10, 2022, 10:37 p.m.