Index out of bounds exception when using org.orekit.estimation.leastsquares.BatchLSEstimator.estimate()

I am building AngularAzEl measurements and a BatchLSEstimator in Matlab, but when I run BatchLSEstimator.estimate() on the AngularAzEl measurements, I get an index out of bounds exception as follows:

Java exception occurred:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.orekit.estimation.leastsquares.AbstractBatchLSModel.fetchEvaluatedMeasurement(
at org.orekit.estimation.leastsquares.MeasurementHandler.handleStep(
at org.orekit.propagation.PropagatorsParallelizer$SinglePropagatorHandler.handleStep(
at org.hipparchus.ode.AbstractIntegrator.acceptStep(
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(
at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(
at org.orekit.propagation.PropagatorsParallelizer.propagate(
at org.orekit.estimation.leastsquares.AbstractBatchLSModel.value(
at org.orekit.estimation.leastsquares.BatchLSEstimator$TappedLSProblem.evaluate(
at org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.optimize(
at org.orekit.estimation.leastsquares.BatchLSEstimator.estimate(

Is there somewhere in my code where I need to be sure that something is indexed properly for the orekit/java-based estimator to run? I did not have this problem when I was running the same estimator with Range measurements, in case that fact sheds any light on the issue.
Thank you for any help.

Hi @erinf

Can you show how do you initialize the AngularAzEl object?
You can check that you initialized the measurement weight and sigma for both azimuth and elevation using a 2-dimensional array.

If it doesn’t solve the issue, can you show us how do you initialize the estimator?


I did not originally have 2-dimensional weights, but now that I am initializing the AngularAzEl measurements with 2D weights, everything seems to work just fine.
Thanks for the help!