sandplover.plan.compute_shoreline_length¶
- sandplover.plan.compute_shoreline_length(shore_mask, origin=(0, 0), return_line=False)¶
Compute the length of a shoreline from a mask of the shoreline.
Algorithm attempts to determine the sorted coordinates of the shoreline from a
ShorelineMask.Warning
Imperfect algorithm, which may not include all True pixels in the ShorelineMask in the determined shoreline.
- Parameters:
shore_mask (
ShorelineMask,ndarray) – Shoreline mask. Can be aShorelineMaskobject, or a binarized array.origin (
list,np.ndarray, optional) – Determines the location from where the starting point of the line sorting is initialized. The starting point of the line is determined as the point nearest to origin. For non-standard data configurations, it may be important to set this to an appropriate value. Default is [0, 0].return_line (
bool) – Whether to return the sorted line as a second argument. If True, aNx2array of x-y points is returned. Default is False.
- Returns:
length (
float) – Shoreline length, computed as described above.line (
np.ndarray) – Ifreturn_lineis True, the shoreline, as anNx2array of x-y points, is returned.
Examples
Compare the length of the shoreline early in the model simulation with the length later. Here, we use the elevation_offset parameter (passed to
ElevationMask) to better capture the topography of the pyDeltaRCM model results.(
Source code,png,hires.png)