SlstrLevel1ProductFactory extends SlstrProductFactory { static double getResolutionInKm(String nameEnd) { switch (nameEnd) { case "an": case "ao": case "bn": case "bo": case "cn": case "co": return 0.5; case "fn": case "fo": case "in": case "io": return 1.0; default: throw new IllegalArgumentException("Unsupported resolution on bands ending with: " + nameEnd); } } SlstrLevel1ProductFactory(Sentinel3ProductReader productReader); @Override void dispose(); final static String SLSTR_L1B_USE_PIXELGEOCODINGS; final static String SLSTR_L1B_LOAD_ORPHAN_PIXELS; final static String SLSTR_L1B_CUSTOM_CALIBRATION; final static String SLSTR_L1B_S3MPC_CALIBRATION; }
@Test public void testGetResolutionInKm() { assertEquals(0.5, SlstrLevel1ProductFactory.getResolutionInKm("an"), 1e-8); assertEquals(0.5, SlstrLevel1ProductFactory.getResolutionInKm("ao"), 1e-8); assertEquals(0.5, SlstrLevel1ProductFactory.getResolutionInKm("bn"), 1e-8); assertEquals(0.5, SlstrLevel1ProductFactory.getResolutionInKm("bo"), 1e-8); assertEquals(0.5, SlstrLevel1ProductFactory.getResolutionInKm("cn"), 1e-8); assertEquals(0.5, SlstrLevel1ProductFactory.getResolutionInKm("co"), 1e-8); assertEquals(1.0, SlstrLevel1ProductFactory.getResolutionInKm("fn"), 1e-8); assertEquals(1.0, SlstrLevel1ProductFactory.getResolutionInKm("fo"), 1e-8); assertEquals(1.0, SlstrLevel1ProductFactory.getResolutionInKm("in"), 1e-8); assertEquals(1.0, SlstrLevel1ProductFactory.getResolutionInKm("io"), 1e-8); }
@SuppressWarnings("ResultOfMethodCallIgnored") @Test public void testGetResolutionInKm_invalidNameEnding() { try { SlstrLevel1ProductFactory.getResolutionInKm("heffalump"); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException expected) { } }