sl.contours | R Documentation |
Compute contour lines of a 2-dimensional field on an unstructured triangular mesh on a sphere.
sl.contours(var = NULL, var.nc = NULL, varid = NULL, levels = 0, grd = NULL, na.treatment = "none",
return.edge.info = FALSE, verbose = FALSE, neighmat = NULL, lat = NULL, lon = NULL, elem = NULL)
var |
a numeric vector of length |
var.nc |
a character providing the system location of a NetCDF file containing the field to be analysed. Used only if |
varid |
a character providing the name of the variable in |
levels |
a vector providing the values for which contour lines shall be computed. |
grd |
a spheRlab grid list as returned by |
na.treatment |
a character specifying how to handle |
return.edge.info |
a logical value specifiying whether information on end points of, and relative positions on, the edges corresponding to each point of the contour(s) shall be returned. Default is |
verbose |
a logical value specifiying whether additional statements shall be printed to document progress. Default is |
neighmat |
an |
lat |
a numeric vector of length |
lon |
a numeric vector of length |
elem |
an |
The algorithm implemented here does not work element-wise, but builds up contiguous contour segments step by step. Note that a linear evolution of the field on the elements (triangles) between the nodes is assumed.
A list with one element for each level. Each of these is another list with the following elements:
level |
a scalar giving the level of the contour. |
segments |
a list of lists for each segment with elements |
length |
a scalar giving the length of the contour, summing all segments. |
It is planned to extend this algorithm such that it works with any unstructured mesh based on polygons with any number of vertices. One simple way to achieve this would be to add a step at the beginning where any polygon with more than 3 vertices is decomposed into triangles, e.g. with a central reference point based on the polygon centroid.
Helge Goessling
## Example to be provided ...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.