visualdynamics.plot.rms_check¶
rms_check
¶
The rms check, written on the autospectrum it checks.
The check (core.rms_check) is two numbers and the gap between them:
the rms from the area under the spectrum and the rms of the time
history it came from. A picture of the two would show nothing, since a
scaling error worth catching is a fraction of a decibel to a few
decibels and a windowed estimate is a few hundredths off, so the view
is the numbers themselves, in words, in the corner of the spectrum:
- the rms from the spectrum, then the rms from the time history, each in the display unit and named, never told apart by color;
- the gap in dB, signed, with the threshold it is judged against;
- the window's share of the gap, when the frames are known and the gap is over the threshold, so a gap that is all the window's reads as such;
- the verdict in words: agree, the window's gap, a scaling error named, or a gap to look for one behind, under a heading in bold that says 'agree', 'the window's gap', 'flagged' or 'not judged'.
The words go in one label pinned to the plot's top-right corner, in the plot's foreground color unless the caller passes another. It is parented to the view box rather than added to it, so it stays where it is through a zoom or a pan, takes no part in the plot's bounds, and is not data: the legend, the copy and the plot's preview never include it.
RmsCheckLabel owns its label and rewrites it, so a reading that is
redone (another threshold, another record) updates the same item;
add_rms_check writes one check once, for a figure.
Classes:
| Name | Description |
|---|---|
RmsCheckLabel |
The label that writes one rms check on a pyqtgraph plot. |
Functions:
| Name | Description |
|---|---|
heading |
The judgment in a word or two, the label's first line: 'agree' |
label_lines |
The lines the label writes, as plain text: the heading, both rms |
label_html |
The label as rich text for a pyqtgraph |
add_rms_check |
Write |
Classes¶
RmsCheckLabel
¶
RmsCheckLabel(plot: Any, color: Any = None, *, brief: bool = False, size: str = '9pt', z: float = 44.0)
The label that writes one rms check on a pyqtgraph plot.
Made once per plot with plot, the PlotItem to write on, and
color, a pyqtgraph color (the plot's foreground by default); then
show(check, ...) writes it and clear() empties it. brief
writes the heading and the gap alone, for the window's plot, whose
pane holds the rest.
Methods:
| Name | Description |
|---|---|
show |
Write |
text |
What the label says, as rich text; empty when cleared. |
clear |
Empty the label until the next |
remove |
Take the label off the plot for good. |
Source code in src/visualdynamics/plot/rms_check.py
Functions:¶
heading
¶
The judgment in a word or two, the label's first line: 'agree'
within the threshold, 'the window's gap' outside it when the window
is the whole of the gap, 'flagged' outside it otherwise, and 'not
judged' when there is no gap to judge (RmsCheck.unjudged).
Source code in src/visualdynamics/plot/rms_check.py
label_lines
¶
The lines the label writes, as plain text: the heading, both rms
(converted by scale into unit), the gap against its threshold,
the window's share when it bears on the verdict, and the verdict,
wrapped. brief keeps the heading and the gap alone, for a plot
with a pane beside it that holds the rest.
Source code in src/visualdynamics/plot/rms_check.py
label_html
¶
The label as rich text for a pyqtgraph LabelItem: the lines of
label_lines (brief as there), the heading in bold so the
judgment reads first.
Source code in src/visualdynamics/plot/rms_check.py
add_rms_check
¶
add_rms_check(plot: Any, check: Any, *, color: Any = None, unit: str = '', scale: float = 1.0) -> RmsCheckLabel
Write check, an RmsCheck, on plot and return the label.
color is as for RmsCheckLabel, the others as for
RmsCheckLabel.show.