visualdynamics.viz.paired¶
paired
¶
Two densities on one stage: channels receding, paired per station.
The 3-D view of two selected PSDs, laid out as the banded stage is:
each shared channel is a station along the depth axis, and at each
station the two objects are drawn together, the loud one colored by
level and the quiet one in the muted gray of a compared reference.
The signal-to-noise view divides them instead: one curve per station,
in decibels on a linear axis, since the decibel value is what is read.
It uses waterfall_arrays for decimation, paging and labels, and
snr.signal_to_noise for the division, so the stage, the flat plots and
the report cannot disagree about a value. Nothing here uses Qt, like the
rest of viz.
Functions:
| Name | Description |
|---|---|
paired_arrays |
The two objects' curves, matched into stations by label. |
add_paired_stage |
Draw the pair into a plotter, overlaid or divided in dB. |
plot_paired_stage |
Show the paired stage of |
Classes¶
Functions:¶
paired_arrays
¶
paired_arrays(loud: Any, quiet: Any, loud_records: Sequence[int] | None = None, quiet_records: Sequence[int] | None = None, unit_system: UnitSystem | None = None, budget: int = POINT_BUDGET, quantity: tuple[str, str | None] | None = None, page: int = 0) -> dict[str, Any]
The two objects' curves, matched into stations by label.
Each object's curves come from waterfall_arrays (its records,
quantity and page), with half of budget points each. A station
exists where both objects have a record with the same label (DOF and
quantity, as record_label writes it); records only one side has are
left out and counted in unmatched. Returns a dict of
stations (each {'label', 'loud', 'quiet'}, the last two
(x, z) curves), unmatched, and the loud object's
log_scaled, xlabel, zlabel, page and pages.
Source code in src/visualdynamics/viz/paired.py
paired_stage_curves
¶
paired_stage_curves(loud: Any, quiet: Any, loud_records: Sequence[int] | None = None, quiet_records: Sequence[int] | None = None, mode: str = 'overlay', unit_system: UnitSystem | None = None, budget: int = POINT_BUDGET, quantity: tuple[str, str | None] | None = None, page: int = 0) -> dict[str, Any]
The pair placed on the stage, overlaid (mode 'overlay') or
divided ('ratio').
The paired counterpart of waterfall.stage_curves, separate for the
same reason: the app draws this stage in VTK and the report draws it
in a canvas, and two normalizations would give two pictures of one
measurement. Returns the dict of paired_arrays with runs added
(each {'station', 'points', 'levels', 'quiet', 'label'}, where
quiet marks the gray object of an overlay), the real
extents (x0, x1, z0, z1) the stage stands for, and drawn,
the number of stations.
In 'ratio' the division is snr.signal_to_noise at full resolution,
the same call the flat plot and the report's flat figure use, and
the channels are the flat plot's too (snr.picked): those of the
loud_records picked, or every shared channel when none of them is
shared, with quantity narrowing them. One station a channel, not
paged. The axis title becomes 'signal to noise [dB]'.
Source code in src/visualdynamics/viz/paired.py
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
add_paired_stage
¶
add_paired_stage(plotter: Any, loud: Any, quiet: Any, loud_records: Sequence[int] | None = None, quiet_records: Sequence[int] | None = None, mode: str = 'overlay', unit_system: UnitSystem | None = None, theme: Any = None, budget: int = POINT_BUDGET, quantity: tuple[str, str | None] | None = None, page: int = 0) -> dict[str, Any]
Draw the pair into a plotter, overlaid or divided in dB.
The numbers come from paired_stage_curves, which the report's
canvas figure uses too, with the same arguments; this function draws
them in VTK and labels the axes with the real ranges the stage
stands for. Returns that dict with points, the vertices drawn,
added.
Source code in src/visualdynamics/viz/paired.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |
plot_paired_stage
¶
plot_paired_stage(loud: Any, quiet: Any, mode: str = 'overlay', unit_system: UnitSystem | None = None, theme: Any = None, screenshot: str | None = None, show: bool = True) -> Any
Show the paired stage of loud and quiet interactively, or
render it to screenshot, overlaid or divided (mode, as in
paired_stage_curves). Returns the image array when rendering to a
file, and otherwise the plotter.