SlstrLevel1ProductFactory extends SlstrProductFactory { static String[] getGeolocationVariableNames(String extension) throws IOException { final String[] varNames = new String[2]; if (!(extension.equals("an") || extension.equals("ao") || extension.equals("bn") || extension.equals("bo") || extension.equals("cn") || extension.equals("co") || extension.equals("in") || extension.equals("io") || extension.equals("fn") || extension.equals("fo"))) { throw new IOException("Unknown or unsupported band extension: " + extension); } varNames[0] = "longitude_" + extension; varNames[1] = "latitude_" + extension; return varNames; } 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 testGetGeolocationVariableNames() throws IOException { String[] variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("an"); assertEquals("longitude_an", variableNames[0]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("ao"); assertEquals("latitude_ao", variableNames[1]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("bn"); assertEquals("longitude_bn", variableNames[0]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("bo"); assertEquals("latitude_bo", variableNames[1]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("cn"); assertEquals("longitude_cn", variableNames[0]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("co"); assertEquals("latitude_co", variableNames[1]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("in"); assertEquals("longitude_in", variableNames[0]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("io"); assertEquals("latitude_io", variableNames[1]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("fn"); assertEquals("longitude_fn", variableNames[0]); variableNames = SlstrLevel1ProductFactory.getGeolocationVariableNames("fo"); assertEquals("latitude_fo", variableNames[1]); }
@SuppressWarnings("ResultOfMethodCallIgnored") @Test public void testGetGeolocationVariableNames_invalidExtension() { try { SlstrLevel1ProductFactory.getGeolocationVariableNames("quatsch"); fail("IOException expected"); } catch (IOException expected) { } }