On 12/30/2014 07:12 PM, Hank Grabowski wrote:
> That can work. I wanted to add linear interpolation to the Apache Math
> library too, among other upgrades in that area. When are we targeting
> release? I want to make sure I have appropriate time to write tests etc
> before commiting the code with that change.
Hi Hank,
thanks for spending so much work to fix the interpolators in Commons Math.
When I implemented the Saastamoinen model, I had to use the
BicubicSpline interpolator as there was no linear interpolator available
for the 2D case, but it turns out this one is highly inappropriate for
the problem.
It would be great if you could also improve the test cases. They are
very shallow at the moment, and the model has never properly been
verified from my side (it was a byside product of a project I was
working on, but I had to stop working on it).
Thomas
>
> On Tue, Dec 30, 2014 at 12:31 PM, MAISONOBE Luc <luc.maisonobe@c-s.fr
> <mailto:luc.maisonobe@c-s.fr>> wrote:
>
> Hi Hank,
>
> Hank Grabowski <hank@applieddefense.com
> <mailto: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.
>
>
>
>