Hi all,
I have been working for months on issue 1867. It is a huge change, with many side effects. I have set up a branch for it. It doesn’t work yet, far from it. It compiles, I think it has everything I wanted in it, I think the design is clean, but there are 35 tests that do not work, and I am at a loss now.
I also think the goal is not very far now, and I really do not want to throw away all this work, it should go into V14.0. I however really need help from someone else here to finish this task, I just cannot do it alone anymore. I am stuck in my own views and my own choices. I am sure I don’t see obvious design or coding errors I made, so I need fresh eyes and people fixing my errors and making all tests pass.
The basic principles of this change are simple: add some higher level interface above orbits, TLE and GNSS orbital elements, throw in a hierarchy of factories to built these just as we have factories for ODE integrators or propagators, and use everything in orbit determination, conversion, fitting, optimization… The low level implementation is complicated. Of course there is always the problem of primitive double and Field objects and how they interact. There is also the problem of partial derivatives, with Gradient fields, but also FieldGradient, matrices harvester, gradient converters. There is also the problem of the deep hierarchy needed for the GNSS stuff (all constellations, navigation messages, almanacs, propagators, legacy messages, civilian messages in several versions…).
One of the side effects of this change is that GNSS propagators now use Keplerian elements instead of Cartesian elements, and this changed state transition matrices. This was already partly supported as MatrixHarvester has agetOrbitType method, but at some points it was ignored. I discovered for example that AbstractAnalyticalMatricesHarvester.setReferenceState assumed we used Cartesian elements, ignoring what getOrbitType returned for the current harvester implementation. So there are mismatches at several places. I found and fixed some of them, but not all, so some tests have completely wrong results. I am also confused by the {Field}GNSSPropagator constructor that uses orbital elements as its first argument. When I set the initial state, I have to use Orbit orbit = propagateOrbit(orbitalElements.getDate()), i.e. I have to perform a 0 seconds propagation, I cannot use Orbit orbit = orbitalElements.getOrbit() despite it should already be correct. If I simplify the call (i.e. don’t propagate), one test behaves partly better (I get 1.0 for ∂a(t₀)/∂a₀, which is expected, but I get non zero values for other partial derivatives) but other tests fail dramatically. If I keep the propagation, this test fails for ∂a(t₀)/∂a₀, but some tests for other classes succeed.
The tests that fail are mainly concentrated on GNSS, TLE and DSST and related to orbit determination (all kinds: batch least squares, Kalman, unscented Kalman…) and partial derivatives.
As I wrote above, I am at a loss now, and I am in dire straits. Could someone step in and look at this mess?