/** * Adds a new band description to the product description. * * @param name the name of the band (without spectral extension) * @param isSpectral whether the badnd is a spectral band or not * @param scalingMethod the scaling method to be used for this band (lin, exp ..) * @param scaleName name of the attribute containing the scale factors * @param offsetName name of the attribute containing the scale offsets * @param unitName name off the attribute containing the physical unit * @param bandName name of the attribute containing the spectral extensions (band names) * @param descName name of the attribute containing a description of the band * @param spectralWaveLength the spectral wavelength in nm (nanomater) units * @param spectralBandWidth the spectral bandwidth in nm (nanomater) units * @param spectralBandIndex the (zero-based) spectral band index */ public void addBand(final String name, final String isSpectral, final String scalingMethod, final String scaleName, final String offsetName, final String unitName, final String bandName, final String descName, final String spectralWaveLength, final String spectralBandWidth, final String spectralBandIndex) { final ModisBandDescription bandDesc = new ModisBandDescription( name, isSpectral, scalingMethod, scaleName, offsetName, unitName, bandName, descName); bandDesc.setSpecInfo(new ModisSpectralInfo( spectralWaveLength, spectralBandWidth, spectralBandIndex)); addBand(bandDesc); }
public void testSetSpectralBandInfo_fromSpecInfo() { final Band band = new Band("bla", ProductData.TYPE_FLOAT32, 3, 3); final ModisBandDescription description = new ModisBandDescription("", "true", "", "", "", "", "", ""); final ModisSpectralInfo spectralInfo = new ModisSpectralInfo("2", "3", "4"); description.setSpecInfo(spectralInfo); ModisFileReader.setBandSpectralInformation(description, "", band); assertEquals(4, band.getSpectralBandIndex()); assertEquals(2.f, band.getSpectralWavelength(), 1e-8); assertEquals(3.f, band.getSpectralBandwidth(), 1e-8); }