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:
FilterODWeighted 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,
SRIFBprovides 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
SRIForLKFwhen 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 (
PropagatororMissionSequence) – Defines the reference trajectory and STMs.measurements (
MeasurementSpec) – Measurement specification object.settings (
FilterSettings) – Filter configuration.settings.process_noisemust beNone.traj_name (
str, optional) – Name for the trajectory BSP file.traj_dir (
str, optional) – Directory for the trajectory BSP file.overwrite_traj (
bool, optional) – IfTrue, overwrite any existing trajectory file.
- Raises:
NotImplementedError – If
settings.process_noiseis notNone(process noise is not supported in the batch formulation; useLKForSRIF).
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; useLKForSRIFwhen unmodelled accelerations must be compensated.See also
scarabaeus.SRIFBNumerically superior batch estimator in the square-root information domain; produces the same solution with better conditioning.
scarabaeus.LKFSequential covariance-form filter; supports process noise.
scarabaeus.FilterODBase 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_flagTruewhen Dynamic Model Compensation (DMC) process noise is active.SNC_flagTruewhen State Noise Compensation (SNC) process noise is active.apriori_covariance_estApriori covariance restricted to the estimated parameter subspace.
covariance_analysisTruewhen running in covariance-analysis mode (no measurement updates).covariance_consider_historyConsider-parameter covariance block at each epoch.
covariance_historyPosterior covariance \(\hat{P}_0\) propagated to each measurement epoch via the trajectory STMs.
flag_sequenceTruefor multi-leg (mission-sequence) trajectories.has_considerTrueif consider parameters are present in the state vector.measurement_dataContainer for all measurement datasets, residuals, and editing flags.
measurementsMeasurement specification object passed at construction time.
nDimension of the estimated state vector.
postfit_residualsPost-fit residuals from the batch solution, keyed by dataset name.
prefit_residualsPre-fit residuals \(y_k\), keyed by dataset name.
propagatorPropagator or ScenarioSetup used to build the reference trajectory.
settingsFilter configuration (covariance, process noise, output options).
state_deviation_historyState deviation \(\hat{x}_k\) propagated to each measurement epoch.
trajectoryPropagated 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().