@Test public void testMODIS500() { Product product = new Product("dummy", "dummy-modis500", 2, 2); MetadataElement root = product.getMetadataRoot(); MetadataElement mph = new MetadataElement("MPH"); mph.setAttributeString("identifier_product_doi", "10.5067/MODIS/MOD09A1.006"); root.addElement(mph); assertEquals(Instrument.MODIS500, DetectInstrument.getInstrument(product)); }
static Instrument getInstrument(Product product) { if (meris(product)) { return Instrument.MERIS; } else if (modis1km(product)) { return Instrument.MODIS; } else if (modis500m(product)) { return Instrument.MODIS500; } else if (s2msi(product)) { return Instrument.S2_MSI; } else if (olci(product)) { return Instrument.OLCI; } else if (seawifs(product)) { return Instrument.SEAWIFS; } else if (czcs(product)) { return Instrument.CZCS; } return null; }
DetectInstrument { static Instrument getInstrument(Product product) { if (meris(product)) { return Instrument.MERIS; } else if (modis1km(product)) { return Instrument.MODIS; } else if (modis500m(product)) { return Instrument.MODIS500; } else if (s2msi(product)) { return Instrument.S2_MSI; } else if (olci(product)) { return Instrument.OLCI; } else if (seawifs(product)) { return Instrument.SEAWIFS; } else if (czcs(product)) { return Instrument.CZCS; } return null; } }
DetectInstrument { static Instrument getInstrument(Product product) { if (meris(product)) { return Instrument.MERIS; } else if (modis1km(product)) { return Instrument.MODIS; } else if (modis500m(product)) { return Instrument.MODIS500; } else if (s2msi(product)) { return Instrument.S2_MSI; } else if (olci(product)) { return Instrument.OLCI; } else if (seawifs(product)) { return Instrument.SEAWIFS; } else if (czcs(product)) { return Instrument.CZCS; } return null; }  }
DetectInstrument { static Instrument getInstrument(Product product) { if (meris(product)) { return Instrument.MERIS; } else if (modis1km(product)) { return Instrument.MODIS; } else if (modis500m(product)) { return Instrument.MODIS500; } else if (s2msi(product)) { return Instrument.S2_MSI; } else if (olci(product)) { return Instrument.OLCI; } else if (seawifs(product)) { return Instrument.SEAWIFS; } else if (czcs(product)) { return Instrument.CZCS; } return null; }   }
DetectInstrument { static Instrument getInstrument(Product product) { if (meris(product)) { return Instrument.MERIS; } else if (modis1km(product)) { return Instrument.MODIS; } else if (modis500m(product)) { return Instrument.MODIS500; } else if (s2msi(product)) { return Instrument.S2_MSI; } else if (olci(product)) { return Instrument.OLCI; } else if (seawifs(product)) { return Instrument.SEAWIFS; } else if (czcs(product)) { return Instrument.CZCS; } return null; }    }