pycoastkit.shoreline¶
Shoreline position from beach profiles, foreshore slope and shoreline QC.
The shoreline is where a cross-shore profile crosses a chosen water level
(for example mean high water springs, MHWS). Profiles are tables with one
row per survey and one column per cross-shore position [m], increasing
seaward (see :mod:pycoastkit.beach).
shoreline_position
¶
Cross-shore position where one profile crosses water_level.
The profile is scanned seaward for down-crossings (bed going from above to below the level); the crossing is interpolated linearly between the two survey points around it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array - like
|
Cross-shore positions [m], increasing seaward. |
required |
elevation
|
array - like
|
Bed elevation [m] at |
required |
water_level
|
float
|
Shoreline-defining level [m], in the survey datum. |
required |
crossing
|
('seaward', 'landward')
|
Which down-crossing to return when there are several (an emerged
bar or a runnel gives more than one). |
"seaward"
|
Returns:
| Type | Description |
|---|---|
float
|
Shoreline position [m]; NaN if the profile never crosses the level. |
Source code in src/pycoastkit/shoreline.py
shoreline_positions
¶
Shoreline position [m] for every survey.
smooth_sigma (grid points) smooths the profiles first with
:func:pycoastkit.smooth_profiles; smoothing suppresses false crossings
caused by survey noise.
Source code in src/pycoastkit/shoreline.py
foreshore_slope
¶
Mean foreshore slope between two water levels (e.g. MHWS and low water).
slope = (upper_level - lower_level) / (x_lower - x_upper), positive
when the beach falls seaward. Both contours use the same crossing rule.
At Hasaki: upper_level=1.25 (MHWS), lower_level=-0.2 (low water).
Source code in src/pycoastkit/shoreline.py
flag_shoreline_outliers
¶
Flag surveys whose shoreline jumps away from their neighbours.
A centred rolling mean and standard deviation over window surveys give
a local z-score; |z| > z_threshold is flagged. Inspect flagged surveys
(e.g. with :func:pycoastkit.plot.plot_profiles) before removing them -
real storm erosion can also be abrupt.
Returns shoreline, rolling_mean, rolling_std, z_score, is_outlier.