visualdynamics.plot.averaging¶
averaging
¶
Averaging frames drawn on the time history they will be cut from.
A list of frame start times does not show whether the analysis covers the part of the record that was intended, so the frames are drawn on the plot.
Above the trace is a rail: one row of slots, each frame's window drawn in its slot and shaded under the curve, so the window is shown where it is set and not over the data it is applied to. Frames that overlap cannot share a row without their windows running through each other, so each takes the lowest row whose last frame has already ended. That gives one row at no overlap, two at half overlap and four at three quarters.
Under each frame's slot, a band runs down to the bottom of the plot. Its height shows which row the frame is in, so where two frames overlap there are two heights and a step between them. Each band's shading follows its frame's window, so it shows the weight each part of the record carries in the average.
The span of all the frames is one draggable region. Dragging its middle slides the analysis along the record; dragging an edge adds or removes frames. Only whole frames are used, so when the drag ends the edge moves to the end of the last whole frame.
A capture the controller already cut into frames has nothing to drag,
because the frame is the record. For it the region is drawn with
locked and cannot be moved.
Classes:
| Name | Description |
|---|---|
AveragingOverlay |
Averaging parameters drawn as marks on a time history plot. |
Classes¶
AveragingOverlay
¶
AveragingOverlay(plot: Any, averaging: Averaging, sample_rate: float, samples: int, colors: Mapping[str, str], locked: bool = False, parent: Any = None, origin: float = 0.0)
Bases: QObject
Averaging parameters drawn as marks on a time history plot.
The overlay owns every item it adds and removes all of them in
remove, so a redraw cannot leave a band behind. While it is up it
raises the top of the plot's y range to make room for the rail, and
remove gives the plot its own range back. A finished drag is
reported through changed and not acted on here: storing the new
averaging and updating the table are left to whatever created the
overlay.
samples is the record's length in samples, which a drag cannot
pass, and origin is the time of its first sample, the zero the
averaging's start counts from.
Methods:
| Name | Description |
|---|---|
remove |
Remove every mark from the plot. The overlay cannot be used after this. |
set_averaging |
Draw a different averaging, such as one edited in the table, without emitting |
Source code in src/visualdynamics/plot/averaging.py
Methods:¶
remove
¶
Remove every mark from the plot. The overlay cannot be used after this.