RayleighCorrAlgorithm { double[] getCrossSectionSigma(Product sourceProduct, int numBands, String getBandNamePattern) { if (sensor != null && sensor == Sensor.S2_MSI) { return getCrossSection(S2Utils.getS2TrueWavelengths()); } else if (sensor != null && sensor == Sensor.OLCI) { double[] wavelength; if (isSentinelB(sourceProduct)) { wavelength = new double[]{400.5946791630635, 411.9509453369866, 442.9881235940998, 490.3991247296052, 510.4022075929168, 560.3663252369439, 620.2839618019312, 665.1312164230563, 673.8681527151621, 681.3856157084324, 708.9820148630681, 754.0283289464179, 761.5594400832483, 764.6921706636257, 767.8224408129396, 779.0792072094514, 865.2710905079641, 884.1272744748017, 899.121616355846, 938.7977736873601, 1015.7390081732657}; } else { wavelength = new double[]{400.3031914558257, 411.8452957525705, 442.9625672120682, 490.4930356580268, 510.46748124416945, 560.4502797598624, 620.4092905501666, 665.2744162328253, 674.0251490485472, 681.5706005756095, 709.1148593849875, 754.1813240203888, 761.7260948029898, 764.8247093465473, 767.9174355161354, 779.2567595815481, 865.4296340763456, 884.3082558969855, 899.3107685704568, 938.9730748611009, 1015.7990909091901}; } return getCrossSection(wavelength); } else { double[] wavelength = new double[numBands]; for (int i = 0; i < numBands; i++) { wavelength[i] = sourceProduct.getBand(String.format(getBandNamePattern, i + 1)).getSpectralWavelength(); } return getCrossSection(wavelength); } } RayleighCorrAlgorithm(String bandPattern, int numBands);  RayleighCorrAlgorithm(Sensor sensor); RayleighOutput getRayleighReflectance(RayleighInput rayleighInput, RayleighAux rayleighAux,
                                                 double[] absorptionOfBand, Product product); void getRayleighThicknessBodhaineTest();  }
@Test public void testCrossSectionSigma() { Product product = new Product("dummy", "dummy"); Band b1 = createBand("radiance_1", 1); Band b2 = createBand("radiance_2", 2); Band b3 = createBand("radiance_3", 3); Band b4 = createBand("radiance_4", 4); product.addBand(b1); product.addBand(b2); product.addBand(b3); product.addBand(b4); double[] allWavelengths = algo.getCrossSectionSigma(product, 3, "radiance_%d"); assertArrayEquals(new double[]{1.0041580107718594E-9, 3.915403961025194E-12, 1.5231224042681756E-13}, allWavelengths, 1e-8); }