Skip to content

Alignment Result

alignment_result

AlignmentResult dataclass

AlignmentResult(
    name: str = "Alignment Result",
    position_parameters: AlignmentParameters = AlignmentParameters(),
    rotation_parameters: SensorRotationParameters = SensorRotationParameters(),
    estimation_of: AlignmentEstimationSettings = AlignmentEstimationSettings(),
    converged: bool = True,
)

Class to store the result of an alignment.

Attributes:

  • name (str) –

    Name of the result.

  • position_parameters (AlignmentParameters) –

    Estimated position alignment parameters.

  • rotation_parameters (SensorRotationParameters) –

    Estimated rotation alignment parameters.

  • estimation_of (AlignmentEstimationSettings) –

    Settings defining which parameters were estimated.

  • converged (bool) –

    Whether the estimation converged.

to_file

to_file(filename: str) -> None

Appends the result to a file.

Source code in trajectopy\results\alignment_result.py
def to_file(self, filename: str) -> None:
    """Appends the result to a file."""
    from trajectopy.io import results_io

    results_io.write_alignment_result(self, filename)

from_file classmethod

from_file(filename: str) -> AlignmentResult

Loads the result from a file.

Source code in trajectopy\results\alignment_result.py
@classmethod
def from_file(cls, filename: str) -> "AlignmentResult":
    """Loads the result from a file."""
    from trajectopy.io import results_io

    return results_io.read_alignment_result(filename)