FVCOM_Physics: A class for navigating FVCOM datasets

FVCOM_PhysicsR Documentation

A class for navigating FVCOM datasets

Description

R6 base class suitable for inheritance by other classes

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

zvar

character, the variable to use as 'z' such as siglev or siglay

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
FVCOM_Physics$new(
  filename,
  origin = as.POSIXct("1858-11-17 00:00:00", tz = "UTC"),
  verbose = FALSE,
  zvar = c("siglev", "siglay")[1]
)
Arguments
filename

character either a filename or OpenDAP URL

origin

POSIXct timestamp indicating the start of the experiment

verbose

logical for helpful messaging

zvar

character, the variable to use as 'z' such as siglev or siglay

crs

Method print()

Pretty print

Usage
FVCOM_Physics$print()

Method get_crs()

Retrieve the CRS

Usage
FVCOM_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
FVCOM_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
FVCOM_Physics$random_points(
  n = 1,
  select_time = c("first", "last", "random")[1],
  select_z = c("random", "surface", "bottom")[1]
)
Arguments
n

numeric, the number of points to generate

select_time

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

select_z

numeric or character. If character then 'random' (default), 'surface', 'bottom'. If numeric then you specify your own in zvar units

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
FVCOM_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
FVCOM_Physics$mesh_metrics(
  ofile = c(NA, file.path(dirname(self$filename), "mesh-elem-metrics.csv.gz"))[1]
)
Arguments
ofile

optional file to save to (as non-spatial CSV) or NA/NULL to skip

Returns

mesh (invisibly) with variables added including

  • max_u, max_v, max_w maximum velocity by element over all sigma in m/s

  • area element area in m^2

  • char_dim characteristic dimension, for now the radius of the circle with equivalent area in m


Method mesh_depth()

Compute the mean depth of each mesh element

Usage
FVCOM_Physics$mesh_depth()
Returns

mesh (invisibly) with depth added


Method append_bounds()

append the boundary info to the mesh table

Usage
FVCOM_Physics$append_bounds()
Returns

mesh invisibly with appended boundary variable where

  • open indicates the element is boundaed on at least one side by open water

  • closed indicates the element is bounded on at least one side by shoreline

  • internal indicates the element is not on the boundary

  • unknown self-explanatory


Method plot()

Plot element mesh

Usage
FVCOM_Physics$plot(...)
Arguments
...

other arguments for plot


Method clone()

The objects of this class are cloneable with this method.

Usage
FVCOM_Physics$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

plot_mesh and plot_mesh_geometry


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