visualdynamics.plot.scalogram¶
scalogram
¶
Drawing a scalogram: time across, frequency up, magnitude as color.
One channel is drawn at a time, because the image is dense and a second one beside it at the same size is too hard to read.
The frequency axis is logarithmic. A wavelet's bandwidth is a constant fraction of its frequency, so the rows are evenly spaced in log frequency, and drawing them evenly spaced in linear frequency would put them in the wrong place. The image is drawn in log space and the axis is labeled in Hz.
The cone of influence is shaded over the image. Near each end of the record, over a time that is longer at lower frequencies, the values depend on where the record was cut and not only on the record. They look the same as the rest of the image, so the shading is the only way to tell them apart.
Functions:
| Name | Description |
|---|---|
scalogram_image |
Draw one channel's scalogram onto |
Functions:¶
scalogram_image
¶
scalogram_image(plot: Any, magnitude: ndarray, times: ndarray, frequencies: ndarray, colors: Mapping[str, str], *, label: str = '', units: str = '', omega0: float = OMEGA0, time_label: str = 'time [s]', levels: tuple[float, float] | None = None) -> Any
Draw one channel's scalogram onto plot, and return the image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot
|
PlotItem
|
Where to draw. Nothing on it is cleared; the caller owns the layout. |
required |
magnitude
|
ndarray
|
|
required |
times
|
ndarray
|
The record's clock, in seconds, one per column. |
required |
frequencies
|
ndarray
|
One per row, ascending, evenly spaced in log frequency. |
required |
colors
|
mapping
|
The theme. |
required |
label
|
str
|
The color bar's quantity and unit: the record's own, which the transform's amplitude normalization keeps. |
''
|
units
|
str
|
The color bar's quantity and unit: the record's own, which the transform's amplitude normalization keeps. |
''
|
omega0
|
float
|
The wavelet's width parameter, used to compute the cone of influence. |
OMEGA0
|
time_label
|
str
|
The bottom axis's label, units included. |
'time [s]'
|
levels
|
(float, float)
|
The color scale's ends. The default is zero to the largest finite magnitude. A caller drawing the magnitude in decibels, which is never above its reference, passes the range it wants. |
None
|
Returns:
| Type | Description |
|---|---|
ImageItem
|
The image, so the caller can change its levels. |