Hello All,
I am a new user of the Orekit library, and doing my best to figure it out from the Java documentation and the few example scripts out there. I’m using the Batch Least Squares Estimator with Azimuth and Elevation angles. I’m working off of this script as an example for how to set up a BatchLSEstimator:
The script uses range values, and the data that I have available is in Azimuth and Elevation. It seems to me that the setup would be the exact same, and instead of using the Range() measurement object, use the AngularAzEl(). I’m able to initialize the addmeasurement() for the estimator, but the error comes when I get to the line estimator.estimate(). I know Python well enough to diagnose errors there, but I don’t know Java at all, so anyone who recognizes the error that could help is greatly appreciated!
Here’s my code that deals with the propagator and estimator set up.
#Orbit Propagator Parameters
prop_min_step = 0.001
prop_max_step = 300.0
prop_position_error = 10.0
#Estimator Parameters
estimator_position_scale = 1.0
estimator_convergence_thres = 1e-3
estimator_max_iterations = 25
estimator_max_evaluations = 35
#Measurement Parameters
azError = 0.001
elError = 0.001
azBaseWeight = 1.0
elBaseWeight = 1.0
#Defining Integrator
integratorBuilder = DormandPrince853IntegratorBuilder(prop_min_step,
prop_max_step, prop_position_error)
propagatorBuilder = NumericalPropagatorBuilder(keplerianOrbit,
integratorBuilder, PositionAngle.MEAN,
estimator_position_scale)
nadirPointing = NadirPointing(eci, wgs84Ellipsoid)
propagatorBuilder.setMass(400.0)
propagatorBuilder.setAttitudeProvider(nadirPointing)
########## ADDING PERTURBATIONS
#Earth Gravity Field
gravityProvider = GravityFieldFactory.getConstantNormalizedProvider(64, 64)
gravityAttractionModel = HolmesFeatherstoneAttractionModel(ecef, gravityProvider)
propagatorBuilder.addForceModel(gravityAttractionModel)
#3rd Body
moon_3dbodyattraction = ThirdBodyAttraction(moon)
propagatorBuilder.addForceModel(moon_3dbodyattraction)
sun_3dbodyattraction = ThirdBodyAttraction(sun)
propagatorBuilder.addForceModel(sun_3dbodyattraction)
########## BATCH LEAST SQUARES ESTIMATOR SETUP
#Defining Optimizer
matrixDecomposer = QRDecomposer(1e-11)
optimizer = GaussNewtonOptimizer(matrixDecomposer, False)
#Defining Estimator
estimator = BatchLSEstimator(optimizer, propagatorBuilder)
estimator.setParametersConvergenceThreshold(estimator_convergence_thres)
estimator.setMaxIterations(estimator_max_iterations)
estimator.setMaxEvaluations(estimator_max_evaluations)
########## ADDING MEASUREMENTS
#Add Measurements to Estimator
for j in range(0,len(az)):
orekitAzEl = AngularAzEl(GroundStation(stationFrame),
datetime_to_absolutedate(datetime[j]),
JArray('double')([radians(az[j]),radians(el[j])]),
JArray('double')([radians(azError),radians(elError)]),
JArray('double')([azBaseWeight,elBaseWeight]),
ObservableSatellite(1))
estimator.addMeasurement(orekitAzEl)
########## STATISTICAL ORBIT DETERMINATION
estimatedPropagatorArray = estimator.estimate()
Here’s the error I’m getting:
Traceback (most recent call last):
File "EstimationLockheed.py", line 279, in <module>
estimatedPropagatorArray = estimator.estimate()
orekit.JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.orekit.estimation.measurements.AngularAzEl.theoreticalEvaluation(AngularAzEl.java:88)
at org.orekit.estimation.measurements.AbstractMeasurement.estimate(AbstractMeasurement.java:204)
at org.orekit.estimation.leastsquares.MeasurementHandler.handleStep(MeasurementHandler.java:95)
at org.orekit.propagation.PropagatorsParallelizer$SinglePropagatorHandler.handleStep(PropagatorsParallelizer.java:322)
at org.orekit.propagation.integration.AbstractIntegratedPropagator$AdaptedStepHandler.handleStep(AbstractIntegratedPropagator.java:856)
at org.hipparchus.ode.AbstractIntegrator.acceptStep(AbstractIntegrator.java:429)
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:290)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:466)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:414)
at org.orekit.propagation.PropagatorsParallelizer.propagate(PropagatorsParallelizer.java:141)
at org.orekit.estimation.leastsquares.BatchLSModel.value(BatchLSModel.java:245)
at org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory$LocalLeastSquaresProblem.evaluate(LeastSquaresFactory.java:440)
at org.orekit.estimation.leastsquares.BatchLSEstimator$TappedLSProblem.evaluate(BatchLSEstimator.java:602)
at org.hipparchus.optim.nonlinear.vector.leastsquares.GaussNewtonOptimizer.optimize(GaussNewtonOptimizer.java:399)
at org.orekit.estimation.leastsquares.BatchLSEstimator.estimate(BatchLSEstimator.java:422)
Any help diagnosing the problem is greatly appreciated! If you need more explanation I’m glad to help!