[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Developers] Upgraded Interpolators FYI



Hi Hank,

Hank Grabowski <hank@applieddefense.com> a écrit :

All,

With the new Apache Math library came some upgrades to the 2D
interpolators.  The original Bi-Cubic interpolator was returning numbers
that grossly inacurate.  There is now a Piecewise and a modified Bi-Cubic
interpolator that is based on the same principals as the original Bicubic
interpolator but that is returning correct data.  I've changed the two
instances where we used it, Troposopheric correction and Saastamoinen model
to use the new interpolators.  The unit tests are relatively loose so I've
been manually inspecting values by performing the same interpolation using
a variety of interpolation methods in Octave.

Good news is that the Tropospheric correction is working great.  The values
are matching as you'd expect.  The Saastamoinen model is another matter.
The zenith angle spacing for the grid is highly irregular.  This is
throwing the interpolators for a loop, both in Apache Math and in Octave.
The worst of all are the splines, so Piecewise Spline is out.  They are
producing values 2-3x the actual table lookup values.  The Bicubic Apache
Math and linear Octave are producing reasonable results.  Since there is no
2D linear interpolator in Apache Math and the Bicubic is more well behaved
(it is only sampling four nearest neighbor points and derivatives thus not
getting as tripped up by the irrelugar grid spacing), I have it using the
Bicubic rather than Piecewise spline interpolator.  Ideally once Apache
Math has a 2D linear interpolator we should probably use that.  I already
double checked if there is a version of the table with regular gridding and
I can't find any.  I am reluctant to create a new table that does have the
regular spacing or attempt some other transformation to get around the
interpolation problem.

Thanks for the analysis.
Another option we can use is to create a 2D linear interpolator as a private
class only for the sake of Saastamoinen model and contribute it to Apache Commons Math, where it would become a public class belonging to the API. Once a new version of Apache Commons Math including this class will be published, we will remove our private class and use the official one from the math library. We already did this
for Hermite interpolation if I remember correctly.

best regards,
Luc


If the above sounds good I can check this code in.