errorsysfield¶
- class pyvale.errorsysfield.ErrFieldData(pos_offset_xyz: ndarray | None = None, ang_offset_zyx: ndarray | None = None, time_offset: ndarray | None = None, pos_rand_xyz: tuple[IGenRandom | None, IGenRandom | None, IGenRandom | None] = (None, None, None), ang_rand_zyx: tuple[IGenRandom | None, IGenRandom | None, IGenRandom | None] = (None, None, None), time_rand: IGenRandom | None = None, spatial_averager: EIntSpatialType | None = None, spatial_dims: ndarray | None = None, pos_lock_xyz: ndarray | None = None, ang_lock_zyx: ndarray | None = None, time_drift: IDriftCalculator | None = None)[source]¶
Bases:
object
Dataclass for controlling sensor parameter perturbations for field based systematic errors (i.e. errors that require interpolation of the physical field).
- ang_lock_zyx: ndarray | None¶
- ang_offset_zyx: ndarray | None¶
Array of offsets to apply to the sensor angles for error calculation. shape=(num_sensors,3) where the columns represent rotations about offsets about the Z, Y and X axis of the sensor in sensor local coordinates. If None then no angular offsets are applied.
- ang_rand_zyx: tuple[IGenRandom | None, IGenRandom | None, IGenRandom | None]¶
Tuple of random generators (implementations of IGenRandom interface) for perturbing the sensor angles. The generators perturb rotations about the the Z, Y and X axis in order. If None then that axis is not randomly perturbed from the nominal sensor position.
- pos_lock_xyz: ndarray | None¶
- pos_offset_xyz: ndarray | None¶
Array of offsets to apply to the sensor positions for error calculation. shape=(num_sensors,3) where the columns represent the X, Y and Z offsets in simulation world coordinates. If None then no position offset is applied.
- pos_rand_xyz: tuple[IGenRandom | None, IGenRandom | None, IGenRandom | None]¶
Tuple of random generators (implementations of IGenRandom interface) for perturbing the sensor positions. The generators perturb the X, Y and Z coordinates in order. If None then that axis is not randomly perturbed from the nominal sensor position. Note that the random generators should return position perturbations consistent with the simulation units.
- spatial_averager: EIntSpatialType | None¶
Type of spatial averaging to use for this sensor array for the purpose of calculating field based errors. If None then no spatial averaging is performed.
- spatial_dims: ndarray | None¶
The spatial dimension of the sensor in its local X,Y,Z coordinates for the purpose of calculating field errors. Only used if spatial averager is specified above. shape=(3,)
- time_drift: IDriftCalculator | None¶
Temporal drift calculation
- time_offset: ndarray | None¶
Array of offsets to apply to the sampling times for all sensors. shape=( num_time_steps,). If None then no time offset is applied.
- time_rand: IGenRandom | None¶
Random generator for perturbing sensor array sampling times for the purpose of calculating field based errors. If None then sensor sampling times will not be perturbed from the nominal times.
- class pyvale.errorsysfield.ErrSysField(field: IField, field_err_data: ErrFieldData, err_dep: EErrDep = EErrDep.INDEPENDENT)[source]¶
Bases:
IErrCalculator
Class for calculating field based systematic errors. Field based errors are errors that require interpolation or sampling of the simulated physical field such as perturbations of the sensor position or sampling time.
All perturbations to the sensor parameters (positions, sample times, angles area averaging) are calculated first before performing a single interpolation with the perturbed sensor state.
Implements the IErrCalculator interface.
- Parameters:
field (IField) -- The physical field to interpolate which will be an implementation of the IField interface. This will be a FieldScalar, FieldVector or FieldTensor object.
field_err_data (ErrFieldData) -- Dataclass specifying which sensor array parameters will be perturbed and how they will be perturbed. See the ErrFieldData class for more detail
err_dep (EErrDep, optional) -- Error calculation dependence, by default EErrDep.DEPENDENT.
- calc_errs(err_basis: ndarray, sens_data: SensorData) tuple[ndarray, SensorData] [source]¶
Calculates the error array based on the size of the input. First calculates the combined perturbed sensor state from all perturbations specified in the ErrFieldData object and then performs a single interpolation of the field to obtain the error array.
- 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:
EErrDep -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.
- get_error_type() EErrType [source]¶
Gets the error type.
- Returns:
EErrType -- Enumeration definining RANDOM or SYSTEMATIC error types.
- get_perturbed_sensor_data() SensorData [source]¶
- 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 (EErrDep) -- Enumeration defining INDEPENDENT or DEPENDENT behaviour.