visualdynamics.viz.scalogram¶
scalogram
¶
The scalogram as a surface: time across, frequency back, amplitude up.
The flat picture puts magnitude in colour, which is the honest way to draw three quantities on two axes and is also the way a level is hardest to read — a viridis square is a number only as accurately as the eye can match it against a bar. A surface puts the third quantity on a third axis, where a ridge is a ridge and a floor is flat, and keeps the colour as well, so the same value is said twice.
That is principle 1's rule, and it is why 3-D is what this reading opens in (Brandon, 2026-08-27): where a reading has a natural 3-D form, it gets one, and a scalogram's is about as natural as they come — it is already a function of two variables.
The depth axis is log frequency, spaced as the transform's own rows are: a wavelet's bandwidth is a constant fraction of its centre frequency, so the rows are evenly spaced by octave and drawing them evenly spaced in linear frequency would put the surface's own rows where they do not belong. The axis is labelled back in Hz.
The cone of influence is drawn here too, as a translucent wall standing where the edges reach in. On the flat picture it is a veil over the suspect region; here it is a surface the ridge passes behind, which is the same statement in the geometry the eye is already reading.
Functions:
| Name | Description |
|---|---|
add_scalogram |
Draw one channel's scalogram as a surface, and say what it stands for. |
Functions:¶
add_scalogram
¶
add_scalogram(
plotter: Any,
magnitude: ndarray,
times: ndarray,
frequencies: ndarray,
*,
theme: Any = None,
omega0: float = OMEGA0,
time_label: str = "time [s]",
level_label: str = "amplitude",
) -> dict[str, Any]
Draw one channel's scalogram as a surface, and say what it stands for.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plotter
|
Plotter
|
Cleared by the caller, as the waterfall's is. |
required |
magnitude
|
ndarray
|
|
required |
times
|
ndarray
|
Seconds, one per column. |
required |
frequencies
|
ndarray
|
Hz, one per row, ascending and spaced evenly by octave. |
required |
theme
|
optional
|
The theme name or mapping. |
None
|
omega0
|
float
|
The wavelet's width, for the cone. |
OMEGA0
|
time_label
|
str
|
Axis titles, units included. |
'time [s]'
|
level_label
|
str
|
Axis titles, units included. |
'time [s]'
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in src/visualdynamics/viz/scalogram.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 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 | |