Skip to content

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

disable()  None

method Parameter.enable

enable()  None

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__

__init__(
    enabled: bool = True,
    covariance_matrix: numpy.ndarray = <factory>
)  None

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

disable()  None

method ParameterSet.enable

enable()  None

method ParameterSet.get_covariance_matrix

get_covariance_matrix(enabled_only: bool = True)  ndarray

method ParameterSet.set_covariance_matrix

set_covariance_matrix(cov_matrix: numpy.ndarray)  None

method ParameterSet.to_dict

to_dict(enabled_only: bool = True)  Dict[str, List[float]]

method ParameterSet.to_name_list

to_name_list(enabled_only: bool = True, lower_case: bool = True)  List[str]

method ParameterSet.to_string_list

to_string_list(enabled_only: bool = True)  List[str]

method ParameterSet.validate_covariance

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

apply_to(xyz: numpy.ndarray)  ndarray

method HelmertTransformation.disable

disable()  None

method HelmertTransformation.enable

enable()  None

method HelmertTransformation.get_covariance_matrix

get_covariance_matrix(enabled_only: bool = True)  ndarray

method HelmertTransformation.set_covariance_matrix

set_covariance_matrix(cov_matrix: numpy.ndarray)  None

method HelmertTransformation.to_dict

to_dict(enabled_only: bool = True)  Dict[str, List[float]]

method HelmertTransformation.to_name_list

to_name_list(enabled_only: bool = True, lower_case: bool = True)  List[str]

method HelmertTransformation.to_string_list

to_string_list(enabled_only: bool = True)  List[str]

method HelmertTransformation.validate_covariance

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

apply_to(xyz: numpy.ndarray, quat_body: numpy.ndarray)  ndarray

Applies the leverarm to a set of positions using orientations

Args:

  • xyz (np.ndarray): Positions
  • quat_body (np.ndarray): Orientations

Returns:

  • np.ndarray: Leverarm applied positions

method Leverarm.disable

disable()  None

method Leverarm.enable

enable()  None

method Leverarm.get_covariance_matrix

get_covariance_matrix(enabled_only: bool = True)  ndarray

method Leverarm.set_covariance_matrix

set_covariance_matrix(cov_matrix: numpy.ndarray)  None

method Leverarm.to_dict

to_dict(enabled_only: bool = True)  Dict[str, List[float]]

method Leverarm.to_name_list

to_name_list(enabled_only: bool = True, lower_case: bool = True)  List[str]

method Leverarm.to_string_list

to_string_list(enabled_only: bool = True)  List[str]

method Leverarm.validate_covariance

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

apply_settings(settings: trajectopy.settings.AlignmentEstimationSettings)  None

Applies the estimation settings to the parameters by enabling or disabling them


method AlignmentParameters.disable

disable()  None

method AlignmentParameters.enable

enable()  None

classmethod AlignmentParameters.from_file

from_file(filename: str)  AlignmentParameters

Reads the alignment parameters from a file

Args:

  • filename (str): Path to the file

Returns:

  • AlignmentParameters: AlignmentParameters instance

classmethod AlignmentParameters.from_settings

from_settings(
    settings: trajectopy.settings.AlignmentEstimationSettings
)  AlignmentParameters

method AlignmentParameters.get_covariance_matrix

get_covariance_matrix(enabled_only: bool = True)  ndarray

method AlignmentParameters.params_labels

params_labels(enabled_only: bool = True, lower_case: bool = True)  List[str]

method AlignmentParameters.set_covariance_matrix

set_covariance_matrix(cov_matrix: numpy.ndarray)  None

method AlignmentParameters.to_dataframe

to_dataframe()  DataFrame

method AlignmentParameters.to_dict

to_dict(enabled_only: bool = True)  Dict[str, List[float]]

method AlignmentParameters.to_estimation_settings

to_estimation_settings()  AlignmentEstimationSettings

method AlignmentParameters.to_file

to_file(filename: str)  None

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

to_name_list(enabled_only: bool = True, lower_case: bool = True)  List[str]

method AlignmentParameters.to_string_list

to_string_list(enabled_only: bool = True)  List[str]

method AlignmentParameters.validate_covariance

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

disable()  None

method SensorRotationParameters.enable

enable()  None

classmethod SensorRotationParameters.from_file

from_file(filename: str)  SensorRotationParameters

method SensorRotationParameters.get_covariance_matrix

get_covariance_matrix(enabled_only: bool = True)  ndarray

method SensorRotationParameters.set_covariance_matrix

set_covariance_matrix(cov_matrix: numpy.ndarray)  None

method SensorRotationParameters.to_dict

to_dict(enabled_only: bool = True)  Dict[str, List[float]]

method SensorRotationParameters.to_file

to_file(filename: str)  None

method SensorRotationParameters.to_name_list

to_name_list(enabled_only: bool = True, lower_case: bool = True)  List[str]

method SensorRotationParameters.to_string_list

to_string_list(enabled_only: bool = True)  List[str]

method SensorRotationParameters.validate_covariance

validate_covariance()

Checks dimensions of covariance matrix and sets variances accordingly