NE_Physics: A class for navigating FVCOM datasets

Description Public fields Active bindings Methods

Description

R6 base class

Public fields

filename

character, path or URL

NC

ncdf4 object

M

sf table of mesh

t0

POSIXct timestamp identifying the start time

verbose

logical for helpful messaging

Active bindings

open_bounds

provides the indices for open boundary elements (open water)

closed_bounds

provides the indices for closed boundary elements (shore)

Methods

Public methods


Method new()

Usage
NE_Physics$new(
  filename,
  origin = as.POSIXct("1858-11-17 00:00:00", tz = "UTC"),
  verbose = FALSE
)
Arguments
filename

character either a filename or OpenDAP URL

origin

POSIXct timestamp indicating the start of the experiment

verbose

logical for helpful messaging

crs

Method print()

Pretty print

Usage
NE_Physics$print()

Method get_crs()

Retrieve the CRS

Usage
NE_Physics$get_crs(form = c("proj", "wkt")[1])
Arguments
form

character, one of 'proj', 'wkt'

Returns

CRS in the specified form


Method get_time()

retrieve the time relative to some epoch/origin

Usage
NE_Physics$get_time(origin = self$t0, ...)
Arguments
origin

POSIXct the orogin of relative timestamps

...

other arguments for fvcom_time


Method random_points()

Retriev one or more random points

Usage
NE_Physics$random_points(n = 1, select_time = c("first", "last", "random")[1])
Arguments
n

numeric, the number of points to generate

select_time

character, one of 'first' (default), 'last' or 'random'

Returns

sf object of class POINT


Method char_size()

find proxy for characteristic size based upon element size

NOTE if we update GEOS we could get size of inscribed circle

Usage
NE_Physics$char_size(what = c("min", "max", "square", "circle")[4])
Arguments
what

character

  • min or square - side length of sqaure with equivalent area

  • max - side of square with double the area (or 1.4*sqrt(area))

  • circle - radius of circle with equivalent area

x

element mesh as sf

Returns

numeric characteristic size


Method mesh_metrics()

generate kinematics metrics for a given mesh

Usage
NE_Physics$mesh_metrics(
  ofile = file.path(dirname(self$filename), "mesh-elem-metrics.csv.gz")
)
Arguments
ofile

optional file to save to (as non-spatial CSV)

Returns

mesh (invisibly) with variables added including


Method append_bounds()

append the boundary info to the mesh table

Usage
NE_Physics$append_bounds()
Returns

mesh invisibly with appended boundary variable where


Method clone()

The objects of this class are cloneable with this method.

Usage
NE_Physics$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


BigelowLab/necofs documentation built on Jan. 7, 2022, 11:59 a.m.