numbacs.extraction.ridges

Module Contents

numbacs.extraction.ridges.ftle_ridge_pts(f, eigvec_max, x, y, sdd_thresh=0.0, percentile=0)[source]

Compute FTLE ridge points by finding points (with subpixel accuracy) at which: ftle > 0 (or percentile of ftle), directional derivaitve of ftle (in eigvec_max direction) is 0, second directional derivative of ftle (in eigvec_max direction) is greater than sdd_thresh (in magnitude).

Parameters:
  • f (np.ndarray, shape = (nx,ny)) – ftle array.

  • eigvec_max (np.ndarray, shape = (nx,ny,2)) – maximum eigenvector of Cauchy Green tensor.

  • x (np.ndarray, shape = (nx,)) – array containing x-values.

  • y (np.ndarray, shape = (ny,)) – array containing y-values.

  • sdd_thresh (float, optional) – threshold for second directional derivative, should be at least 0. The default is 0.

  • percentile (int, optional) – percentile of ftle used for min allowed value. The default is 0.

Returns:

r_pts – ridge points.

Return type:

np.ndarray, shape = (ridge_bool.sum(),2)

numbacs.extraction.ridges.ftle_ridges(f, eigvec_max, x, y, sdd_thresh=0.0, percentile=0, min_ridge_pts=3)[source]

From ridge points from _ftle_ridges, extract connected ridges where a connected ridge is defined by a collection of points having continuous neighbors that are ridge points.

Parameters:
  • f (np.ndarray, shape = (nx,ny)) – ftle array.

  • eigvec_max (np.ndarray, shape = (nx,ny,2)) – maximum eigenvector of Cauchy Green tensor.

  • x (np.ndarray, shape = (nx,)) – array containing x-values.

  • y (np.ndarray, shape = (ny,)) – array containing y-values.

  • sdd_thresh (float, optional) – threshold for second directional derivative, should be at least 0. The default is 0.

  • percentile (int, optional) – percentile of ftle used for min allowed value. The default is 0.

  • min_ridge_pts (int) – minimum points allowed in ridge. The default is 3.

Returns:

list containing each connected ridge.

Return type:

list

numbacs.extraction.ridges.ftle_ordered_ridges(f, eigvec_max, x, y, dist_tol, ep_tan_ang=pi / 4, min_ridge_pts=5, sdd_thresh=0.0, percentile=0, c=1.0)[source]

Computes ftle ridge points and links points into ridges. After this is done, ridges that should be connected are searched for and connected if they meet certain critera. Criteria: if two ridges have endpoints that are within dist_tol and the angle between the tangent of the ridge at the endpoints and vector connecting the endpoints is less than ep_tan_ang, connect ridges.

Parameters:
  • f (np.ndarray, shape = (nx,ny)) – ftle array.

  • eigvec_max (np.ndarray, shape = (nx,ny,2)) – maximum eigenvector of Cauchy Green tensor.

  • x (np.ndarray, shape = (nx,)) – array containing x-values.

  • y (np.ndarray, shape = (ny,)) – array containing y-values.

  • dist_tol (float) – tolerance used to consider new endpoint for connection.

  • ep_tan_ang (float) – angle used to confirm endpoints are in line. The default is pi/4.

  • min_ridge_pts (int, optional) – minimum points allowed in ridge after endpoints are connected. The default is 5.

  • sdd_thresh (float, optional) – threshold for second directional derivative, should be at least 0.0. The default is 0.

  • percentile (int, optional) – percentile of ftle used for min allowed value. The default is 0.

  • c (float, optional) – scaling for angle portion of metric used in linking algorithm. The default is 1.0.

Returns:

ridges – list containing connected, ordered ridges.

Return type:

list