deltametrics.plan.compute_shoreline_distance(shore_mask, origin=[0, 0], return_distances=False)

Compute mean and stddev distance from the delta apex to the shoreline.

Algorithm computes the mean distance from the delta apex/origin to all shoreline points.


This calculation is subtly different than the “mean delta radius”, because the measurements are not sampled evenly along the opening angle of the delta.


uses np.nanmean and np.nanstd.

  • shore_mask (ShorelineMask, ndarray) – Shoreline mask. Can be a ShorelineMask object, or a binarized array.

  • origin (list, np.ndarray, optional) – Determines the location from where the distance to all shoreline points is computed.

  • return_distances (bool) – Whether to return the sorted line as a second argument. If True, a Nx2 array of x-y points is returned. Default is False.


  • mean (float) – Mean shoreline distance.

  • stddev (float) – Standard deviation of shoreline distance.

  • distances (np.ndarray) – If return_distances is True, then distance to each point along the shoreline is also returned as an array (i.e., 3 arguments are returned).


golf =

sm = dm.mask.ShorelineMask(
    golf['eta'][-1, :, :],

# compute mean and stddev distance
mean, stddev = dm.plan.compute_shoreline_distance(
    sm, origin=[golf.meta['CTR'].data, golf.meta['L0'].data])

# make the plot
fig, ax = plt.subplots()
golf.quick_show('eta', idx=-1, ticks=True, ax=ax)
ax.set_title('mean = {:.2f}'.format(mean))

(png, hires.png)