CalibrationAlgorithm { public double calibrate(int bandIndex, int detectorIndex, double radiance) { return newGains[bandIndex][detectorIndex] / oldGains[bandIndex][detectorIndex] * radiance; } CalibrationAlgorithm(Resolution resolution, double cntJD,
                                InputStream sourceRacStream, InputStream targetRacStream); double calibrate(int bandIndex, int detectorIndex, double radiance);  }
@Test public void calibration() throws IOException, URISyntaxException { final String oldRacResource = "MER_RAC_AXVIEC20050708_135553_20021224_121445_20041213_220000"; final String newRacResource = "MER_RAC_AXVACR20091016_154511_20021224_121445_20041213_220000"; final InputStream oldRacStream = getClass().getResourceAsStream(oldRacResource); final InputStream newRacStream = getClass().getResourceAsStream(newRacResource); final CalibrationAlgorithm calibrationAlgorithm = new CalibrationAlgorithm(Resolution.RR, 1247.4, oldRacStream, newRacStream); final double sourceRadiance = 119.61037; final double targetRadiance = 120.02557; assertEquals(targetRadiance, calibrationAlgorithm.calibrate(0, 759, sourceRadiance), 1.0e-4); }