pycoastkit.recovery¶
Beach recovery after storms.
After a storm the beach usually rebuilds as sand returns from the surf zone.
:func:storm_recovery measures how much of the storm erosion came back
within a fixed number of days, and :func:post_storm_conditions summarises
the waves during that recovery window.
storm_recovery
¶
Recovery of each beach indicator n_days after the post-storm survey.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
DataFrame
|
Output of :func: |
required |
beach
|
Series or DataFrame
|
The same time-indexed beach indicators used for the response. |
required |
n_days
|
float
|
Length of the recovery window, counted from the post-storm survey. |
10
|
max_search_days
|
float
|
Tolerance for finding a survey near the end of the window (the last
valid survey on or before |
3
|
min_loss
|
float or dict
|
Smallest erosion for which the recovery ratio is computed (per indicator if a dict). The ratio is unstable for small erosion; below this value it is NaN. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
Source code in src/pycoastkit/recovery.py
post_storm_conditions
¶
Statistics of wave (or water-level) variables in the window after each storm.
The window runs from start (default: the storm's last stormy sample)
to n_days later. Columns are named post_<stat>_<variable>.
Example
post_storm_conditions(storms, waves, {"hs": ["mean", "max"], "ts": "mean"})
Source code in src/pycoastkit/recovery.py
iqr_outliers
¶
Tukey fences: True where a value lies outside [Q1 - k·IQR, Q3 + k·IQR].
Useful for removing extreme recovery ratios before statistics.