ESOQ2

giant.stellar_opnav.estimators.esoq2:

class giant.stellar_opnav.estimators.esoq2.ESOQ2(options=None)[source]

Implements the ESOQ2 (Second Estimator of the Optimal Quaternion) solution to Wahba’s problem.

This is a faster technique than Davenport’s Q-Method solution but slightly less accurate.

This class is relatively easy to use. After you initialize the class, simply specify the target_frame_directions unit vectors (:math:` extbf{a}_i` from the estimators documentation) as a 3xn array of vectors (each column is a vector) and the base_frame_directions unit vectors (:math:` extbf{b}_i` from the estimators documentation) as a 3xn array of vectors (each column is a vector) in the call to estimate(). Here the target_frame_directions unit vectors are expressed in the end frame (the frame you want to rotate to) and the base_frame_directions unit vectors are expressed in the starting frame (the frame you want to rotate from). Each column of target_frame_directions and base_frame_directions should correspond to each other as a pair (i.e. column 1 in target_frame_directions is paired with column ` in base_frame_directions.

Optionally, you can set the weighted_estimation value to True and then provide the weights input to estimate() to specify whether to use weighted estimation or not, and what weights to use if you are using weighted estimation. The weights input should be a length n array of the weights to apply to each unit vector pair.

The estimate() method can be called to compute the attitude quaternion that best aligns the two frames. When the estimate() method completes, the solved for rotation is returned as an Rotation object. In addition, the formal post fit covariance matrix of the estimate can be found in the post_fit_covariance attribute. Note that as with all attitude quaternions, the post fit covariance matrix will be rank deficient since there are only 3 true degrees of freedom.

Parameters:

options (ESOQ2Options | None) – the options dataclass to use to configure this class

n_iter: int = 10

Number of iterations for lambda computation in ESOQ2 algorithm.

property options_dict: Dict

Determine the options input to the dataclass.

This property method will ignore all internal properties and functions

property original_options: OptionsT

Get the original configuration options.

Returns:

OptionsT: The original options used during initialization.

Warning

Modifying the returned object will affect reset behavior.

weighted_estimation: bool = False

A flag specifying whether to use weights in the estimation of the rotation.

property post_fit_covariance: ndarray[tuple[Any, ...], dtype[float64]]

This returns the post-fit covariance after calling the estimate method as a 4x4 numpy array.

This should be only be called after the estimate method has been called, otherwise it raises a ValueError

Note that this uses the same covariance as Davenport’s Q-Method solution, which is technically the lower bound.

Summary of Methods

apply_options

Update the options as attributes of the object class

attitude_profile_matrix

Computes the attitude profile matrix for the provided vector sets

comparison_dictionary

Compares each attribute of self to other and stores the result in a dict mapping the attribute to the comparison result.

compute_residuals

This method computes the residuals between the aligned unit vectors according to Wahba's problem definitions.

estimate

This function uses the ESOQ2 algorithm to determine the optimal attitude quaternion given sets of observed and reference unit vectors.

local_vars

this is used to overwrite options in variables only used in __init__

override_options

This method is used for special cases when certain options should be overwritten

reset_settings

Resets the class to the state it was originally initialized with.