Landsat8Metadata extends AbstractLandsatMetadata { @Override public double getScalingFactor(String bandId) { final String spectralInput = getSpectralInputString(); String attributeKey = String.format("%s_MULT_BAND_%s", spectralInput, bandId); MetadataElement radiometricRescalingElement = getMetaDataElementRoot().getElement("RADIOMETRIC_RESCALING"); if (radiometricRescalingElement.getAttribute(attributeKey) == null) { return DEFAULT_SCALE_FACTOR; } final double scalingFactor = radiometricRescalingElement.getAttributeDouble(attributeKey); final double sunAngleCorrectionFactor = getSunAngleCorrectionFactor(spectralInput); return scalingFactor / sunAngleCorrectionFactor; } 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 testGetScalingFactor() throws Exception { assertEquals(0.012838, metadata.getScalingFactor("1"), 1E-7); assertEquals(0.0003342, metadata.getScalingFactor("11"), 1E-7); }