pycoastkit.beach¶
Beach profiles: smoothing, shoreline-relative coordinates, volumes and slopes.
A profile table is a DataFrame with one row per survey (DatetimeIndex) and
one column per cross-shore position. Column labels are positions in metres,
increasing seaward; labels such as "-40m" are accepted. Values are bed
elevations in metres.
cross_shore_positions
¶
Convert column labels such as "-40m", "5 m" or 60 to floats [m].
smooth_profiles
¶
Gaussian smoothing of each profile along the cross-shore axis.
sigma is in grid points (sigma=2 on a 5 m grid = 10 m). Missing values
are handled by normalised convolution, so a gap does not spread NaN to its
neighbours; positions that were missing stay missing.
Source code in src/pycoastkit/beach.py
shoreline_relative_profiles
¶
Re-express each profile in coordinates relative to its own shoreline.
x' = x - shoreline, so x' = 0 is the shoreline of that survey and
positive x' is seaward. Elevations are linearly interpolated onto
x_relative (default: -80 m to 340 m every 5 m); positions outside the
surveyed range are NaN. Use this to compare features such as sandbars or
zone volumes at a fixed distance from the shoreline.
Source code in src/pycoastkit/beach.py
beach_volume
¶
Sand volume per metre of beach [m³/m] between x_min and x_max.
Volume = integral of elevation - base over x (Simpson's rule). Works on
absolute or shoreline-relative profiles (e.g. inner zone
x_min=20, x_max=170 and outer zone 170-340 m from the shoreline).
Surveys with a missing value inside the zone get NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profiles
|
DataFrame
|
Profile table (rows = surveys, columns = cross-shore positions). |
required |
x_min
|
float
|
Zone limits [m]; the whole profile when omitted. |
None
|
x_max
|
float
|
Zone limits [m]; the whole profile when omitted. |
None
|
base
|
('min', float or array - like)
|
Reference surface. |
'min'
|
Returns:
| Type | Description |
|---|---|
Series
|
Volume per survey [m³/m], named |
Source code in src/pycoastkit/beach.py
cut_and_fill
¶
Erosion (cut) and deposition (fill) between two surveys of one profile.
before and after are Series (index = cross-shore position) or rows
of a profile table. Elevation changes are integrated separately where the
bed went down (cut) and up (fill), using the trapezoidal rule.
Returns {"cut": m³/m eroded (>= 0), "fill": m³/m deposited (>= 0),
"net_loss": cut - fill}.
Source code in src/pycoastkit/beach.py
profile_slope
¶
Mean bed slope between positions x1 and x2 (landward to seaward).
slope = (z(x1) - z(x2)) / (x2 - x1), positive when the bed falls
seaward. Elevations are linearly interpolated, so x1/x2 need not be
grid points. On shoreline-relative profiles, x1=0, x2=150 gives the
nearshore slope seaward of the shoreline.