Parameters
module trajectopy.core.alignment.parameters
Trajectopy - Trajectory Evaluation in Python
Gereon Tombrink, 2025 tombrink@igg.uni-bonn.de
Global Variables
- UNIT_FORMAT_RULES
class AlignmentParametersError
class Parameter
Class representing a Parameter
A parameter holds a stochastic value with some variance. It can be enabled and disabled.
If a parameter is disabled, its value value is equal to the default value. The default value of a parameter should be chosen in a way so that the parameter has no effect on computations. For example, a default scale value of 1 will not affect any computations this scale parameter is involved in. The same holds true for a rotation or translation of 0. The disabling of parameters is meant to be used to exclude parameter from being estimated during least-squares adjustment.
method Parameter.__init__
__init__(
value: float,
variance: float = 0.0,
default: float = 0.0,
enabled: bool = True,
name: str = '',
unit: trajectopy.definitions.Unit = <Unit.NONE: 6>
) → None
property Parameter.value
property Parameter.variance
method Parameter.disable
method Parameter.enable
class ParameterSet
Abstract class representing a set of parameters
This class groups related parameters. For example, 3 parameters for a 3d translation.
method ParameterSet.__init__
property ParameterSet.any_enabled
property ParameterSet.enabled_bool_list
property ParameterSet.enabled_indices
property ParameterSet.num_enabled
property ParameterSet.values
property ParameterSet.values_enabled
property ParameterSet.variances
property ParameterSet.variances_enabled
method ParameterSet.disable
method ParameterSet.enable
method ParameterSet.get_covariance_matrix
method ParameterSet.set_covariance_matrix
method ParameterSet.to_dict
method ParameterSet.to_name_list
method ParameterSet.to_string_list
method ParameterSet.validate_covariance
Checks dimensions of covariance matrix and sets variances accordingly
class HelmertTransformation
Parameter set for a similarity transformation
method HelmertTransformation.__init__
__init__(
enabled: bool = True,
covariance_matrix: numpy.ndarray = <factory>,
trans_x: trajectopy.core.alignment.parameters.Parameter = <factory>,
trans_y: trajectopy.core.alignment.parameters.Parameter = <factory>,
trans_z: trajectopy.core.alignment.parameters.Parameter = <factory>,
rot_x: trajectopy.core.alignment.parameters.Parameter = <factory>,
rot_y: trajectopy.core.alignment.parameters.Parameter = <factory>,
rot_z: trajectopy.core.alignment.parameters.Parameter = <factory>,
scale: trajectopy.core.alignment.parameters.Parameter = <factory>
) → None
property HelmertTransformation.any_enabled
property HelmertTransformation.enabled_bool_list
property HelmertTransformation.enabled_indices
property HelmertTransformation.num_enabled
property HelmertTransformation.rotation
property HelmertTransformation.rotation_matrix
property HelmertTransformation.rotation_set
property HelmertTransformation.translation
property HelmertTransformation.values
property HelmertTransformation.values_enabled
property HelmertTransformation.variances
property HelmertTransformation.variances_enabled
method HelmertTransformation.apply_to
method HelmertTransformation.disable
method HelmertTransformation.enable
method HelmertTransformation.get_covariance_matrix
method HelmertTransformation.set_covariance_matrix
method HelmertTransformation.to_dict
method HelmertTransformation.to_name_list
method HelmertTransformation.to_string_list
method HelmertTransformation.validate_covariance
Checks dimensions of covariance matrix and sets variances accordingly
class Leverarm
Parameter set for a leverarm
method Leverarm.__init__
__init__(
enabled: bool = True,
covariance_matrix: numpy.ndarray = <factory>,
x: trajectopy.core.alignment.parameters.Parameter = <factory>,
y: trajectopy.core.alignment.parameters.Parameter = <factory>,
z: trajectopy.core.alignment.parameters.Parameter = <factory>
) → None
property Leverarm.any_enabled
property Leverarm.enabled_bool_list
property Leverarm.enabled_indices
property Leverarm.num_enabled
property Leverarm.values
property Leverarm.values_enabled
property Leverarm.variances
property Leverarm.variances_enabled
method Leverarm.apply_to
Applies the leverarm to a set of positions using orientations
Args:
xyz(np.ndarray): Positionsquat_body(np.ndarray): Orientations
Returns:
np.ndarray: Leverarm applied positions
method Leverarm.disable
method Leverarm.enable
method Leverarm.get_covariance_matrix
method Leverarm.set_covariance_matrix
method Leverarm.to_dict
method Leverarm.to_name_list
method Leverarm.to_string_list
method Leverarm.validate_covariance
Checks dimensions of covariance matrix and sets variances accordingly
class AlignmentParameters
Parameter set for spatio-temporal alignment
method AlignmentParameters.__init__
__init__(
enabled: bool = True,
covariance_matrix: numpy.ndarray = <factory>,
sim_trans_x: trajectopy.core.alignment.parameters.Parameter = <factory>,
sim_trans_y: trajectopy.core.alignment.parameters.Parameter = <factory>,
sim_trans_z: trajectopy.core.alignment.parameters.Parameter = <factory>,
sim_rot_x: trajectopy.core.alignment.parameters.Parameter = <factory>,
sim_rot_y: trajectopy.core.alignment.parameters.Parameter = <factory>,
sim_rot_z: trajectopy.core.alignment.parameters.Parameter = <factory>,
sim_scale: trajectopy.core.alignment.parameters.Parameter = <factory>,
time_shift: trajectopy.core.alignment.parameters.Parameter = <factory>,
lever_x: trajectopy.core.alignment.parameters.Parameter = <factory>,
lever_y: trajectopy.core.alignment.parameters.Parameter = <factory>,
lever_z: trajectopy.core.alignment.parameters.Parameter = <factory>
) → None
property AlignmentParameters.any_enabled
property AlignmentParameters.enabled_bool_list
property AlignmentParameters.enabled_indices
property AlignmentParameters.helmert
property AlignmentParameters.leverarm
property AlignmentParameters.num_enabled
property AlignmentParameters.sim3_matrix
property AlignmentParameters.values
property AlignmentParameters.values_enabled
property AlignmentParameters.variances
property AlignmentParameters.variances_enabled
method AlignmentParameters.apply_settings
Applies the estimation settings to the parameters by enabling or disabling them
method AlignmentParameters.disable
method AlignmentParameters.enable
classmethod AlignmentParameters.from_file
Reads the alignment parameters from a file
Args:
filename(str): Path to the file
Returns:
AlignmentParameters: AlignmentParameters instance
classmethod AlignmentParameters.from_settings
method AlignmentParameters.get_covariance_matrix
method AlignmentParameters.params_labels
method AlignmentParameters.set_covariance_matrix
method AlignmentParameters.to_dataframe
method AlignmentParameters.to_dict
method AlignmentParameters.to_estimation_settings
method AlignmentParameters.to_file
Writes the alignment parameters to a file
All parameters are written to the file no matter if they are enabled or not. If they are not enabled, the default value is written. Enabled parameters are marked with a 1, disabled with a 0. The order of the parameters is:
- Translation x
- Translation y
- Translation z
- Rotation x
- Rotation y
- Rotation z
- Scale
- Time Shift
- Leverarm x
- Leverarm y
- Leverarm z
Besides the parameters, the covariance matrix is written to the file. The covariance matrix is written row by row next to the parameters.
Args:
filename(str): Path to the file
method AlignmentParameters.to_name_list
method AlignmentParameters.to_string_list
method AlignmentParameters.validate_covariance
Checks dimensions of covariance matrix and sets variances accordingly
class SensorRotationParameters
Parameter set for sensor b-frame rotation
method SensorRotationParameters.__init__
__init__(
enabled: bool = True,
covariance_matrix: numpy.ndarray = <factory>,
sensor_rot_x: trajectopy.core.alignment.parameters.Parameter = <factory>,
sensor_rot_y: trajectopy.core.alignment.parameters.Parameter = <factory>,
sensor_rot_z: trajectopy.core.alignment.parameters.Parameter = <factory>
) → None
property SensorRotationParameters.any_enabled
property SensorRotationParameters.enabled_bool_list
property SensorRotationParameters.enabled_indices
property SensorRotationParameters.num_enabled
property SensorRotationParameters.rotation
property SensorRotationParameters.rotation_matrix
property SensorRotationParameters.rotation_set
property SensorRotationParameters.values
property SensorRotationParameters.values_enabled
property SensorRotationParameters.variances
property SensorRotationParameters.variances_enabled
method SensorRotationParameters.disable
method SensorRotationParameters.enable
classmethod SensorRotationParameters.from_file
method SensorRotationParameters.get_covariance_matrix
method SensorRotationParameters.set_covariance_matrix
method SensorRotationParameters.to_dict
method SensorRotationParameters.to_file
method SensorRotationParameters.to_name_list
method SensorRotationParameters.to_string_list
method SensorRotationParameters.validate_covariance
Checks dimensions of covariance matrix and sets variances accordingly