Example usage for org.apache.commons.math3.analysis.interpolation BicubicSplineInterpolator BicubicSplineInterpolator

List of usage examples for org.apache.commons.math3.analysis.interpolation BicubicSplineInterpolator BicubicSplineInterpolator

Introduction

In this page you can find the example usage for org.apache.commons.math3.analysis.interpolation BicubicSplineInterpolator BicubicSplineInterpolator.

Prototype

BicubicSplineInterpolator

Source Link

Usage

From source file:es.csic.iiia.planes.generator.HotspotFactory.java

public HotspotFactory() {
    BicubicSplineInterpolator inter = new BicubicSplineInterpolator();
    double[] radiuses = new double[] { 100, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 5000, 7000,
            10000, 25000, 50000, 100000 };
    double[] fdgs = new double[] { 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 32.0, 64.0, 128.0 };
    // Experimentally computed.
    double[][] values = new double[][] {
            { 405.47, 2249.26, 2929.02, 3245.37, 3460.22, 3593.05, 3692.03, 3815.16, 4033.87, 4148.16,
                    4210.06 },/*from   w ww.  j  a v a 2  s .c  om*/
            { 2968.52, 14222.81, 18313.46, 20326.07, 21806.51, 22662.14, 23208.42, 23715.36, 25399.66, 26366.71,
                    26669.29 },
            { 11213.85, 55990.07, 73734.04, 82140.39, 87385.68, 88682.35, 92760.70, 95482.55, 102553.38,
                    105103.14, 106806.93 },
            { 49010.42, 228663.46, 295423.52, 326927.76, 352059.91, 360898.96, 374135.74, 384004.46, 402880.87,
                    422733.12, 426979.72 },
            { 115141.73, 515877.92, 656511.88, 731540.31, 785563.46, 817558.16, 834833.64, 858172.82, 915961.39,
                    950127.27, 958091.43 },
            { 204488.77, 921193.48, 1194094.21, 1305641.74, 1393569.24, 1446751.68, 1494515.20, 1521839.27,
                    1623172.70, 1686522.80, 1706109.61 },
            { 315962.07, 1427293.32, 1838333.85, 2064526.84, 2194314.20, 2282070.43, 2347560.39, 2380895.84,
                    2566872.52, 2633651.58, 2664563.70 },
            { 427402.56, 2057424.10, 2649570.01, 2979870.78, 3138320.77, 3284114.26, 3347837.38, 3415020.60,
                    3666426.01, 3759020.21, 3831823.12 },
            { 588781.11, 2824186.51, 3679129.07, 4033130.44, 4296367.15, 4487871.28, 4499515.48, 4656533.71,
                    4974616.82, 5119953.21, 5228491.07 },
            { 764263.69, 3552337.37, 4658250.05, 5201606.45, 5601340.75, 5765557.99, 6004937.42, 6099531.86,
                    6506965.21, 6716150.71, 6813582.92 },
            { 1167242.51, 5832821.77, 7370311.81, 8212437.61, 8763425.19, 9025475.86, 9310137.75, 9504330.19,
                    1.015490172E7, 1.051851015E7, 1.068713522E7 },
            { 2157176.614293723, 1.1242706314638646E7, 1.4610912287986722E7, 1.6000820081017397E7,
                    1.7124023186361756E7, 1.7893695648083758E7, 1.8246629972280245E7, 1.86383199195E7,
                    2.0084456422591142E7, 2.0566576138001565E7, 2.0896906104497E7 },
            { 4353500.393840918, 2.2988463081825737E7, 2.90549513038103E7, 3.280577237113928E7,
                    3.505216806709763E7, 3.604196664145296E7, 3.723929675445001E7, 3.805951964896238E7,
                    4.0605647635320775E7, 4.19957866558411E7, 4.277469428119505E7 },
            { 3.0975287951548893E7, 1.4297738646852845E8, 1.8458068323599958E8, 2.0489308970397E8,
                    2.1621100173077223E8, 2.272566465399154E8, 2.3372887770569384E8, 2.39182577766E8,
                    2.5454589512049797E8, 2.627388914202363E8, 2.6594602068012756E8 },
            { 1.3397558666247673E8, 5.84929730287084E8, 7.364682859358164E8, 8.296083638249468E8,
                    8.772037655540453E8, 9.173318681253092E8, 9.387704256188443E8, 9.455243965367795E8,
                    1.0141183227504988E9, 1.0488870113744953E9, 1.0693285060195222E9 },
            { 5.929071321009706E8, 2.271864712273714E9, 2.976139403928371E9, 3.3049771712232704E9,
                    3.5117145404836836E9, 3.648988582554893E9, 3.721228014208862E9, 3.7931515695400E9,
                    4.0630762547608566E9, 4.1839517129751816E9, 4.2590029659393644E9 }, };
    interpolator = inter.interpolate(radiuses, fdgs, values);
}

From source file:org.esa.s3tbx.olci.radiometry.rayleigh.RayleighAux.java

void setInterpolation() {
    BicubicSplineInterpolator gridInterpolator = new BicubicSplineInterpolator();
    Map<Integer, List<double[]>> interpolate = new HashMap<>();
    double[] sunZenithAngles = getSunZenithAngles();
    double[] viewZenithAngles = getViewZenithAngles();

    //todo mba ask Mp if to use this approach.
    assert sunZenithAngles != null;

    if (Objects.nonNull(sunZenithAngles) && Objects.nonNull(viewZenithAngles)) {
        for (int index = 0; index < sunZenithAngles.length; index++) {
            double yVal = viewZenithAngles[index];
            double xVal = sunZenithAngles[index];

            List<double[]> valueList = new ArrayList<>();
            for (int i = 0; i < rayCooefMatrixA.length; i++) {
                double thetaMin = thetas[0];
                double thetaMax = thetas[thetas.length - 1];

                if (yVal > thetaMin && yVal < thetaMax) {
                    double[] values = new double[4];
                    values[0] = gridInterpolator.interpolate(thetas, thetas, rayCooefMatrixA[i]).value(xVal,
                            yVal);/*from  w ww. j  a va  2 s. c om*/
                    values[1] = gridInterpolator.interpolate(thetas, thetas, rayCooefMatrixB[i]).value(xVal,
                            yVal);
                    values[2] = gridInterpolator.interpolate(thetas, thetas, rayCooefMatrixC[i]).value(xVal,
                            yVal);
                    values[3] = gridInterpolator.interpolate(thetas, thetas, rayCooefMatrixD[i]).value(xVal,
                            yVal);
                    valueList.add(values);
                } else {
                    valueList.add(new double[] { 0, 0, 0, 0 });
                }
            }
            interpolate.put(index, valueList);
        }
        interpolateMap = interpolate;
    }
}

From source file:org.esa.s3tbx.olci.radiometry.rayleigh.SpikeInterpolation.java

public static double useApacheMath(double[] xval, double[] yval, double[][] fval, double x, double y) {
    BicubicSplineInterpolator interpolator = new BicubicSplineInterpolator();
    BicubicSplineInterpolatingFunction interpolate = interpolator.interpolate(xval, yval, fval);
    return interpolate.value(x, y);

}