Description Usage Arguments Details Value Author(s) Examples
View source: R/select-fields.R
Select the timeseries from a "pField"
object at the grid point
nearest to a given pair of latitude and longitude values.
1 |
data |
a |
lat |
the latitude of the requested point. |
lon |
the longitude of the requested point. |
simplify |
logical; if |
verbose |
if |
This is a function in development; the current method to find the nearest
grid point is to minimise the root mean square deviation between the
position vectors in spherical coordinates of the requested point and all
observation points in the "pField"
object, which is done by calling
MinimizeSpherical
. In the future, a different
method may be implemented for this. Note that requested lat/lon values
outside the range of grid points in data
will be processed with a
warning.
a "pTs"
or "pField"
(if simplify = FALSE
)
object with the time series at the grid point nearest to the requested
point.
Thomas Münch
1 2 3 4 5 6 7 8 9 10 | # Create some empty pField object
lat <- seq(-75, -80, -5)
lon <- c(0, 135, 215)
time <- 1 : 4
x <- pField(lat = lat, lon = lon, time = time)
# Extract grid point nearest to lat = -80, lon = 200:
SelPoint(x, lat = -80, lon = 200, verbose = TRUE)
SelPoint(x, lat = -80, lon = 200, simplify = FALSE, verbose = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.