Landsat8Metadata extends AbstractLandsatMetadata { static String getSpectralInputString() { final Preferences preferences = Config.instance("s3tbx").load().preferences(); final String readAs = preferences.get(LandsatGeotiffReader.SYSPROP_READ_AS, null); String spectralInput; if (readAs != null) { switch (readAs.toLowerCase()) { case "reflectance": spectralInput = "REFLECTANCE"; break; case "radiance": spectralInput = "RADIANCE"; break; default: spectralInput = "RADIANCE"; LOG.warning(String.format("Property '%s' has unsupported value '%s'.%n" + "Interpreting values as radiance.", LandsatGeotiffReader.SYSPROP_READ_AS, readAs)); } }else { spectralInput = "RADIANCE"; } return spectralInput; } Landsat8Metadata(Reader fileReader);  Landsat8Metadata(MetadataElement root); @Override MetadataElement getProductMetadata(); @Override Dimension getReflectanceDim(); @Override Dimension getThermalDim(); @Override Dimension getPanchromaticDim(); @Override String getProductType(); @Override double getScalingFactor(String bandId); @Override double getScalingOffset(String bandId); @Override ProductData.UTC getCenterTime(); @Override Pattern getOpticalBandFileNamePattern(); @Override String getQualityBandNameKey(); @Override float getWavelength(String bandIndexNumber); @Override float getBandwidth(String bandIndexNumber); @Override String getBandDescription(String bandNumber); @Override String getBandNamePrefix(String bandNumber);  }
@Test public void testGetSpectralInputString() throws Exception { System.setProperty(LandsatGeotiffReader.SYSPROP_READ_AS, "reflectance"); assertEquals("REFLECTANCE", Landsat8Metadata.getSpectralInputString()); System.setProperty(LandsatGeotiffReader.SYSPROP_READ_AS, "radiance"); assertEquals("RADIANCE", Landsat8Metadata.getSpectralInputString()); }