private static void setSolarFlux(final Element element, final Band band) { final String solarFlux = element.getChildTextTrim(DimapProductConstants.TAG_SOLAR_FLUX); if (solarFlux != null) { band.setSolarFlux(Float.parseFloat(solarFlux)); } }
private static void applySolarFluxFromMetadata(Band band, int spectralIndex) { MetadataElement metadataRoot = band.getProduct().getMetadataRoot(); band.setSolarFlux(getSolarFluxFromMetadata(metadataRoot, spectralIndex)); }
private void addSpectralInfo(Product product, String name, int index, float min, float max, float solFlux) { Band spectralBand = product.getBand(name); if (spectralBand != null) { spectralBand.setSpectralBandIndex(index); spectralBand.setSpectralWavelength(min + 0.5f * (max - min)); spectralBand.setSpectralBandwidth(max - min); spectralBand.setSolarFlux(solFlux); spectralBand.setDescription(MessageFormat.format("{0} spectral band", name)); } }
private static void readBeamBandAttributes(Variable variable, Band band) { // todo se -- units for bandwidth and wavelength Attribute attribute = variable.findAttribute(BANDWIDTH); if (attribute != null) { band.setSpectralBandwidth(attribute.getNumericValue().floatValue()); } attribute = variable.findAttribute(WAVELENGTH); if (attribute != null) { band.setSpectralWavelength(attribute.getNumericValue().floatValue()); } attribute = variable.findAttribute(SPECTRAL_BAND_INDEX); if (attribute != null) { band.setSpectralBandIndex(attribute.getNumericValue().intValue()); } attribute = variable.findAttribute(VALID_PIXEL_EXPRESSION); if (attribute != null) { band.setValidPixelExpression(attribute.getStringValue()); } attribute = variable.findAttribute(SOLAR_FLUX); if (attribute != null) { band.setSolarFlux(attribute.getNumericValue().floatValue()); } band.setName(ReaderUtils.getRasterName(variable)); }
public void testSolarFlux() { assertEquals(0.0F, _rsBand.getSolarFlux(), 1e-6F); _rsBand.setSolarFlux(1.1F); assertEquals(1.1F, _rsBand.getSolarFlux(), 1e-6F); }
private void setSpectralBandInfo(Product product) { float[] wavelengths = productFile.getSpectralBandWavelengths(); float[] bandwidths = productFile.getSpectralBandBandwidths(); float[] solar_fluxes = productFile.getSpectralBandSolarFluxes(); for (int i = 0; i < product.getNumBands(); i++) { Band band = product.getBandAt(i); int sbi = band.getSpectralBandIndex(); if (sbi >= 0) { if (wavelengths != null) { band.setSpectralWavelength(wavelengths[sbi % wavelengths.length]); } if (bandwidths != null) { band.setSpectralBandwidth(bandwidths[sbi % bandwidths.length]); } if (solar_fluxes != null) { band.setSolarFlux(solar_fluxes[sbi % solar_fluxes.length]); } } // Debug.trace(band.toString()); } }
/** * Copies the spectral properties from source band to target band. These properties are: * <ul> * <li>{@link org.esa.beam.framework.datamodel.Band#getSpectralBandIndex() spectral band index},</li> * <li>{@link org.esa.beam.framework.datamodel.Band#getSpectralWavelength() the central wavelength},</li> * <li>{@link org.esa.beam.framework.datamodel.Band#getSpectralBandwidth() the spectral bandwidth} and</li> * <li>{@link org.esa.beam.framework.datamodel.Band#getSolarFlux() the solar spectral flux}.</li> * </ul> * * @param sourceBand the source band * @param targetBand the target band * * @see #copyRasterDataNodeProperties(org.esa.beam.framework.datamodel.RasterDataNode, org.esa.beam.framework.datamodel.RasterDataNode) */ public static void copySpectralBandProperties(Band sourceBand, Band targetBand) { Guardian.assertNotNull("source", sourceBand); Guardian.assertNotNull("target", targetBand); targetBand.setSpectralBandIndex(sourceBand.getSpectralBandIndex()); targetBand.setSpectralWavelength(sourceBand.getSpectralWavelength()); targetBand.setSpectralBandwidth(sourceBand.getSpectralBandwidth()); targetBand.setSolarFlux(sourceBand.getSolarFlux()); }
radBand.setSpectralWavelength(band.getWavelength()); radBand.setSpectralBandwidth(band.getBandwidth()); radBand.setSolarFlux(band.getSolarFlux()); radBand.setNoDataValue(LandsatConstants.NULL_DATA_VALUE); radBand.setNoDataValueUsed(true);
destBand.setSpectralWavelength(sourceBand.getSpectralWavelength()); destBand.setSpectralBandwidth(sourceBand.getSpectralBandwidth()); destBand.setSolarFlux(sourceBand.getSolarFlux()); if (sourceBand.isNoDataValueSet()) { destBand.setNoDataValue(sourceBand.getNoDataValue());
destBand.setSpectralWavelength(sourceBand.getSpectralWavelength()); destBand.setSpectralBandwidth(sourceBand.getSpectralBandwidth()); destBand.setSolarFlux(sourceBand.getSolarFlux()); FlagCoding sourceFlagCoding = sourceBand.getFlagCoding(); IndexCoding sourceIndexCoding = sourceBand.getIndexCoding();
band1.setDescription(band1.getName() + "-Description"); band1.setImageInfo(createImageInfo()); band1.setSolarFlux(0.12f); band1.setSpectralWavelength(23.45f); band1.setSpectralBandIndex(0); band2.setUnit("unit for " + band2.getName()); band2.setDescription(band2.getName() + "-Description"); band2.setSolarFlux(0.23f); band2.setSpectralWavelength(243.56f); band2.setSpectralBandIndex(3);