4. LSB#

class LSB(trajectory: FilterOD, initial_covariance: CovarianceMatrix, measurement_data: list, dataset_names: list)#

Bases: FilterOD

Implements a Batch Least-Squares (LSB) filter for spacecraft orbit determination.

This class applies a weighted least-squares estimation approach to estimate the state deviation and covariance of a spacecraft trajectory based on measurement data. The method follows the minimum variance weighted least squares principle, where the measurement noise covariance serves as the weighting matrix. The batch approach enables estimation over a complete dataset at once rather than sequentially.

The LSB filter is capable of handling:

  • Sequential estimation across multiple trajectory legs (if applicable).

  • Full information estimation, meaning that it operates on the entire dataset at once.

  • Nonlinear trajectory dynamics, leveraging state transition matrices (STMs) to propagate measurement sensitivities.

The solution minimizes the residuals in a weighted sense, ensuring an optimal state estimate given the available measurements.

Parameters:
  • trajectory (FilterOD) –

    The reference trajectory for orbit determination. This contains:

    • The nominal spacecraft trajectory,

    • The state transition matrices (STMs) used for propagating covariance and deviations.

  • initial_covariance (CovarianceMatrix) – The initial covariance matrix, representing the uncertainty in the estimated state.

  • measurement_data (list) –

    A list of measurement observations, each containing:

    • Measurement time.

    • Residuals between observed and predicted measurements.

    • Measurement covariance matrix.

    • Partial derivatives (Jacobian of the observation model).

  • dataset_names (list) – Names of the datasets used in the estimation process.

See also

scarabaeus.FilterOD

Base class for orbit determination filters.

scarabaeus.SolutionOD

Stores estimated covariance history and postfit residuals.

scarabaeus.CovarianceMatrix

Defines measurement noise covariance.

Notes

Requires an a priori trajectory and covariance.

If using sequential mode (multiple legs), proper mapping of covariance and deviations across trajectory legs is necessary.

Measurement updates refine the estimated state iteratively.

LSB is not recursive like Kalman filtering; it operates on the full dataset at once.

References

Tapley, B. D., Schutz, B. E., & Born, G. H. (2004). Statistical orbit determination. Elsevier.

Methods

compute_batch([meas_corr, ...])

Computes the batch least-squares solution for orbit determination.

map_covariance_definition_node(...[, ...])

Adjusts the covariance matrix to match a new state vector definition.

map_deviation_definition_node(...[, ...])

Adjusts the deviation vector to align with a new state vector definition.

map_stm_definition_node(counter_events, old_STM)

Adjusts the State Transition Matrix (STM) to match a new state definition.

observability_test([print_obs, threshold, ...])

Performs an observability analysis on the system by computing the information matrix.

unwrap_residuals(postfit_residuals, ...)

Organizes postfit residuals into a dictionary categorized by dataset.

validate_sequence_batch()

Validates consistency in state vector definitions across sequential estimation legs.

compute_batch(meas_corr: list = None, map_back_sequence: bool = True, print_output: bool = True) SolutionOD#

Computes the batch least-squares solution for orbit determination.

Handles both mission sequence and non- cases, ensuring proper state deviation and covariance estimation across trajectory segments (legs). Applies a weighted least-squares approach with measurement noise covariance as the weighting matrix.

Parameters:
  • meas_corr (list, optional) – Correction factors for measurement covariance. Defaults to None.

  • map_back_sequence (bool, optional) – If True, maps the final leg deviation and covariance back to previous legs. Defaults to True.

  • print_output (bool, optional) – If True, prints progress information. Defaults to True.

Returns:

sol – Object containing the estimated state and covariance history and postfit residuals.

Return type:

SolutionOD

map_covariance_definition_node(counter_events: int, old_covariance: ndarray, flag_augment: bool = True) ndarray#

Adjusts the covariance matrix to match a new state vector definition.

Parameters:
  • counter_events (int) – Index of the current sequence event for state transition.

  • old_covariance (numpy.ndarray) – Previous covariance matrix to be updated.

  • flag_augment (bool, optional) – If True, expands the covariance matrix; otherwise, reduces it. Defaults to True.

Returns:

updated_covar – Updated covariance matrix reflecting the new state definition.

Return type:

numpy.ndarray

map_deviation_definition_node(counter_events: int, old_deviation: ndarray, flag_augment: bool = True) ndarray#

Adjusts the deviation vector to align with a new state vector definition.

Parameters:
  • counter_events (int) – Index of the current sequence event for state transition.

  • old_deviation (numpy.ndarray) – Previous state deviation vector.

  • flag_augment (bool, optional) – If True, expands the deviation vector; otherwise, reduces it. Defaults to True.

Returns:

updated_dev – Updated deviation vector reflecting the new state definition.

Return type:

numpy.ndarray

map_stm_definition_node(counter_events: int, old_STM: ndarray, flag_augment: bool = True) ndarray#

Adjusts the State Transition Matrix (STM) to match a new state definition.

Parameters:
  • counter_events (int) – Index of the current sequence event for state transition.

  • old_STM (numpy.ndarray) – Previous STM to be updated.

  • flag_augment (bool, optional) – If True, expands the STM; otherwise, reduces it. Defaults to True.

Returns:

updated_stm – Updated State Transition Matrix reflecting the new state definition.

Return type:

numpy.ndarray

observability_test(print_obs=False, threshold=0.1, meas_corr=None)#

Performs an observability analysis on the system by computing the information matrix.

Checks whether the system’s observability matrix has full rank and determines the positive definiteness of the information matrix.

Parameters:
  • print_obs (bool, optional) – If True, prints details of the observability analysis.

  • threshold (float, optional) – Minimum eigenvalue threshold for checking positive definiteness.

  • meas_corr (list, optional) – Measurement covariance correction factors.

Returns:

info_matrix, obs_matrix – A tuple with the following values corresponding to their respective indices:

  • [0] = info_matrixnumpy.ndarray

    The computed information matrix.

  • [1] = obs_matrixnumpy.ndarray

    The observability matrix constructed from measurement partials.

Return type:

tuple[numpy.ndarray, numpy.ndarray]

unwrap_residuals(postfit_residuals: list, dataset_names: list[str]) dict#

Organizes postfit residuals into a dictionary categorized by dataset.

Parameters:
  • postfit_residuals (list) – List of residuals and associated metadata.

  • dataset_names (list) – List of dataset names corresponding to different measurements.

Returns:

unwrapped_residuals – Dictionary mapping dataset names to corresponding residuals and sigmas.

Return type:

dict

validate_sequence_batch()#

Validates consistency in state vector definitions across sequential estimation legs.

Ensures that each state vector in a sequence contains all necessary elements from previous legs.

Return type:

None