tobac.merge_split.merge_split_MEST#

tobac.merge_split.merge_split_MEST(tracks, dxy, dz=None, distance=None, frame_len=5, cell_number_unassigned=-1, vertical_coord=None, PBC_flag=None, min_h1=None, max_h1=None, min_h2=None, max_h2=None)#

Search for merging splitting cells in tobac tracking data using a minimum euclidian spanning tree, and combine the merged cells into unique tracks.

Parameters:
  • tracks (pandas.core.frame.DataFrame) – Pandas dataframe of tobac Track information

  • dxy (float) – The x/y grid spacing of the data. Should be in meters.

  • dz (float, optional) – Constant vertical grid spacing (m), default None. If None, the vertical coord will be inferred automatically or from a specified coord given by the vertical_coord parameter. An exception is raised if both dz and vertical_coord are provided.

  • distance (float, optional) – Distance threshold determining how close two features must be in order to consider merge/splitting. Default is 25x the x/y grid spacing of the data, given in dxy. The distance should be in units of meters.

  • frame_len (float, optional) – Threshold for the maximum number of frames that can separate the end of cell and the start of a related cell, by default 5 frames.

  • cell_number_unassigned (int, optional) – Value given tp unassigned/non-tracked cells by tracking, by default -1.

  • vertical_coord (str, optional) – Name of the vertical coordinate, default None. The vertical coordinate used must have values in meters. If None, tries to auto-detect, or uses constant vertical grid spacing if dz is specified. An exception is raised if both dz and vertical_coord are provided.

  • PBC_flag (str('none', 'hdim_1', 'hdim_2', 'both'), optional) – 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 ‘both’ means that we are periodic along both horizontal dimensions

  • min_h1 (int, optional) – Minimum real point in hdim_1, for use with periodic boundaries.

  • max_h1 (int, optional) – Maximum point in hdim_1, exclusive. max_h1-min_h1 should be the size of hdim_1.

  • min_h2 (int, optional) – Minimum real point in hdim_2, for use with periodic boundaries.

  • max_h2 (int, optional) – Maximum point in hdim_2, exclusive. max_h2-min_h2 should be the size of hdim_2.

Returns:

  • d (xarray.core.dataset.Dataset) –

    xarray dataset of tobac merge/split cells with parent and child designations.

    Parent/child variables include:

    • cell_parent_track_id: The associated track id for each cell. All cells that have merged or split will have the same parent track id. If a cell never merges/splits, only one cell will have a particular track id.

    • feature_parent_cell_id: The associated parent cell id for each feature. All features in a given cell will have the same cell id. This is the original TRACK cell_id.

    • feature_parent_track_id: The associated parent track id for each feature. This is not the same as the cell id number.

    • track_child_cell_count: The total number of features belonging to all child cells of a given track id.

    • cell_child_feature_count: The total number of features for each cell.

  • Example usage – d = merge_split_MEST(Track) ds = tobac.utils.standardize_track_dataset(Track, refl_mask) both_ds = xr.merge([ds, d],compat =’override’) both_ds = tobac.utils.compress_all(both_ds) both_ds.to_netcdf(os.path.join(savedir,’Track_features_merges.nc’))

Return type:

xr.Dataset