visualdynamics.plot.srs_tolerance¶
srs_tolerance
¶
A shock response spectrum against its tolerance band, point by point: the requirement, its bands, each measured polarity, and the points that fell outside.
The question this view answers is the one a shock test is accepted on: how many of the spectrum's points lie inside the band, and which do not. So the band is shaded the way a specification's zones are shaded everywhere else here, the requirement stands back in gray, and every point outside is marked on the curve it belongs to. The count and the share inside are written in the legend beside each curve's name, with whether it passed, because a reader of a printed figure should not have to count markers.
The zones follow the random comparison's colors. Between the inner band's edge and the outer band's is yellow, the ground a share rule lets a few points stand in; past the outer band is red above and blue below, where no point may be. With no outer band the yellow runs to the edge of the plot.
Each polarity wears a marker as well as a color, for the reason the sine tracking view gives: several curves of one quantity on one channel are compared line for line here, and a reader who cannot tell two of the palette's hues apart must still be able to tell the positive spectrum from the negative. A few hollow markers along each curve name it; a point outside the band is the same marker, filled, so being out reads as a change of fill on a shape the reader has already matched to the legend.
Functions:
| Name | Description |
|---|---|
band_text |
The band in words, as the title and the legend give it: |
describe |
One judged spectrum in a line: its polarity, the count and share |
outside_points |
Which points the plot marks: those the rule holds against the |
build_srs_tolerance |
Draw one channel's spectra against the requirement and its band, |
tolerance_key |
The legend entries for the shading, (zone, name), each only when |
Functions:¶
band_text
¶
The band in words, as the title and the legend give it:
'−1.5/+3 dB', or '−1.5/+3 dB within −3/+6 dB' with an outer band
(compliance.srs_band_text, which the report captions share).
Source code in src/visualdynamics/plot/srs_tolerance.py
describe
¶
One judged spectrum in a line: its polarity, the count and share of its points inside the band, and whether it passed, as in 'maximax: 85/92 inside (92.4 %), passes'. Short, because it is a legend entry beside two or three others.
Source code in src/visualdynamics/plot/srs_tolerance.py
outside_points
¶
Which points the plot marks: those the rule holds against the spectrum, every point outside the inner band (under 'above_lower', which has no ceiling, every point under its lower edge) and every point outside the outer band.
Source code in src/visualdynamics/plot/srs_tolerance.py
build_srs_tolerance
¶
build_srs_tolerance(layout: Any, specification: Any, measured: Any | Sequence[Any], *, channel: str | None = None, event: str | None = None, inner: tuple[float, float] | None = None, outer: tuple[float, float] | None = None, rule: str = 'share', percent: float = SRS_POINTS_PERCENT, limits: bool = True, unit_system: Any = None, theme: Any = None, row: int = 0) -> list[dict[str, Any]]
Draw one channel's spectra against the requirement and its band,
and return each spectrum's judgement (compliance.srs_tolerance).
measured is one Srs or several, one per polarity; each is drawn
at channel (the specification's first DOF by default) and at
event (each spectrum's first record at that channel by default).
A band not given is the requirement's own limits when it has them,
as compliance.srs_tolerance reads it, and the curves drawn are
the ones judged against. The plot goes in the layout's row
2 * row and its legend under it (legend_below), so a view can
stack it under plots of its own.
Source code in src/visualdynamics/plot/srs_tolerance.py
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 182 183 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 | |
tolerance_key
¶
tolerance_key(zones: set, inner: tuple[Any, Any], outer: tuple[Any, Any] | None) -> list[tuple[str, str]]
The legend entries for the shading, (zone, name), each only when
it was drawn: zones holds any of 'warning', 'above' and 'below',
as _shade_limit_zones returns them. An inner band with no upper
edge (the 'above_lower' rule's) is shaded below its lower edge
only, and the entry says so.