harp wrapper to the tobac function tracking.linking_trackpy().

link_tracks(
  features,
  field_data,
  dz = NULL,
  data_col = "gridded_data",
  dttm_col = "valid_dttm",
  d_max = NULL,
  subnetwork_size = NULL,
  v_max = NULL,
  memory = 0,
  stubs = 1,
  time_cell_min = NULL,
  order = 1,
  extrapolate = 0,
  method_linking = c("predict", "random"),
  adaptive_step = NULL,
  adaptive_stop = NULL,
  cell_number_start = 1,
  cell_number_unassigned = -1,
  vertical_coord = NULL,
  min_h1 = NULL,
  max_h1 = NULL,
  min_h2 = NULL,
  max_h2 = NULL,
  pbc_flag = c("none", "hdim_1", "hdim_2", "both")
)

Arguments

features

A features data frame as returned by detect_features_multithreshold() or segment_2d()

field_data

A harp_grid_df data frame such as one returned by the harpIO functions harpIO::read_grid() with data_frame = TRUE, harpIO::read_forecast(), or harpIO::read_analysis().

dz

Constant vertical grid spacing (meters), optional. If not specified and the input is 3D, this function requires that vertical_coord is available in the features input. If you specify a value here, this function assumes that it is the constant z spacing between points, even if vertical_coord is specified.

data_col

<tidy-select> The column in field_data containing the fields to be used to detect features in. Should be a <geolist> column. If the named column is not found in field_data, but field_data contains 1 <geolist> column, that <geolist> column is used.

dttm_col

<tidy-select> The column in field_data containing the date-times to be used for the time dimension. Can be numeric with units in Unix time (seconds since 1970-01-01 00:00:00), or a <POSIXt>column. If the named column is not found in field_data, but field_data contains 1 <POSIXt> column, that <POSIXt> column is used.

d_max

Maximum search range in metres. Only one of d_max, or v_max can be set. Default is NULL.

subnetwork_size

Maximum size of subnetwork for linking. This parameter should be adjusted when using adaptive search. Usually a lower value is desired in that case. For a more in depth explanation have look here. If NULL, 30 is used for regular search and 15 for adaptive search. Default is NULL.

v_max

Speed at which features are allowed to move in m/s. Only one of d_max or v_max can be set. Default is NULL.

memory

Number of output timesteps features allowed to vanish for to still be considered tracked. Default is 0. Warning :: This parameter should be used with caution, as it can lead to erroneous trajectory linking, espacially for data with low time resolution.

stubs

Minimum number of timesteps of a tracked cell to be reported. Default is 1

time_cell_min

Minimum length in time that a cell must be tracked for to be considered a valid cell in seconds. Default is NULL.

order

Order of polynomial used to extrapolate trajectory into gaps and on start and end point. Default is 1.

extrapolate

Number or timesteps to extrapolate trajectories. Currently unused. Default is 0.

method_linking

Flag choosing method used for trajectory linking. Can be "predict" or "random". Default is ‘predict’. Note: the default in tobac is "random" though they typically encourage users to use ‘predict’.

adaptive_step

Reduce search range by multiplying it by this factor. Needs to be used in combination with adaptive_stop. Default is NULL.

adaptive_stop

If not NULL, when encountering an oversize subnet, retry by progressively reducing search_rangeby multiplying withadaptive_stepuntil the subnet is solvable. If search_range becomes <=adaptive_stop, give up and raise a SubnetOversizeException. Needs to be used in combination with adaptive_step. Default is NULL`.

cell_number_start

Cell number for first tracked cell. Default is 1.

cell_number_unassigned

Number to set the unassigned/non-tracked cells to. Default is -1.

vertical_coord

Name of the vertical coordinate. The vertical coordinate used must be metres. If NULL, it tries to auto-detect. It looks for the coordinate or the dimension name corresponding to the string. To use dz, set this to NULL`.

min_h1

Minimum hdim_1 value, required when pbc_flag is "hdim_1" or "both".

max_h1

Maximum hdim_1 value, required when pbc_flag is "hdim_1" or "both".

min_h2

Minimum hdim_2 value, required when pbc_flag is "hdim_2" or "both".

max_h2

Maximum hdim_2 value, required when pbc_flag is "hdim_2" or "both".

pbc_flag

Sets whether to use periodic boundaries, and if so in which directions. "none" means that we do not have periodic boundaries "hdim_1" means that we are periodic along hdim1, "hdim_2" means that we are periodic along hdim2 and "both" means that we are periodic along both horizontal dimensions

Value

Data frame of the linked features, containing the column "cell", with integers indicating the affiliation of a feature to a specific track, and the variable "time_cell" with the time, in seconds' the cell has already existed.