particle_track: Track one or more particles

View source: R/track.R

particle_trackR Documentation

Track one or more particles

Description

Track one or more particles

Usage

particle_track(
  X,
  P0 = X$random_points(),
  tstep = 60,
  tmax = 3600 * 12,
  reverse = FALSE,
  drag = c(0, 0, 0),
  resistance = c(0, 0, 0),
  resistance_type = c("proportional", "constant")[1],
  fixed_z = FALSE,
  clip_z = TRUE,
  show_progress = FALSE,
  verbose = FALSE,
  filename = c("particle_track.geojson", NA)[2],
  overwrite = TRUE
)

Arguments

X

FVCOM_Physics object

P0

starting point(s), see NE_Physics$random_point

tstep

numeric, seconds between each iteration

tmax

numeric, number of seconds to run for

reverse

logical, if TRUE run the track reverse in time. It is an error to provide the seed point with a timestamp equivalent to the first timestep of the model. See random_point to set the seed with other timestamps

drag

numeric, a three element vector of drag factors in [x, y, z], like a sinking rate in z. Drag units must be the same as the units of u, v, and ww.

resistance

numeric, if non zero then apply this to the speed computed at each each time step. Negative to impeded progress, positive to add to progress. Zero has no effect

resistance_type

character, one of 'proportional' or 'constant' Proportional is a proportion of the speed, thus typically a fraction in the range of [-1, 1]. Constant is applied uniformly and is in the unit/time (typically m/s) of the data.

fixed_z

logical, if TRUE then depths are fixed to the initial depths, and drag is truncated to two elements.

clip_z

logical, if TRUE clip Z positions to be between surface and bathymetric depth.

show_progress

logical, if TRUE then show a progress bar

verbose

logical, if TRUE output messages (for development)

filename

an optional filename to save the track to or NA to skip

overwrite

logical, if TRUE allow overwriting of existing files

Value

sf object of type POINT


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