DataInterpolatorStatic extends DataInterpolator { @Override public double getValue(double timeMJD, double lat, double lon) { final double startValue = getStartValue(lat, lon); final double endValue = getEndValue(lat, lon); return startValue + (timeMJD - startTimeMJD) / (endTimeMJD - startTimeMJD) * (endValue - startValue); } DataInterpolatorStatic(double startTimeMJD, double endTimeMJD, Product startProduct, Product endProduct, final String bandName, double defaultValue); @Override double getValue(double timeMJD, double lat, double lon); @Override void dispose();  }
@Test public void testGetStartTimeValue() throws Exception { assertEquals(3.0, di.getValue(startTimeMJD, 45, -90)); assertEquals(4.0, di.getValue(startTimeMJD, 45, 90)); assertEquals(5.0, di.getValue(startTimeMJD, -45, -90)); assertEquals(6.0, di.getValue(startTimeMJD, -45, 90)); }
@Test public void testGetEndTimeValue() throws Exception { assertEquals(8.0, di.getValue(endTimeMJD, 45, -90)); assertEquals(11.2, di.getValue(endTimeMJD, 45, 90)); assertEquals(2.7, di.getValue(endTimeMJD, -45, -90)); assertEquals(12.25, di.getValue(endTimeMJD, -45, 90)); }
@Test public void testGetCenterTimeValue() throws Exception { final double centerTimeMJD = (endTimeMJD - startTimeMJD) / 2 + startTimeMJD; assertEquals(5.5, di.getValue(centerTimeMJD, 45, -90)); assertEquals(7.6, di.getValue(centerTimeMJD, 45, 90)); assertEquals(3.85, di.getValue(centerTimeMJD, -45, -90)); assertEquals(9.125, di.getValue(centerTimeMJD, -45, 90)); }