visualdynamics.core.rescale¶
rescale
¶
Rescaling a time history: some or all of its channels times a factor.
The usual reason is a channel recorded with the wrong sensitivity. The
acquisition divides volts by the sensitivity it was given, so a record
taken with recorded mV per unit where the sensor is correct mV per
unit is off by recorded / correct (sensitivity_factor). A gain
entered on the wrong channel, or a sign, is the same operation with the
factor typed directly.
The result keeps the record's clock, its channels and what is set on it (the averaging and shock windows, the filter and truncation settings, the channel roles), so everything read or computed from the record reads the same way from the rescaled one.
Functions:
| Name | Description |
|---|---|
sensitivity_factor |
The factor that corrects data recorded with sensitivity |
chosen_records |
The records a rescale applies to, sorted: all of them for None. |
rescaled |
The time history with |
Functions:¶
sensitivity_factor
¶
The factor that corrects data recorded with sensitivity recorded
to what sensitivity correct gives, both in the same units (mV per
engineering unit, say).
Engineering units are volts over the sensitivity, so the factor is
recorded / correct: data taken with 100 mV/g on a 10 mV/g sensor
reads a tenth of the true level and is multiplied by 10.
Raises:
| Type | Description |
|---|---|
ValueError
|
When either sensitivity is not a finite number above zero. |
Source code in src/visualdynamics/core/rescale.py
chosen_records
¶
The records a rescale applies to, sorted: all of them for None.
Raises:
| Type | Description |
|---|---|
ValueError
|
For an empty list or a record the history does not have. |
Source code in src/visualdynamics/core/rescale.py
rescaled
¶
The time history with records (all of them for None) multiplied
by factor, the rest unchanged.
Raises:
| Type | Description |
|---|---|
ValueError
|
When the factor is zero or not finite, or a record is not in the history. |