errorsysdep¶
- class pyvale.errorsysdep.ERoundMethod(value)[source]¶
Bases:
Enum
Enumeration used to specify the method for rounding floats to integers.
- CEIL = 3¶
- FLOOR = 2¶
- ROUND = 1¶
- class pyvale.errorsysdep.ErrSysDigitisation(bits_per_unit: float, method: ERoundMethod = ERoundMethod.ROUND, err_dep: EErrDep = EErrDep.DEPENDENT)[source]¶
Bases:
IErrCalculator
Systematic error calculator for digitisation error base on a user specified number of bits per physical unit and rounding method. Implements the IErrCalculator interface.
- Parameters:
bits_per_unit (float) -- The number of bits per physical unit used to determine the digitisation error.
method (ERoundMethod, optional) -- User specified rounding method, by default ERoundMethod.ROUND.
err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.DEPENDENT.
- calc_errs(err_basis: ndarray, sens_data: SensorData) tuple[ndarray, SensorData] [source]¶
Calculates the error array based on the size of the input.
- Parameters:
err_basis (np.ndarray) -- Array of values with the same dimensions as the sensor measurement matrix.
sens_data (SensorData) -- The accumulated sensor state data for all errors prior to this one.
- Returns:
tuple[np.ndarray, SensorData] -- Tuple containing the calculated error array and pass through of the sensor data object as it is not modified by this class. The returned error array has the same shape as the input error basis.
- get_error_dep() EErrDep [source]¶
Gets the error dependence state for this error calculator. An independent error is calculated based on the input truth values as the error basis. A dependent error is calculated based on the accumulated sensor reading from all preceeding errors in the chain.
- Returns:
EErrDependence -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.
- get_error_type() EErrType [source]¶
Gets the error type.
- Returns:
EErrType -- Enumeration definining RANDOM or SYSTEMATIC error types.
- set_error_dep(dependence: EErrDep) None [source]¶
Sets the error dependence state for this error calculator. An independent error is calculated based on the input truth values as the error basis. A dependent error is calculated based on the accumulated sensor reading from all preceeding errors in the chain.
- Parameters:
dependence (EErrDependence) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.
- class pyvale.errorsysdep.ErrSysRoundOff(method: ERoundMethod = ERoundMethod.ROUND, base: float = 1.0, err_dep: EErrDep = EErrDep.DEPENDENT)[source]¶
Bases:
IErrCalculator
Systematic error calculator for round off error. The user can specify the floor, ceiling or nearest integer method for rounding. The user can also specify a base to round to that defaults 1. Implements the IErrCalculator interface.
- Parameters:
method (ERoundMethod, optional) -- Enumeration specifying the rounding method, by default ERoundMethod.ROUND.
base (float, optional) -- Base to round to, by default 1.0.
err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.DEPENDENT.
- calc_errs(err_basis: ndarray, sens_data: SensorData) tuple[ndarray, SensorData] [source]¶
Calculates the error array based on the size of the input.
- Parameters:
err_basis (np.ndarray) -- Array of values with the same dimensions as the sensor measurement matrix.
sens_data (SensorData) -- The accumulated sensor state data for all errors prior to this one.
- Returns:
tuple[np.ndarray, SensorData] -- Tuple containing the calculated error array and pass through of the sensor data object as it is not modified by this class. The returned error array has the same shape as the input error basis.
- get_error_dep() EErrDep [source]¶
Gets the error dependence state for this error calculator. An independent error is calculated based on the input truth values as the error basis. A dependent error is calculated based on the accumulated sensor reading from all preceeding errors in the chain.
- Returns:
EErrDependence -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.
- get_error_type() EErrType [source]¶
Gets the error type.
- Returns:
EErrType -- Enumeration definining RANDOM or SYSTEMATIC error types.
- set_error_dep(dependence: EErrDep) None [source]¶
Sets the error dependence state for this error calculator. An independent error is calculated based on the input truth values as the error basis. A dependent error is calculated based on the accumulated sensor reading from all preceeding errors in the chain.
- Parameters:
dependence (EErrDependence) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.
- class pyvale.errorsysdep.ErrSysSaturation(meas_min: float, meas_max: float)[source]¶
Bases:
IErrCalculator
Systematic error calculator for saturation error base on user specified minimum and maximum measurement values. Implements the IErrCalculator interface.
NOTE: For this error to function as expected and clamp the measurement within the specified range it must be placed last in the error chain and the behaviour must be set to: EErrDependence.DEPENDENT.
- Parameters:
meas_min (float) -- Minimum value to saturate the measurement to.
meas_max (float) -- Maximum value to saturate the measurement to.
- Raises:
ValueError -- Raised if the user specified minimum measurement is greater than the maximum measurement.
- calc_errs(err_basis: ndarray, sens_data: SensorData) tuple[ndarray, SensorData] [source]¶
Calculates the error array based on the size of the input.
- Parameters:
err_basis (np.ndarray) -- Array of values with the same dimensions as the sensor measurement matrix.
sens_data (SensorData) -- The accumulated sensor state data for all errors prior to this one.
- Returns:
tuple[np.ndarray, SensorData] -- Tuple containing the calculated error array and pass through of the sensor data object as it is not modified by this class. The returned error array has the same shape as the input error basis.
- get_error_dep() EErrDep [source]¶
Gets the error dependence state for this error calculator. An independent error is calculated based on the input truth values as the error basis. A dependent error is calculated based on the accumulated sensor reading from all preceeding errors in the chain.
- Returns:
EErrDependence -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.
- get_error_type() EErrType [source]¶
Gets the error type.
- Returns:
EErrType -- Enumeration definining RANDOM or SYSTEMATIC error types.
- set_error_dep(dependence: EErrDep) None [source]¶
Sets the error dependence state for this error calculator. An independent error is calculated based on the input truth values as the error basis. A dependent error is calculated based on the accumulated sensor reading from all preceeding errors in the chain.
NOTE: For this error to function as expected the error dependence must be set to EErrDependence.DEPENDENT.
- Parameters:
dependence (EErrDependence) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.