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.
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 toNone
.map_back_sequence (
bool
, optional) – IfTrue
, maps the final leg deviation and covariance back to previous legs. Defaults toTrue
.print_output (
bool
, optional) – IfTrue
, prints progress information. Defaults toTrue
.
- Returns:
sol – Object containing the estimated state and covariance history and postfit residuals.
- Return type:
- 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) – IfTrue
, expands the covariance matrix; otherwise, reduces it. Defaults toTrue
.
- Returns:
updated_covar – Updated covariance matrix reflecting the new state definition.
- Return type:
- 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) – IfTrue
, expands the deviation vector; otherwise, reduces it. Defaults toTrue
.
- Returns:
updated_dev – Updated deviation vector reflecting the new state definition.
- Return type:
- 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) – IfTrue
, expands the STM; otherwise, reduces it. Defaults toTrue
.
- Returns:
updated_stm – Updated State Transition Matrix reflecting the new state definition.
- Return type:
- 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:
- Returns:
info_matrix, obs_matrix – A tuple with the following values corresponding to their respective indices:
[0]
= info_matrixnumpy.ndarrayThe computed information matrix.
[1]
= obs_matrixnumpy.ndarrayThe observability matrix constructed from measurement partials.
- Return type:
tuple[numpy.ndarray
,numpy.ndarray]