differt.geometry.merge_cell_ids#
- merge_cell_ids(cell_ids_a, cell_ids_b)[source]#
Merge two arrays of cell indices as returned by
TracedPaths.multipath_cells.Let the returned array be
cell_ids, thencell_ids[i] == cell_ids[j]for alli,jindices if(groups_a[i], groups_b[i]) == (groups_a[j], groups_b[j]), granted that arrays have been reshaped to uni-dimensional arrays. Of course, this method handles multiple dimensions and will reshape the output array to match initial shape.For an actual application example, see Multipath Lifetime Map.
Warning
The indices used in the returned array have nothing to do with the ones used in individual arrays.
- Parameters:
cell_ids_a (
Int[ArrayLike, '*batch']) – First cell index array.cell_ids_b (
Int[ArrayLike, '*batch']) – Second cell index array.
- Return type:
- Returns:
Merged cell indices.