Landsat8Metadata extends AbstractLandsatMetadata { @Override public double getScalingOffset(String bandId) { final String spectralInput = getSpectralInputString(); String attributeKey = String.format("%s_ADD_BAND_%s", spectralInput, bandId); MetadataElement radiometricRescalingElement = getMetaDataElementRoot().getElement("RADIOMETRIC_RESCALING"); if (radiometricRescalingElement.getAttribute(attributeKey) == null) { return DEFAULT_OFFSET; } final double scalingOffset = radiometricRescalingElement.getAttributeDouble(attributeKey); final double sunAngleCorrectionFactor = getSunAngleCorrectionFactor(spectralInput); return scalingOffset / 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 testGetScalingOffset() throws Exception { assertEquals(-64.18855, metadata.getScalingOffset("1"), 1E-7); assertEquals(0.1, metadata.getScalingOffset("11"), 1E-7); }