Class BatchLSEstimator
- java.lang.Object
-
- org.orekit.estimation.leastsquares.BatchLSEstimator
-
- Direct Known Subclasses:
SequentialBatchLSEstimator
public class BatchLSEstimator extends Object
Least squares estimator for orbit determination.The least squares estimator can be used with different orbit propagators in Orekit. Current propagators list of usable propagators are
numerical
,DSST
,Brouwer-Lyddane
,Eckstein-Hechler
,SGP4
,Keplerian
, andephemeris-based
.- Since:
- 8.0
- Author:
- Luc Maisonobe
-
-
Constructor Summary
Constructors Constructor Description BatchLSEstimator(LeastSquaresOptimizer optimizer, PropagatorBuilder... propagatorBuilder)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMeasurement(ObservedMeasurement<?> measurement)
Add a measurement.Propagator[]
estimate()
Estimate the orbital, propagation and measurements parameters.int
getEvaluationsCount()
Get the number of evaluations used for last estimation.int
getIterationsCount()
Get the number of iterations used for last estimation.Map<ObservedMeasurement<?>,EstimatedMeasurement<?>>
getLastEstimations()
Get the last estimations performed.ParameterDriversList
getMeasurementsParametersDrivers(boolean estimatedOnly)
Get the measurements parameters supported by this estimator (including measurements and modifiers).LeastSquaresOptimizer.Optimum
getOptimum()
Get the optimum found.ParameterDriversList
getOrbitalParametersDrivers(boolean estimatedOnly)
Get the orbital parameters supported by this estimator.RealMatrix
getPhysicalCovariances(double threshold)
Get the covariances matrix in space flight dynamics physical units.ParameterDriversList
getPropagatorParametersDrivers(boolean estimatedOnly)
Get the propagator parameters supported by this estimator.void
setConvergenceChecker(ConvergenceChecker<LeastSquaresProblem.Evaluation> convergenceChecker)
Set a custom convergence checker.void
setMaxEvaluations(int maxEvaluations)
Set the maximum number of model evaluations.void
setMaxIterations(int maxIterations)
Set the maximum number of iterations.void
setObserver(BatchLSObserver observer)
Set an observer for iterations.void
setParametersConvergenceThreshold(double parametersConvergenceThreshold)
Set convergence threshold.
-
-
-
Constructor Detail
-
BatchLSEstimator
public BatchLSEstimator(LeastSquaresOptimizer optimizer, PropagatorBuilder... propagatorBuilder)
Simple constructor.If multiple
propagator builders
are set up, the orbits of several spacecrafts will be used simultaneously. This is useful if the propagators share some model or measurements parameters (typically pole motion, prime meridian correction or ground stations positions).Setting up multiple
propagator builders
is also useful when inter-satellite measurements are used, even if only one of the orbit is estimated and the other ones are fixed. This is typically used when very high accuracy GNSS measurements are needed and the navigation bulletins are not considered accurate enough and the navigation constellation must be propagated numerically.- Parameters:
optimizer
- solver for least squares problempropagatorBuilder
- builders to use for propagation
-
-
Method Detail
-
setObserver
public void setObserver(BatchLSObserver observer)
Set an observer for iterations.- Parameters:
observer
- observer to be notified at the end of each iteration
-
addMeasurement
public void addMeasurement(ObservedMeasurement<?> measurement)
Add a measurement.- Parameters:
measurement
- measurement to add
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Set the maximum number of iterations.The iterations correspond to the top level iterations of the
least squares optimizer
.- Parameters:
maxIterations
- maxIterations maximum number of iterations- See Also:
setMaxEvaluations(int)
,getIterationsCount()
-
setMaxEvaluations
public void setMaxEvaluations(int maxEvaluations)
Set the maximum number of model evaluations.The evaluations correspond to the orbit propagations and measurements estimations performed with a set of estimated parameters.
For
Gauss-Newton optimizer
there is one evaluation at each iteration, so the maximum numbers may be set to the same value. ForLevenberg-Marquardt optimizer
, there can be several evaluations at some iterations (typically for the first couple of iterations), so the maximum number of evaluations may be set to a higher value than the maximum number of iterations.- Parameters:
maxEvaluations
- maximum number of model evaluations- See Also:
setMaxIterations(int)
,getEvaluationsCount()
-
getOrbitalParametersDrivers
public ParameterDriversList getOrbitalParametersDrivers(boolean estimatedOnly)
Get the orbital parameters supported by this estimator.If there are more than one propagator builder, then the names of the drivers have an index marker in square brackets appended to them in order to distinguish the various orbits. So for example with one builder generating Keplerian orbits the names would be simply "a", "e", "i"... but if there are several builders the names would be "a[0]", "e[0]", "i[0]"..."a[1]", "e[1]", "i[1]"...
- Parameters:
estimatedOnly
- if true, only estimated parameters are returned- Returns:
- orbital parameters supported by this estimator
-
getPropagatorParametersDrivers
public ParameterDriversList getPropagatorParametersDrivers(boolean estimatedOnly)
Get the propagator parameters supported by this estimator.- Parameters:
estimatedOnly
- if true, only estimated parameters are returned- Returns:
- propagator parameters supported by this estimator
-
getMeasurementsParametersDrivers
public ParameterDriversList getMeasurementsParametersDrivers(boolean estimatedOnly)
Get the measurements parameters supported by this estimator (including measurements and modifiers).- Parameters:
estimatedOnly
- if true, only estimated parameters are returned- Returns:
- measurements parameters supported by this estimator
-
setParametersConvergenceThreshold
public void setParametersConvergenceThreshold(double parametersConvergenceThreshold)
Set convergence threshold.The convergence used for estimation is based on the estimated parameters
normalized values
. Convergence is considered to have been reached when the difference between previous and current normalized value is less than the convergence threshold for all parameters. The same value is used for all parameters since they are normalized and hence dimensionless.Normalized values are computed as
(current - reference)/scale
, so convergence is reached when the following condition holds for all estimated parameters:|current[i] - previous[i]| <= threshold * scale[i]
So the convergence threshold specified here can be considered as a multiplication factor applied to scale. Since for all parameters the scale is often small (typically about 1 m for orbital positions for example), then the threshold should not be too small. A value of 10⁻³ is often quite accurate.
Calling this method overrides any checker that could have been set beforehand by calling
setConvergenceChecker(ConvergenceChecker)
. Both methods are mutually exclusive.- Parameters:
parametersConvergenceThreshold
- convergence threshold on normalized parameters (dimensionless, related to parameters scales)- See Also:
setConvergenceChecker(ConvergenceChecker)
,EvaluationRmsChecker
-
setConvergenceChecker
public void setConvergenceChecker(ConvergenceChecker<LeastSquaresProblem.Evaluation> convergenceChecker)
Set a custom convergence checker.Calling this method overrides any checker that could have been set beforehand by calling
setParametersConvergenceThreshold(double)
. Both methods are mutually exclusive.- Parameters:
convergenceChecker
- convergence checker to set- Since:
- 10.1
- See Also:
setParametersConvergenceThreshold(double)
-
estimate
public Propagator[] estimate()
Estimate the orbital, propagation and measurements parameters.The initial guess for all parameters must have been set before calling this method using
getOrbitalParametersDrivers(boolean)
,getPropagatorParametersDrivers(boolean)
, andgetMeasurementsParametersDrivers(boolean)
and thensetting the values
of the parameters.For parameters whose reference date has not been set to a non-null date beforehand (i.e. the parameters for which
ParameterDriver.getReferenceDate()
returnsnull
, a default reference date will be set automatically at the start of the estimation to theinitial orbit date
of the first propagator builder. For parameters whose reference date has been set to a non-null date, this reference date is untouched.After this method returns, the estimated parameters can be retrieved using
getOrbitalParametersDrivers(boolean)
,getPropagatorParametersDrivers(boolean)
, andgetMeasurementsParametersDrivers(boolean)
and thengetting the values
of the parameters.As a convenience, the method also returns a fully configured and ready to use propagator set up with all the estimated values.
For even more in-depth information, the
getOptimum()
method provides detailed elements (covariance matrix, estimated parameters standard deviation, weighted Jacobian, RMS, χ², residuals and more).- Returns:
- propagators configured with estimated orbits as initial states, and all propagators estimated parameters also set
-
getLastEstimations
public Map<ObservedMeasurement<?>,EstimatedMeasurement<?>> getLastEstimations()
Get the last estimations performed.- Returns:
- last estimations performed
-
getOptimum
public LeastSquaresOptimizer.Optimum getOptimum()
Get the optimum found.The
LeastSquaresOptimizer.Optimum
object contains detailed elements (covariance matrix, estimated parameters standard deviation, weighted Jacobian, RMS, χ², residuals and more).Beware that the returned object is the raw view from the underlying mathematical library. At this raw level, parameters have
normalized values
whereas the space flight parameters havephysical values
with their units. So there arescaling factors
to apply when using these elements.- Returns:
- optimum found after last call to
estimate()
-
getPhysicalCovariances
public RealMatrix getPhysicalCovariances(double threshold)
Get the covariances matrix in space flight dynamics physical units.This method retrieve the
covariances
from the [@linkoptimum
and applies the scaling factors to it in order to convert it from raw normalized values back to physical values.- Parameters:
threshold
- threshold to identify matrix singularity- Returns:
- covariances matrix in space flight dynamics physical units
- Since:
- 9.1
-
getIterationsCount
public int getIterationsCount()
Get the number of iterations used for last estimation.- Returns:
- number of iterations used for last estimation
- See Also:
setMaxIterations(int)
-
getEvaluationsCount
public int getEvaluationsCount()
Get the number of evaluations used for last estimation.- Returns:
- number of evaluations used for last estimation
- See Also:
setMaxEvaluations(int)
-
-