Plotting¶
Dataset-agnostic DMD visualisation.
plotting ¶
Dataset-agnostic DMD visualisation.
Hawk-specific marker plots live in hawk. This module provides
general-purpose DMD plots: amplitude ranking, mode dynamics,
cumulative RMSE comparison, and convergence analysis.
Functions:
| Name | Description |
|---|---|
plot_amplitude_ranking |
Scree-style amplitude vs. rank plot. |
plot_mode_dynamics |
Temporal dynamics stacked by conjugate pair. |
plot_cumulative_rmse |
Bar chart of cumulative RMSE as pairs are added. |
plot_convergence |
RMSE and variance explained vs. mode count. |
plot_amplitude_ranking ¶
plot_amplitude_ranking(markers: ndarray, times: ndarray, max_modes: int = 20, d: int = 2, eig_constraints: set | None = None, figsize: tuple[int, int] = (6, 2), normalise_fn: Callable | None = None) -> tuple[Figure, Axes, np.ndarray]
Plot DMD mode amplitudes vs. rank.
Fits a standalone BOPDMD with max_modes modes and plots the sorted absolute amplitudes. Useful for choosing the SVD rank.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
markers
|
ndarray
|
Marker data (any shape accepted by |
required |
times
|
ndarray
|
Corresponding time vector. |
required |
max_modes
|
int
|
Number of modes to fit. |
20
|
d
|
int
|
Hankel delay. |
2
|
eig_constraints
|
set
|
Passed to BOPDMD. |
None
|
figsize
|
tuple
|
Figure size. |
(6, 2)
|
normalise_fn
|
callable
|
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
fig |
Figure
|
|
ax |
Axes
|
|
sorted_amplitudes |
ndarray
|
|
Source code in src/birddmd/plotting.py
plot_mode_dynamics ¶
plot_mode_dynamics(times: ndarray, result: DMDResult, title_prefix: str = '', x_lim: tuple[float, float] | None = None, y_lim: float | list[float] | None = None, axes_visible: bool = True) -> Figure
Plot temporal dynamics stacked by conjugate pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
times
|
ndarray
|
Time vector (typically |
required |
result
|
DMDResult
|
DMD analysis result. |
required |
title_prefix
|
str
|
Prepended to each subplot title. |
''
|
x_lim
|
tuple of float
|
|
None
|
y_lim
|
float or list of float
|
Symmetric y-limits. A list sets per-pair limits. |
None
|
axes_visible
|
bool
|
Whether to show grid/labels on all subplots. |
True
|
Returns:
| Type | Description |
|---|---|
Figure
|
|
Source code in src/birddmd/plotting.py
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
plot_convergence ¶
Plot RMSE and variance explained vs. mode count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
dict
|
Output of |
required |
Returns:
| Type | Description |
|---|---|
Figure
|
|