@Test public void testToRaw_Unscaled() { SampleConverterFactory.SampleConverter sampleConverter = SampleConverterFactory.createConverter(band); assertNotNull(sampleConverter); assertEquals(maxRawValue, sampleConverter.toRaw(maxRawValue), 1.0e-6); assertEquals(-356, sampleConverter.toRaw(-356), 1.0e-6); assertEquals(0, sampleConverter.toRaw(0), 1.0e-6); assertEquals(10.8, sampleConverter.toRaw(10.8), 1.0e-6); assertEquals(minRawValue, sampleConverter.toRaw(minRawValue), 1.0e-6); }
@Test public void testToGeoPhysical_Unscaled() { SampleConverterFactory.SampleConverter sampleConverter = SampleConverterFactory.createConverter(band); assertNotNull(sampleConverter); assertEquals(maxRawValue, sampleConverter.toGeoPhysical(maxRawValue), 1.0e-6); assertEquals(-356, sampleConverter.toGeoPhysical(-356), 1.0e-6); assertEquals(0, sampleConverter.toGeoPhysical(0), 1.0e-6); assertEquals(16.0, sampleConverter.toGeoPhysical(16.0), 1.0e-6); assertEquals(minRawValue, sampleConverter.toGeoPhysical(minRawValue), 1.0e-6); }
@Test public void testToRaw_Scaled() { double scalingFactor = 1.1; band.setScalingFactor(scalingFactor); SampleConverterFactory.SampleConverter sampleConverter = SampleConverterFactory.createConverter(band); assertNotNull(sampleConverter); assertEquals(maxRawValue / 1.1, sampleConverter.toRaw(maxRawValue), 1.0e-6); assertEquals(-356 / 1.1, sampleConverter.toRaw(-356), 1.0e-6); assertEquals(0 / 1.1, sampleConverter.toRaw(0), 1.0e-6); assertEquals(10.8 / 1.1, sampleConverter.toRaw(10.8), 1.0e-6); assertEquals(minRawValue / 1.1, sampleConverter.toRaw(minRawValue), 1.0e-6); }
@Test public void testToGeoPhysical_Scaled() { double scalingFactor = 1.1; band.setScalingFactor(scalingFactor); SampleConverterFactory.SampleConverter sampleConverter = SampleConverterFactory.createConverter(band); assertNotNull(sampleConverter); assertEquals(maxRawValue * scalingFactor, sampleConverter.toGeoPhysical(maxRawValue), 1.0e-6); assertEquals(-356 * scalingFactor, sampleConverter.toGeoPhysical(-356), 1.0e-6); assertEquals(0 * scalingFactor, sampleConverter.toGeoPhysical(0), 1.0e-6); assertEquals(16.0 * scalingFactor, sampleConverter.toGeoPhysical(16.0), 1.0e-6); assertEquals(minRawValue * scalingFactor, sampleConverter.toGeoPhysical(minRawValue), 1.0e-6); }