LandsatLevel2Metadata extends XmlMetadata { public FlagCoding createSaturationFlagCoding(String bandName) { FlagCoding flagCoding = new FlagCoding("saturation"); flagCoding.addFlag("data_fill_flag", 1, "Designated Fill"); flagCoding.addFlag("Band1_saturated", 2, "Band 1 Data Saturation Flag"); flagCoding.addFlag("Band2_saturated", 4, "Band 2 Data Saturation Flag"); flagCoding.addFlag("Band3_saturated", 8, "Band 3 Data Saturation Fla "); flagCoding.addFlag("Band4_saturated", 16, "Band 4 Data Saturation Flag"); flagCoding.addFlag("Band5_saturated", 32, "Band 5 Data Saturation Flag"); flagCoding.addFlag("Band6_saturated", 64, "Band 6 Data Saturation Flag"); flagCoding.addFlag("Band7_saturated", 128, "Band 7 Data Saturation Flag"); if(getSatellite().equals("LANDSAT_8")) { flagCoding.addFlag("Band8_saturated", 256, "N/A"); flagCoding.addFlag("Band9_saturated", 512, "Band 9 Data Saturation Flag"); flagCoding.addFlag("Band10_saturated", 1024, "Band 10 Data Saturation Flag"); flagCoding.addFlag("Band11_saturated", 2048, "Band 11 Data Saturation Flag"); } return flagCoding; } LandsatLevel2Metadata(String name); @Override String getFileName(); @Override String getProductName(); String getProductDescription(); @Override String getFormatName(); @Override String getMetadataProfile(); @Override int getRasterWidth(); @Override int getRasterHeight(); @Override String[] getRasterFileNames(); @Override ProductData.UTC getProductStartTime(); @Override ProductData.UTC getProductEndTime(); @Override ProductData.UTC getCenterTime(); @Override int getNumBands(); Point2D.Double getUpperLeft(); String getBandName(String filename); double getScalingFactor(String filename); double getScalingOffset(String filename); float getWavelength(String filename); float getBandwidth(String filename); String getBandDescription(String filename); boolean isReflectanceBand(String filename); boolean isSaturationBand(String filename); boolean isAerosolBand(String filename); boolean isQualityBand(String filename); boolean isAtmosBand(String filename); boolean isCloudBand(String filename); String getSatellite(); String getInstrument(); FlagCoding createSaturationFlagCoding(String bandName);  }
@Test public void testSaturationFlags() throws Exception { FlagCoding flagCoding = metadata.createSaturationFlagCoding("LC08_L1TP_024036_20181011_20181011_01_RT_radsat_qa.tif"); assertNotNull(flagCoding); }