View source: R/eroded.areas.sphwin.R
eroded.areas.sphwin | R Documentation |
Computes the areas of successive morphological erosions of a window, where the window is a sphere or subset of a sphere.
eroded.areas.sphwin(win = sphwin(type = "sphere"), r=NULL, method = "exact", ...)
win |
The window. |
r |
Numeric vector of radii at which erosions will be performed. Must have
length 512, and must be specified if |
method |
(For spherical wedges only) specifies the method used to
estimate/calculate the area morphological erosions of the window.
Must be one of |
... |
(For spherical wedges where method= |
This function computes the areas of the erosions of the window w by
each of the radii r[i]
.
The morphological erosion of a set W by a distance r > 0 is the subset consisting of all points x in W such that the distance from x to the boundary of W is greater than or equal to r. In other words it is the result of trimming a margin of width r off the set W.
The argument r should be a vector of nonnegative numbers. The argument
w should be a window (an object of class "sphwin"
, see
sphwin
).
For the sphere, eroded.areas.sph
returns a length 512 numeric
where each value is the area of the sphere, since the erosions cannot
exist because there are no boundaries on the sphere.
For the spherical wedge, it is recommended that the exact method of calculating the areas of the morphological erosions (method="exact") as it exactly calculates the areas and has the least computation time of the three methods.
Alternatively, there are two estimates of the morphological erosions of the spherical wedge. The first estimator is "integral", which involves estimating the integral formula for the morphological erosion:
integral[0, r] length(delta(W[-s])) ds
This is a relatively accurate estimator and has a similar computation time to the exact method.
The second estimator, which is also the estimator used for the
spherical polygon, is "grid"
, which involves superimposing a grid of
cells of equal area and angular width; for each r, the total number
of cells for which the centre is >=r from the boundary of the
wedge is found and the result multipled by the area of a single cell.
This method is the slowest and generates a curve which is only smooth
when the grid is sufficiently fine. This estimator requires further
arguments to be sent to gridmat
; for the spherical
polygon, all arguments that gridmat
needs are required
i.e. colats, lons, ncolat, nlon
. For the spherical wedge, only
ncolat, nlon
are required; eroded.areas.sph
calculates
the values of colats, lons
.
A vector containing the areas of morphological erosions of the sphere.
This function is the analogue for point processes on the sphere of the
function eroded.areas
in spatstat, which
is the corresponding function for point processes in R^2. Hence
elements of this help page have been taken from
eroded.areas
with the permission of A. J
Baddeley. This enables the information on this help page to be
consistent with that for eroded.areas
. It is
hoped that this will minimise or remove any confusion for users of
both spatstat and spherstat.
Tom Lawrence <email:tjlawrence@bigpond.com>
area.sphwin
(area of a sphere or subset of a sphere),
bdist.sphwin
(minimum distance from each of one or more
points to the boundary of a window).
sph <- sphwin(type="sphere") eroded.areas.sphwin(win=sph, r=seq(0, pi, length=512)) sphwedge <- sphwin(type="wedge", param=c(pi/3, 0), ref=c(0,0)) eroded.areas.sphwin(win=sphwedge, r=seq(0, pi/6, length=512), method="exact")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.