pycoastkit.storms¶
Find wave storms in a significant-wave-height record and group them into clusters.
A storm is a period in which Hs stays above a duration threshold for long enough and, at its peak, reaches a higher peak threshold. Storms separated by a short calm spell are not independent: they form a storm cluster whose combined effect on the beach is usually larger than that of a single storm.
StormCriteria
dataclass
¶
Thresholds that define a storm.
The defaults (1.5 m, 2.5 m, 6 h, 48 h) are the storm definition used for the Hasaki coast, Japan (Pacific, Kashima-nada).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hs_threshold
|
float
|
Hs [m] above which the sea is "stormy"; sets the storm start and end. |
1.5
|
peak_threshold
|
float
|
Hs [m] the storm must reach at least once to count (impact threshold). |
2.5
|
min_duration_h
|
float
|
Minimum time [h] above |
6.0
|
min_separation_h
|
float
|
Storms with a calm spell of this many hours or less between them are grouped into one cluster (meteorological independence criterion). |
48.0
|
storm_power
¶
Storm power index peak_hs**2 * duration_h [m² h] (Dolan & Davis 1992).
find_storms
¶
Find storms and label them as individual or clustered.
How it works
- Each run of consecutive samples with
Hs > hs_thresholdis a candidate. Missing values and data gaps longer than 1.5 sampling intervals end a run. - Duration = time from the first exceedance to the first sample back below the threshold (= number of samples x sampling interval).
- Keep runs with
duration >= min_duration_handpeak >= peak_threshold. - Storms whose calm gap to a neighbour is
<= min_separation_hshare acluster_id; a cluster of one storm is an individual storm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waves
|
DataFrame or Series
|
Time-indexed significant wave height [m] (column |
required |
criteria
|
StormCriteria
|
Storm definition; defaults to |
None
|
hs_column
|
str
|
Name of the Hs column when |
'hs'
|
sampling_interval_h
|
float
|
Time between samples [h]; inferred from the index when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per storm: |
Source code in src/pycoastkit/storms.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
storm_clusters
¶
Combine the storms of each cluster into one event.
Returns one row per cluster_id: kind, n_storms, start_time, end_time,
span_h (first start to last end), duration_h (sum of storm
durations), peak_hs, peak_time, mean_hs (duration-weighted),
storm_power (sum over the storms). Individual storms are returned as
clusters of one, so the result can be analysed as a single event table.
Any extra numeric columns starting with mean_/max_/min_ (for
example from :func:add_storm_wave_statistics) are combined with a
duration-weighted mean, maximum or minimum.
Source code in src/pycoastkit/storms.py
add_storm_wave_statistics
¶
Add statistics of any wave variable during each storm.
Example
add_storm_wave_statistics(storms, waves, {"t0": ["mean", "max"], "hmax": "max"}) adds the columns
mean_t0,max_t0andmax_hmax.
Each storm window runs from start_time to end_time (inclusive).
Direction columns should be averaged with a circular mean - use the
statistic "circmean" for directions in degrees.
Source code in src/pycoastkit/storms.py
storms_per_month
¶
Number of storms starting in each calendar month (1-12) - seasonality.
Source code in src/pycoastkit/storms.py
storms_per_year
¶
Number of storms starting in each year.
Source code in src/pycoastkit/storms.py
add_storm_energy
¶
Add the wave energy delivered by each storm, energy_mj_per_m [MJ/m].
The wave energy flux (:func:pycoastkit.wave_energy_flux, deep water
unless depth_m is given) is integrated over time from start_time
to end_time with the trapezoidal rule, using the actual time steps,
so hourly and 2-hourly records give comparable values. Also adds
max_energy_flux_kw_per_m [kW/m].