visualdynamics.core.multi_point¶
multi_point
¶
Multi-point control: several control channels combined into one, and the two judgments a test run that way is accepted on.
A random test on one shaker is often controlled at more than one point. The controller combines the control channels' spectra, line by line, into one composite and holds that to the reference; how they are combined is the strategy:
- 'average', the mean of the channels' densities, each counted alike;
- 'weighted', the mean with weights chosen for the channels;
- 'maximum', the highest channel at each line, so nothing sensed exceeds the reference and every other point is under it;
- 'minimum', the lowest channel at each line, so every point sensed meets the reference and every other point is over it.
The average is taken on the densities themselves, not on their decibels, because that is the arithmetic a controller does. With two channels, one at four times the reference and one at a quarter, the average is just over twice the reference: the hot spot shows, far smaller than it is.
So a run controlled this way has two results, and a report carries both: the composite against the composite band, and each control channel against its own band, which is wider. The second exists because the first can pass with a channel far out. A channel reading near zero inside an average (a dead or loose sensor) leaves the composite in tolerance while the controller drives the live channels up to make up for it, and nothing on the composite says so. The reading here lists, for each channel, the lines where it is outside its own band while the composite is inside its band, which is the fact the composite hides.
Every judgment is compliance.compare and compliance.exceedances,
the comparison every other random reading makes: the composite and
each channel are compared cell by cell, as areas, against a band
around the reference, at the comparison's one scale. Nothing here
judges a line by its own rule.
Classes:
| Name | Description |
|---|---|
ChannelReading |
One control channel of a multi-point reading, against its own |
MultiPointReading |
What |
Functions:
| Name | Description |
|---|---|
composite |
The composite of several channels' densities, line by line. |
multi_point |
Read a multi-point control run: the composite of its control |
control_channels |
The measured records a multi-point reading combines, by the rule |
Classes¶
ChannelReading
dataclass
¶
ChannelReading(label: str, record: int, weight: float, result: dict[str, Any], over: ndarray, under: ndarray, hidden: ndarray, held_lines: int | None = None)
One control channel of a multi-point reading, against its own band.
Attributes:
| Name | Type | Description |
|---|---|---|
outside |
ndarray
|
Per line, outside the individual band either way. |
outside_lines |
int
|
How many lines are outside the individual band. |
judged_lines |
int
|
How many lines were judged against the individual band: none |
hidden_lines |
int
|
How many lines are outside the individual band while the |
Attributes¶
judged_lines
property
¶
How many lines were judged against the individual band: none for a channel with no finite line, which was not judged at all and is never read as inside its band.
hidden_lines
property
¶
How many lines are outside the individual band while the composite is inside its own.
MultiPointReading
dataclass
¶
MultiPointReading(strategy: str, composite: Psd, spec_record: int, composite_band: Specification, individual_band: Specification, composite_text: str, individual_text: str, result: dict[str, Any], over: ndarray, under: ndarray, channels: tuple[ChannelReading, ...], scale_db: float, notes: tuple[str, ...] = (), chance_share: float | None = None)
What multi_point read: the composite, its judgment, and each
channel's.
Attributes:
| Name | Type | Description |
|---|---|---|
outside_lines |
int
|
How many lines of the composite are outside its band. |
judged_lines |
int
|
How many lines of the composite were judged: none when it was |
hiding |
tuple[ChannelReading, ...]
|
The channels outside their own band at a line where the |
Attributes¶
judged_lines
property
¶
How many lines of the composite were judged: none when it was formed at no line (a channel with no finite line), in which case nothing was judged and the reading is never a pass.
hiding
property
¶
hiding: tuple[ChannelReading, ...]
The channels outside their own band at a line where the composite is inside its band.
Functions:¶
composite
¶
composite(values: ArrayLike, strategy: str = 'average', weights: ArrayLike | None = None) -> ndarray
The composite of several channels' densities, line by line.
values is (channels, lines), real densities on one set of lines.
'average' and 'weighted' take the weighted mean of the densities
(weights normalized to sum to one, equal under 'average'),
'maximum' and 'minimum' the highest and lowest channel at each line.
A line where any channel is not a finite, non-negative number has no composite and is NaN: the composite of these channels was not formed there, and averaging the rest would be a composite of other channels. A channel reading zero is a number and is counted, as a controller counts it, which is what lets a dead channel be found.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
array_like
|
The densities, one row per channel. |
required |
strategy
|
str
|
One of |
'average'
|
weights
|
array_like
|
One per channel, finite and not negative, under 'weighted' only; normalized here. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
One value per line. |
Raises:
| Type | Description |
|---|---|
ValueError
|
For a strategy not in |
Source code in src/visualdynamics/core/multi_point.py
multi_point
¶
multi_point(specification: Specification, measured: Psd, channels: Sequence[int | str] | None = None, strategy: str = 'average', weights: ArrayLike | None = None, composite_band: str | tuple[float, float] = 'warning', individual_band: str | tuple[float, float] = INDIVIDUAL_DB, spec_record: int | None = None, scale_db: float | None = None, table: Any = None) -> MultiPointReading
Read a multi-point control run: the composite of its control channels against the composite band, and each channel against its own.
The composite is formed line by line (composite) from the control
channels' densities and compared with the reference by
compliance.compare; each channel is compared the same way against
the individual band. A band is a pair of the specification's own
limits ('warning' or 'abort'), or a pair of dB below and above the
reference, ten log ten on a density (an infinite edge is no edge on
that side). For each channel the lines outside its own band are
found, and among them those where the composite is inside its band:
the lines the composite hides.
The reference is one record of the specification: spec_record
when given, the only record when there is one, and otherwise the
record each channel pairs with (compliance.matched_records),
which must all ask for the same thing, since a composite is held to
one reference. The scale is resolved once for every channel, as
compliance.compare_all resolves it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
specification
|
Specification
|
The reference and, where its limits are used, the bands. |
required |
measured
|
Psd
|
The run, holding the control channels' autospectra. |
required |
channels
|
sequence of int or str
|
The control channels, by record or by response DOF; by default
those |
None
|
strategy
|
str
|
One of |
'average'
|
weights
|
array_like
|
One per channel, under 'weighted' only. |
None
|
composite_band
|
str or tuple of float
|
'warning' or 'abort' for that pair of the specification's limits, or (below, above) in dB. |
'warning'
|
individual_band
|
str or tuple of float
|
'warning' or 'abort' for that pair of the specification's limits, or (below, above) in dB. |
'warning'
|
spec_record
|
int
|
The reference record, chosen as above when omitted. |
None
|
scale_db
|
float
|
The comparison's scale; resolved through
|
None
|
table
|
ChannelTable
|
The channel table whose Control flags name the control channels
when |
None
|
Returns:
| Type | Description |
|---|---|
MultiPointReading
|
The composite and its judgment, each channel's, and the notes. |
Raises:
| Type | Description |
|---|---|
ValueError
|
With the reason, for anything the reading cannot be made from:
a strategy or weights |
Source code in src/visualdynamics/core/multi_point.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | |
control_channels
¶
control_channels(specification: Specification, measured: Psd, channels: Sequence[int | str] | None = None, table: Any = None) -> list[int]
The measured records a multi-point reading combines, by the rule
multi_point uses: the records named, by index or by response
DOF; by default the autospectra at the channels a channel table
flags as the specification's loop's control channels
(ChannelTable.controls_for), where it flags any; and otherwise the autospectra that pair with the
specification's records (compliance.matched_records). The window
asks this before it offers the reading, so the reading is offered
exactly where it can be made.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
specification
|
Specification
|
The reference the channels pair with. |
required |
measured
|
Psd
|
The run. |
required |
channels
|
sequence of int or str
|
The channels named; found as above when omitted. |
None
|
table
|
ChannelTable
|
The channel table whose Control flags say which channels the controller held. |
None
|
Returns:
| Type | Description |
|---|---|
list of int
|
Two or more records of |
Raises:
| Type | Description |
|---|---|
ValueError
|
With the reason, for fewer than two channels, or a channel named twice, not found, ambiguous or a cross term. |
Source code in src/visualdynamics/core/multi_point.py
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | |