visualdynamics.plot.half_power¶
half_power
¶
A half-power reading drawn on the peak it was read from.
The reading (core.half_power.read_half_power) is three numbers a
reader would otherwise take off the plot with a ruler: the half-power
level, the two frequencies where the curve crosses it, and Q. Drawing
them on the curve is how a reader checks the numbers, because a
crossing placed on a shoulder or a level taken from the wrong peak is
obvious on the plot and invisible in a table.
The overlay is a dotted line at 0.707 of the peak, reaching half a width past each crossing so it reads as a level and not a segment of the curve; a hollow circle on each crossing; a filled diamond on the top as read between lines; and the Q beside the lower crossing. Dotted, because a dashed curve already means a synthesis drawn over a measurement. Shapes and the dots, not a color, tell it from the curves under it: the overlay takes one color, the plot's foreground unless the caller passes another (the fitting screen passes its cursor's), so nothing in it is told apart by hue alone.
The items go on the plot's view box, not the plot: they are a reading of the data, not data, so the plot's data items (which its legend, its copy and its filtering preview read) never include them. A plot converts only its own data items to a log axis, so the overlay converts itself, from the axes as they are when it is shown.
HalfPowerOverlay owns its items and moves them, so a display that
reads on every mouse move updates the same items instead of rebuilding
them; add_half_power draws one reading once, for a figure.
Classes:
| Name | Description |
|---|---|
HalfPowerOverlay |
The items that draw one half-power reading on a pyqtgraph plot. |
Functions:
| Name | Description |
|---|---|
label_text |
What the overlay writes beside the peak: the Q, and when the |
add_half_power |
Draw |
Classes¶
HalfPowerOverlay
¶
The items that draw one half-power reading on a pyqtgraph plot.
Made once per plot with plot, the PlotItem to draw on, and
color, a pyqtgraph color (the plot's foreground by default); then
show(reading, scale) places them and clear() hides them. scale
multiplies the reading's height and level before drawing, for a
curve drawn in other units than it was read in. The items ignore
the plot's bounds, so drawing them never re-zooms the view.
Methods:
| Name | Description |
|---|---|
show |
Place the overlay on |
clear |
Hide the overlay until the next |
Source code in src/visualdynamics/plot/half_power.py
Methods:¶
show
¶
Place the overlay on reading, a HalfPower.
Source code in src/visualdynamics/plot/half_power.py
clear
¶
Functions:¶
label_text
¶
What the overlay writes beside the peak: the Q, and when the reading rests on too few lines or has no width, why it is not to be trusted, in as few words as the plot can carry.
Source code in src/visualdynamics/plot/half_power.py
add_half_power
¶
add_half_power(plot: Any, reading: Any, *, color: Any = None, scale: float = 1.0) -> HalfPowerOverlay
Draw reading, a HalfPower, on plot and return the overlay.
color and scale are as for HalfPowerOverlay.