public static Band createTargetBand(AotConsts bandFeat, int rasterWidth, int rasterHeight) { Band targetBand = new Band(bandFeat.name, bandFeat.type, rasterWidth, rasterHeight); targetBand.setDescription(bandFeat.description); targetBand.setNoDataValue(bandFeat.noDataValue); targetBand.setNoDataValueUsed(bandFeat.noDataUsed); targetBand.setUnit(bandFeat.unit); targetBand.setScalingFactor(bandFeat.scale); targetBand.setScalingOffset(bandFeat.offset); return targetBand; }
targetBand.setScalingFactor(1.0d / metadata.getReflectanceQuantificationValue()); targetBand.setScalingOffset(0.0d); targetBand.setSampleCoding(srcBand.getSampleCoding());
private void addAOTImage(Product product, String pathString) { Band srcBand = getTifBand(pathString, 1); if (srcBand == null) { logger.warning(String.format("Image %s not added", pathString)); return; } MuscateMetadata.Geoposition geoposition = getGeoposition(srcBand.getRasterWidth(), srcBand.getRasterHeight()); if (geoposition == null) { logger.warning(String.format("Unrecognized geometry of image %s, it will not be added to the product %s.", pathString, product.getName())); return; } String bandName = "AOT_" + geoposition.id; Band targetBand = new Band(bandName, srcBand.getDataType(), srcBand.getRasterWidth(), srcBand.getRasterHeight()); product.addBand(targetBand); ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValue(metadata.getAOTNoDataValue()); targetBand.setNoDataValueUsed(true); targetBand.setScalingFactor(1.0d / metadata.getAOTQuantificationValue()); targetBand.setScalingOffset(0.0d); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription(String.format("Aerosol Optical Thickness at %.0fm resolution", geoposition.xDim)); targetBand.setSourceImage(srcBand.getSourceImage()); }
ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValueUsed(false); targetBand.setScalingFactor(1); targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding());
private void addWVCImage(Product product, String pathString) { Band srcBand = getTifBand(pathString, 0); if (srcBand == null) { logger.warning(String.format("Image %s not added", pathString)); return; } MuscateMetadata.Geoposition geoposition = getGeoposition(srcBand.getRasterWidth(), srcBand.getRasterHeight()); if (geoposition == null) { logger.warning(String.format("Unrecognized geometry of image %s, it will not be added to the product %s.", pathString, product.getName())); return; } String bandName = "WVC_" + geoposition.id; Band targetBand = new Band(bandName, srcBand.getDataType(), srcBand.getRasterWidth(), srcBand.getRasterHeight()); product.addBand(targetBand); ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValue(metadata.getWVCNoDataValue()); targetBand.setNoDataValueUsed(true); targetBand.setScalingFactor(1.0d / metadata.getWVCQuantificationValue()); targetBand.setScalingOffset(0.0d); targetBand.setUnit("cm"); //TODO verify targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription(String.format("Water vapor content at %.0fm resolution in %s", geoposition.xDim, targetBand.getUnit())); targetBand.setSourceImage(srcBand.getSourceImage()); }
ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValueUsed(false); targetBand.setScalingFactor(1); targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding());
public static Band createBand(final Variable variable, final int rasterWidth, final int rasterHeight, int dataType) { final NcAttributeMap attMap = NcAttributeMap.create(variable); final Band band = new Band(variable.getShortName(), (dataType == ProductData.TYPE_UNDEFINED) ? getRasterDataType(variable) : dataType, rasterWidth, rasterHeight); band.setDescription(getDescription(variable, attMap)); band.setUnit(getUnit(variable, attMap)); band.setScalingFactor(getScalingFactor(attMap)); band.setScalingOffset(getAddOffset(attMap)); final Number noDataValue = getNoDataValue(attMap); if (noDataValue != null) { band.setNoDataValue(noDataValue.doubleValue()); band.setNoDataValueUsed(true); } return band; }
ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValueUsed(false); targetBand.setScalingFactor(1); targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding());
Band b = product.addBand("B", ProductData.TYPE_UINT8); Band c = product.addBand("C", ProductData.TYPE_UINT8); a.setScalingFactor(1.0 / 255.0); b.setScalingFactor(1.0 / 255.0); c.setScalingFactor(1.0 / 255.0); a.setSourceImage(new BufferedImage(256, 256, BufferedImage.TYPE_BYTE_GRAY)); b.setSourceImage(new BufferedImage(256, 256, BufferedImage.TYPE_BYTE_GRAY));
targetBand.setSpectralWavelength(componentMetadata.getWavelength(idx) > 0 ? componentMetadata.getWavelength(idx) : srcBand.getSpectralWavelength()); targetBand.setSpectralBandwidth(componentMetadata.getBandwidth(idx) > 0 ? componentMetadata.getBandwidth(idx) : srcBand.getSpectralBandwidth()); targetBand.setScalingFactor(srcBand.getScalingFactor()); targetBand.setScalingOffset(srcBand.getScalingOffset()); targetBand.setSolarFlux(srcBand.getSolarFlux());
targetBand.setSpectralWavelength(srcBand.getSpectralWavelength()); targetBand.setSpectralBandwidth(srcBand.getSpectralBandwidth()); targetBand.setScalingFactor(srcBand.getScalingFactor()); targetBand.setScalingOffset(srcBand.getScalingOffset()); targetBand.setSolarFlux(srcBand.getSolarFlux());
ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValueUsed(false); targetBand.setScalingFactor(1); targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding());
targetBand.setSpectralWavelength(componentMetadata.getWavelength(idx) > 0 ? componentMetadata.getWavelength(idx) : srcBand.getSpectralWavelength()); targetBand.setSpectralBandwidth(componentMetadata.getBandwidth(idx) > 0 ? componentMetadata.getBandwidth(idx) : srcBand.getSpectralBandwidth()); targetBand.setScalingFactor(srcBand.getScalingFactor()); targetBand.setScalingOffset(srcBand.getScalingOffset()); targetBand.setSolarFlux(srcBand.getSolarFlux());
targetBand.setSpectralWavelength(srcBand.getSpectralWavelength()); targetBand.setSpectralBandwidth(srcBand.getSpectralBandwidth()); targetBand.setScalingFactor(srcBand.getScalingFactor()); targetBand.setScalingOffset(srcBand.getScalingOffset()); targetBand.setSolarFlux(srcBand.getSolarFlux());
private void setBandProperties(Band targetBand, Band band) { targetBand.setSpectralBandIndex(band.getSpectralBandIndex()); targetBand.setSpectralWavelength(band.getSpectralWavelength()); targetBand.setSpectralBandwidth(band.getSpectralBandwidth()); targetBand.setSolarFlux(band.getSolarFlux()); targetBand.setUnit(band.getUnit()); targetBand.setNoDataValue(band.getNoDataValue()); targetBand.setNoDataValueUsed(true); targetBand.setScalingFactor(band.getScalingFactor()); targetBand.setScalingOffset(band.getScalingOffset()); targetBand.setUnit(band.getUnit()); targetBand.setDescription(band.getDescription()); }
); S2BandInformation bandInformation = bandInfo.getBandInformation(); band.setScalingFactor(bandInformation.getScalingFactor()); S2IndexBandInformation indexBandInfo = (S2IndexBandInformation) bandInformation; band.setSpectralWavelength(0);
band.setScalingFactor(bandInformation.getScalingFactor());
); S2BandInformation bandInformation = bandInfo.getBandInformation(); band.setScalingFactor(bandInformation.getScalingFactor()); S2IndexBandInformation indexBandInfo = (S2IndexBandInformation) bandInformation; band.setSpectralWavelength(0);
targetBand.setDescription(outputVariable.getExpression()); targetBand.setUnit(firstSourceBand.getUnit()); targetBand.setScalingFactor(firstSourceBand.getScalingFactor()); targetBand.setScalingOffset(firstSourceBand.getScalingOffset()); targetBand.setLog10Scaled(firstSourceBand.isLog10Scaled());
targetBand.setSpectralBandwidth(RapidEyeConstants.BANDWIDTHS[bandIndex]); targetBand.setSpectralBandIndex(bandIndex); targetBand.setScalingFactor(metadata.getScaleFactor(bandIndex)); product.addBand(targetBand);