errorsysindep

class pyvale.errorsysindep.ErrSysGen(generator: IGenRandom, err_dep: EErrDep = EErrDep.INDEPENDENT)[source]

Bases: IErrCalculator

Systematic error calculator for applying a unique offset to each sensor by sample from a user specified probability distribution (an implementation of the IGeneratorRandom interface).

Implements the IErrCalculator interface.

Parameters:
  • generator (IGenRandom) -- Random generator object used to calculate the systematic error in simulation units.

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT.

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.errorsysindep.ErrSysGenPercent(generator: IGenRandom, err_dep: EErrDep = EErrDep.INDEPENDENT)[source]

Bases: IErrCalculator

Systematic error calculator for applying a unique percentage offset to each sensor by sample from a user specified probability distribution (an implementation of the IGeneratorRandom interface). This class assumes the random generator is for a percentage error based on the input error basis and therefore it supports error dependence.

The percentage error is calculated based on the ground truth if the error dependence is INDEPENDENT or based on the accumulated sensor measurement if the dependence is DEPENDENT.

Implements the IErrCalculator interface.

Parameters:
  • generator (IGenRandom) -- Random generator which returns a percentage error in the range (0,100)

  • err_dep (EErrDep, optional) -- Error calculation dependence, by default EErrDep.INDEPENDENT

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.errorsysindep.ErrSysNorm(std: float, mean: float = 0.0, err_dep: EErrDep = EErrDep.INDEPENDENT, seed: int | None = None)[source]

Bases: IErrCalculator

Systematic error calculator for applying an offset to each individual sensor in the array based on sampling from a normal distribution specified by its standard deviation and mean. Note that the offset is constant for each sensor over time. Implements the IErrCalculator interface.

Parameters:
  • std (float) -- Standard deviation of the normal distribution to sample.

  • mean (float, optional) -- Mean of the normal distribution to sample, by default 0.0.

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT.

  • seed (int | None, optional) -- Optional seed for the random generator to allow for replicable behaviour, by default None.

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.

NOTE: for this error the calculation is independent regardless of this setting as the offset is constant.

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 the calculation is independent regardless of this setting as the offset is constant.

Parameters:

dependence (EErrDependence) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.

class pyvale.errorsysindep.ErrSysNormPercent(std_percent: float, err_dep: EErrDep = EErrDep.INDEPENDENT, seed: int | None = None)[source]

Bases: IErrCalculator

Systematic error calculator for applying a percentage offset to each individual sensor in the array based on sampling from a normal distribution specified by its standard deviation and mean. Note that the offset is constant for each sensor over time.

The percentage offset is calculated based on the ground truth if the error dependence is INDEPENDENT or based on the accumulated sensor measurement if the dependence is DEPENDENT.

Implements the IErrCalculator interface.

Parameters:
  • std_percent (float) -- Standard deviation as a percentage in the range (0,100).

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT.

  • seed (int | None, optional) -- Optional seed for the random generator to allow for replicable behaviour, by default None.

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.errorsysindep.ErrSysOffset(offset: float, err_dep: EErrDep = EErrDep.INDEPENDENT)[source]

Bases: IErrCalculator

Systematic error calculator applying a constant offset to all simulated sensor measurements. Implements the IErrCalculator interface.

Parameters:
  • offset (float) -- Constant offset to apply to all simulated measurements from the sensor array.

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT.

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.

NOTE: for this error the calculation is independent regardless of this setting as the offset is constant.

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 the calculation is independent regardless of this setting as the offset is constant.

Parameters:

dependence (EErrDependence) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.

class pyvale.errorsysindep.ErrSysOffsetPercent(offset_percent: float, err_dep: EErrDep = EErrDep.INDEPENDENT)[source]

Bases: IErrCalculator

Systematic error calculator applying a constant offset as a percentage of the sensor reading to each individual simulated sensor measurement. Implements the IErrCalculator interface.

Parameters:
  • offset_percent (float) -- Percentage offset to apply to apply to all simulated measurements from the sensor array.

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT

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.errorsysindep.ErrSysUnif(low: float, high: float, err_dep: EErrDep = EErrDep.INDEPENDENT, seed: int | None = None)[source]

Bases: IErrCalculator

Systematic error calculator for applying an offset to each sensor that is sampled from a uniform probability distribution specified by its upper and lower bounds. Implements the IErrCalculator interface.

Parameters:
  • low (float) -- Lower bound of the uniform probability distribution in the same units as the physical field the sensor array is sampling.

  • high (float) -- Upper bound of the uniform probability distribution in the same units as the physical field the sensor array is sampling.

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT.

  • seed (int | None, optional) -- Optional seed for the random generator to allow for replicable behaviour, by default None.

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.

NOTE: for this error the calculation is independent regardless of this setting as the offset is constant.

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 the calculation is independent regardless of this setting as the offset is constant.

Parameters:

dependence (EErrDependence) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.

class pyvale.errorsysindep.ErrSysUnifPercent(low_percent: float, high_percent: float, err_dep: EErrDep = EErrDep.INDEPENDENT, seed: int | None = None)[source]

Bases: IErrCalculator

Systematic error calculator for applying a percentage offset to each sensor that is sampled from a uniform probability distribution specified by its upper and lower bounds.

The percentage offset is calculated based on the ground truth if the error dependence is INDEPENDENT or based on the accumulated sensor measurement if the dependence is DEPENDENT.

Implements the IErrCalculator interface.

Parameters:
  • low_percent (float) -- Lower percentage bound for the uniform probability distribution.

  • high_percent (float) -- Upper percentage bound for the uniform probability distribution.

  • err_dep (EErrDependence, optional) -- Error calculation dependence, by default EErrDependence.INDEPENDENT

  • seed (int | None, optional) -- Optional seed for the random generator to allow for replicable behaviour, by default None.

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.