interpolate_var: Given a set of points within the mesh, interpolate a variable...

View source: R/FVCOMPhysics.R

interpolate_varR Documentation

Given a set of points within the mesh, interpolate a variable such as bathymetry.

Description

Note that some variables are colocated with nodes, while others are associated with elements (triangular faces). The former require interpolation, the later requires more prep but no interpolation. The first dimension of any requested variable must be 'node' (implemented) or "nele" (not implemented). Any other is an error.

Usage

interpolate_var(p, X, var = "h")

Arguments

p

sf POINT object

X

FVCOMPhysics object with an element mesh

var

character the variable to interpolate (bathymetry is h)

Details

Nodes: We could just find the mean var of the three nodes surrounding each element, but that assumes the point in in the centroid of the element which is likely to not be the case. So, this uses simple plane geometry to interpolate the depth at an arbitrary location within the mesh.

Value

numeric vector of interpolates, NA where points fall outside of the mesh


BigelowLab/fvcom documentation built on Nov. 8, 2024, 2:24 p.m.