characterise_flows: Check if a segment runs parallel to latitude or longitude

characterise_flowsR Documentation

Check if a segment runs parallel to latitude or longitude

Description

This function checks whether the transects created to sample the boundaries of model compartments lie on a lat-lon grid. If they do, then we know that when sampling meridional and zonal currents only one is needed per transect.

Usage

characterise_flows(lines, domain, precision = 1000)

Arguments

lines

An sfc object of lines representing transects along the perimeter of a model domain polygon.

domain

An sfc polygon object of the model domain, used to make the transects.

precision

How far apart should sampling points be (1/x degrees, larger numbers bring the points closer).

segment

An SF line object representing a transect along the perimeter of a model domain polygon.

Details

The function takes a boundary segment (transect) and reprojects it on a lat-lon grid. The coordinates are extracted, and checked for identical latitudes or longitudes.

Value

The function returns a dataframe detailing whether laitudues are the same and longitudes are the same along a segment.

The function returns a dataframe detailing which two model compartments are either side of the transect, and the direction of the exchange.

The function returns the lines object with added columns. If transects are ambiguosly labelled, a list is returned of the transects and the failed sampling locations.

See Also

Other Boundary sampling functions: boundaries(), to_segments()


Jack-H-Laverick/MiMeMo.tools documentation built on March 6, 2023, 3:44 p.m.