problem getting UTC timescale
Hello,
I've got a really annoying problem using Orekit v5.
I am using a numerical integrator to propagate an orbit over a long
period to simulate station keeping.
The propagation works fine for several years, then, sometimes, in an
unpredictable way, the following exception occurs:
java.lang.ArrayIndexOutOfBoundsException: 26 at org.orekit.time.UTCScale.setCurrent(UTCScale.java:161) at org.orekit.time.UTCScale.offsetFromTAI(UTCScale.java:97) at org.orekit.frames.TIRF2000Frame.updateFrame(TIRF2000Frame.java:126) at org.orekit.frames.Frame.getTransformTo(Frame.java:193) at org.orekit.forces.gravity.CunninghamAttractionModel.addContribution(CunninghamAttractionModel.java:124) at org.orekit.propagation.numerical.NumericalPropagator$DifferentialEquations.computeDerivatives(NumericalPropagator.java:521) at org.apache.commons.math.ode.AbstractIntegrator.computeDerivatives(AbstractIntegrator.java:182) at org.apache.commons.math.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:273) at org.orekit.propagation.numerical.NumericalPropagator.propagate(NumericalPropagator.java:419) at fr.tas.anamis.study.o3b.O3bStationKeeping.propagate(O3bStationKeeping.java:605)
This "26" out of bounds exception comes from the TAI to UTC conversion
in UTCScale class
There is a table of 26 values (26 lines in UTC-TAI.history file) with
index from 0 to 25.
So when the index "current" is incremented to 26 there is an out of
bound exception :
@ private synchronized void setCurrent(final AbsoluteDate date) {
while (date.compareTo(offsets[current].getValidityStart()) < 0) {
--current;
}
while (date.compareTo(offsets[current].getValidityEnd()) >= 0) {
++current;
}
}
@
I've tried several workarounds, but nothing really satisfying...
This problem seems not to occur with Orekit v4.
It may be due to a bad use, but I don't understand why it works 99.9% of
time.
Anyway I think this exception should be properly raised by Orekit
(should not be java.lang.ArrayIndexOutOfBoundsException: 26 )
I would appreciate if you could help
Thanks.
(from redmine: issue id 27, created on 2011-06-28, closed on 2011-06-28)