@Test public void testRightValuesForNoneLeapYear() { assertArrayEquals(computeCorrectedFlux(0, 2005), lookup.getCorrectedFluxFor(0, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(23, 2005), lookup.getCorrectedFluxFor(23, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(50, 2005), lookup.getCorrectedFluxFor(50, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(77, 2005), lookup.getCorrectedFluxFor(77, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(100, 2005), lookup.getCorrectedFluxFor(100, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(119, 2005), lookup.getCorrectedFluxFor(119, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(150, 2005), lookup.getCorrectedFluxFor(150, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(176, 2005), lookup.getCorrectedFluxFor(176, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(200, 2005), lookup.getCorrectedFluxFor(200, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(250, 2005), lookup.getCorrectedFluxFor(250, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(300, 2005), lookup.getCorrectedFluxFor(300, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(325, 2005), lookup.getCorrectedFluxFor(325, 2005), 1e-12); assertArrayEquals(computeCorrectedFlux(365, 2005), lookup.getCorrectedFluxFor(365, 2005), 1e-12); }
public double[] getCorrectedFluxFor(int doy, int year) { final int yearDays = SolarFluxCorrectionFactorCalculator.getNumDaysInTheYear(year); int yearIndex = yearDays - 365; double[] corrected = correctedSolFluxForADay[yearIndex][doy]; if (corrected != null) { return corrected; } final double correctionFactor = SolarFluxCorrectionFactorCalculator.getDayCorrectionFactorFor(doy, year); corrected = new double[solFlux.length]; for (int i = 0; i < solFlux.length; i++) { corrected[i] = solFlux[i] * correctionFactor; } correctedSolFluxForADay[yearIndex][doy] = corrected; return corrected; }
SolarFluxLazyLookup { public double[] getCorrectedFluxFor(int doy, int year) { final int yearDays = SolarFluxCorrectionFactorCalculator.getNumDaysInTheYear(year); int yearIndex = yearDays - 365; double[] corrected = correctedSolFluxForADay[yearIndex][doy]; if (corrected != null) { return corrected; } final double correctionFactor = SolarFluxCorrectionFactorCalculator.getDayCorrectionFactorFor(doy, year); corrected = new double[solFlux.length]; for (int i = 0; i < solFlux.length; i++) { corrected[i] = solFlux[i] * correctionFactor; } correctedSolFluxForADay[yearIndex][doy] = corrected; return corrected; } }
SolarFluxLazyLookup { public double[] getCorrectedFluxFor(int doy, int year) { final int yearDays = SolarFluxCorrectionFactorCalculator.getNumDaysInTheYear(year); int yearIndex = yearDays - 365; double[] corrected = correctedSolFluxForADay[yearIndex][doy]; if (corrected != null) { return corrected; } final double correctionFactor = SolarFluxCorrectionFactorCalculator.getDayCorrectionFactorFor(doy, year); corrected = new double[solFlux.length]; for (int i = 0; i < solFlux.length; i++) { corrected[i] = solFlux[i] * correctionFactor; } correctedSolFluxForADay[yearIndex][doy] = corrected; return corrected; } SolarFluxLazyLookup(double[] solFlux); }
SolarFluxLazyLookup { public double[] getCorrectedFluxFor(int doy, int year) { final int yearDays = SolarFluxCorrectionFactorCalculator.getNumDaysInTheYear(year); int yearIndex = yearDays - 365; double[] corrected = correctedSolFluxForADay[yearIndex][doy]; if (corrected != null) { return corrected; } final double correctionFactor = SolarFluxCorrectionFactorCalculator.getDayCorrectionFactorFor(doy, year); corrected = new double[solFlux.length]; for (int i = 0; i < solFlux.length; i++) { corrected[i] = solFlux[i] * correctionFactor; } correctedSolFluxForADay[yearIndex][doy] = corrected; return corrected; } SolarFluxLazyLookup(double[] solFlux); double[] getCorrectedFluxFor(int doy, int year); }
SolarFluxLazyLookup { public double[] getCorrectedFluxFor(int doy, int year) { final int yearDays = SolarFluxCorrectionFactorCalculator.getNumDaysInTheYear(year); int yearIndex = yearDays - 365; double[] corrected = correctedSolFluxForADay[yearIndex][doy]; if (corrected != null) { return corrected; } final double correctionFactor = SolarFluxCorrectionFactorCalculator.getDayCorrectionFactorFor(doy, year); corrected = new double[solFlux.length]; for (int i = 0; i < solFlux.length; i++) { corrected[i] = solFlux[i] * correctionFactor; } correctedSolFluxForADay[yearIndex][doy] = corrected; return corrected; } SolarFluxLazyLookup(double[] solFlux); double[] getCorrectedFluxFor(int doy, int year);  }