LSB#

class LSB(propagator: Propagator | MissionSequence, measurements: MeasurementSpec, settings: FilterSettings, traj_name: str | None = None, traj_dir: str | None = None, overwrite_traj: bool = True)#

Bases: FilterOD

Weighted Batch Least-Squares (LSB) estimator for spacecraft orbit determination.

The LSB accumulates all measurements simultaneously (“batch”) rather than processing them one by one as in a sequential filter. All epochs contribute to a single linear system that is solved once to obtain the state deviation at the reference epoch \(t_0\).

Normal equations

Define \(A_k = H_k\,\Phi_{k,0}\), the measurement Jacobian at epoch \(t_k\) mapped back to \(t_0\) via the STM \(\Phi_{k,0}\), and \(y_k\) the prefit residual. The weighted normal matrix and right-hand side are accumulated over all \(K\) epochs:

\[M = P_0^{-1} + \sum_{k=1}^{K} A_k^T R_k^{-1} A_k, \qquad b = \sum_{k=1}^{K} A_k^T R_k^{-1} y_k\]

where \(P_0^{-1}\) is the a-priori information matrix. The solution and its covariance are:

\[\hat{x}_0 = M^{-1} b, \qquad \hat{P}_0 = M^{-1}.\]

\(M\) is the information matrix \(\Lambda\) of the full batch, so the LSB solution is the maximum-likelihood estimate under Gaussian noise.

Consider parameters (Schmidt extension)

When consider parameters are present, the cross-term \(M_{xc}\) is accumulated alongside \(M_{xx}\) and the posterior covariance is inflated by the consider contribution:

\[\hat{P}_0 = M_{xx}^{-1} + S_{xc}\,P_{cc}\,S_{xc}^T\]

where \(S_{xc} = -M_{xx}^{-1} M_{xc}\) is the consider sensitivity matrix (Tapley et al., Chapter 7).

Numerical considerations

The LSB solves the normal equations directly via matrix inversion, which squares the condition number of the problem. For ill-conditioned measurement geometries, SRIFB provides the same solution through an orthogonal QR decomposition that avoids explicit normal-matrix inversion and is numerically preferable.

Process noise and stochastic parameters

Sequential process noise models such as SNC and DMC require intermediate time updates between measurement epochs and are therefore not supported in the purely batch formulation. Use SRIF or LKF when unmodelled accelerations must be compensated sequentially epoch by epoch.

A batch analogue can still be constructed through so-called “stochastics” or pseudo-epoch states, where empirical accelerations are represented as estimated solve-for parameters within the batch state vector. In this approach, first-order Gauss–Markov or piecewise-constant stochastic accelerations are parameterized over predefined intervals and estimated simultaneously with the orbital state.

Each stochastic parameter contributes additional columns to the design matrix

\[A_k = H_k \Phi_{k,0},\]

allowing the batch filter to recover time-varying empirical accelerations without performing intermediate sequential covariance updates. This formulation is commonly referred to as a pseudo-epoch-state filter and is preferred when the stochastic signal can be adequately represented by deterministic parameters over the data arc.

Parameters:
  • propagator (Propagator or MissionSequence) – Defines the reference trajectory and STMs.

  • measurements (MeasurementSpec) – Measurement specification object.

  • settings (FilterSettings) – Filter configuration. settings.process_noise must be None.

  • traj_name (str, optional) – Name for the trajectory BSP file.

  • traj_dir (str, optional) – Directory for the trajectory BSP file.

  • overwrite_traj (bool, optional) – If True, overwrite any existing trajectory file.

Raises:

NotImplementedError – If settings.process_noise is not None (process noise is not supported in the batch formulation; use LKF or SRIF).

Notes

The LSB inverts the normal matrix directly, squaring the condition number. For ill-conditioned measurement geometries prefer SRIFB, which produces the same solution via an orthogonal QR decomposition. Process noise (SNC/DMC) is not supported; use LKF or SRIF when unmodelled accelerations must be compensated.

See also

scarabaeus.SRIFB

Numerically superior batch estimator in the square-root information domain; produces the same solution with better conditioning.

scarabaeus.LKF

Sequential covariance-form filter; supports process noise.

scarabaeus.FilterOD

Base class providing trajectory and measurement handling.

References

Tapley, B. D., Schutz, B. E., & Born, G. H. (2004). Statistical Orbit Determination. Elsevier Academic Press. ISBN 978-0-12-683630-1.

Attributes:
DMC_flag

True when Dynamic Model Compensation (DMC) process noise is active.

SNC_flag

True when State Noise Compensation (SNC) process noise is active.

apriori_covariance_est

Apriori covariance restricted to the estimated parameter subspace.

covariance_analysis

True when running in covariance-analysis mode (no measurement updates).

covariance_consider_history

Consider-parameter covariance block at each epoch.

covariance_history

Posterior covariance \(\hat{P}_0\) propagated to each measurement epoch via the trajectory STMs.

flag_sequence

True for multi-leg (mission-sequence) trajectories.

has_consider

True if consider parameters are present in the state vector.

measurement_data

Container for all measurement datasets, residuals, and editing flags.

measurements

Measurement specification object passed at construction time.

n

Dimension of the estimated state vector.

postfit_residuals

Post-fit residuals from the batch solution, keyed by dataset name.

prefit_residuals

Pre-fit residuals \(y_k\), keyed by dataset name.

propagator

Propagator or ScenarioSetup used to build the reference trajectory.

settings

Filter configuration (covariance, process noise, output options).

state_deviation_history

State deviation \(\hat{x}_k\) propagated to each measurement epoch.

trajectory

Propagated reference trajectory stored in a SPICE BSP kernel with a companion JSON file for STMs and estimated parameters.

Methods

fit([traj_name, traj_dir, overwrite_traj, ...])

Perform iterative orbit determination with automatic convergence checking.

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

Compute the observability and information matrices for the current filter setup.

property covariance_consider_history: list#

Consider-parameter covariance block at each epoch. Empty list when no consider parameters are active.

property covariance_history: list#

Posterior covariance \(\hat{P}_0\) propagated to each measurement epoch via the trajectory STMs. Populated after calling fit().

property postfit_residuals: dict#

Post-fit residuals from the batch solution, keyed by dataset name. Populated after calling fit().

property prefit_residuals: dict#

Pre-fit residuals \(y_k\), keyed by dataset name. Populated after calling fit().

property state_deviation_history: list#

State deviation \(\hat{x}_k\) propagated to each measurement epoch. Populated after calling fit().