private Band createColumnIndexBand() { Band colIndexBand = new Band(COL_INDEX_BAND_NAME, ProductData.TYPE_UINT16, _sceneRasterWidth, _sceneRasterHeight); colIndexBand.setDescription("Zero-based column index in the global ISIN grid"); return colIndexBand; }
private static void setBandDescription(Variable variable, ModisBandDescription bandDesc, Band band) throws IOException { final String descriptionAttribName = bandDesc.getDescriptionAttribName(); final List<Attribute> attributes = variable.getAttributes(); for (final Attribute attribute : attributes) { if (attribute.getShortName().equalsIgnoreCase(descriptionAttribName)) { final String description = attribute.getStringValue(); band.setDescription(description); return; } } }
/** * Creates the nadir view coordinate offset bands and adds them to the bands vector. */ private void createNadirOffsetBands() { Band band = new Band(AtsrGBTConstants.NADIR_X_OFFS_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.COORDINATE_OFFSET_UNIT); band.setDescription(AtsrGBTConstants.NADIR_X_OFFS_DESCRIPTION); addBand(band); band = new Band(AtsrGBTConstants.NADIR_Y_OFFS_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.COORDINATE_OFFSET_UNIT); band.setDescription(AtsrGBTConstants.NADIR_Y_OFFS_DESCRIPTION); addBand(band); }
/** * Creates the forward view coordinate offset bands and adds them to the bands vector. */ private void createForwardOffsetBands() { Band band = new Band(AtsrGBTConstants.FORWARD_X_OFFS_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.COORDINATE_OFFSET_UNIT); band.setDescription(AtsrGBTConstants.FORWARD_X_OFFS_DESCRIPTION); addBand(band); band = new Band(AtsrGBTConstants.FORWARD_Y_OFFS_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.COORDINATE_OFFSET_UNIT); band.setDescription(AtsrGBTConstants.FORWARD_Y_OFFS_DESCRIPTION); addBand(band); }
/** * Creates the sst bands and the confidence band and adds them to the bands vector. */ private void createSSTBands() { Band band = null; band = new Band(AtsrGSSTConstants.NADIR_SST_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGSSTConstants.SST_UNIT); band.setDescription(AtsrGSSTConstants.NADIR_SST_DESCRIPTION); addBand(band); band = new Band(AtsrGSSTConstants.DUAL_SST_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGSSTConstants.SST_UNIT); band.setDescription(AtsrGSSTConstants.DUAL_SST_DESCRIPTION); addBand(band); }
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 configureBand(Band band05X, ImageInfo imageInfo, String unit, String description) { band05X.setUnit(unit); band05X.setDescription(description); band05X.setImageInfo(imageInfo); band05X.setNoDataValue(Double.NaN); band05X.setNoDataValueUsed(true); }
private void createProbabilityBands() { probabilityBands = new Band[clusterCount]; for (int i = 0; i < clusterCount; ++i) { final Band targetBand = targetProduct.addBand("probability_" + i, ProductData.TYPE_FLOAT32); targetBand.setUnit("dl"); targetBand.setDescription("Cluster posterior probabilities"); targetBand.setNoDataValue(NO_DATA_VALUE); targetBand.setNoDataValueUsed(true); probabilityBands[i] = targetBand; } }
private void setBandProperties(Band band, String validMaskExpression) { band.setDescription(bandDescription); band.setUnit(bandUnit); band.setSpectralWavelength(bandWavelength); band.setGeophysicalNoDataValue(noDataValue); band.setNoDataValueUsed(noDataValueUsed); band.setValidPixelExpression(validMaskExpression); }
/** * Creates the forward view 1600 nm band */ private void createForward1600Band() { Band band = new Band(AtsrGBTConstants.FORWARD_1600_REF_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.REFLECTANCE_UNIT); band.setDescription(AtsrGBTConstants.FORWARD_1600_REF_DESCRIPTION); band.setSpectralWavelength(AtsrConstants.BAND_16_WAVELENGTH); band.setSpectralBandwidth(AtsrConstants.BAND_16_WIDTH); addBand(band); }
/** * Creates the nadir view 1600 nm band */ private void createNadir1600Band() { Band band = new Band(AtsrGBTConstants.NADIR_1600_REF_NAME, ProductData.TYPE_FLOAT32, AtsrConstants.ATSR_SCENE_RASTER_WIDTH, AtsrConstants.ATSR_SCENE_RASTER_HEIGHT); band.setUnit(AtsrGBTConstants.REFLECTANCE_UNIT); band.setDescription(AtsrGBTConstants.NADIR_1600_REF_DESCRIPTION); band.setSpectralWavelength(AtsrConstants.BAND_16_WAVELENGTH); band.setSpectralBandwidth(AtsrConstants.BAND_16_WIDTH); addBand(band); }
private void setBandUnitAndDescription(H5ScalarDS ds, Band band) throws HDF5Exception { band.setDescription(ProbaVUtils.getStringAttributeValue(ds.getMetadata(), "DESCRIPTION")); band.setUnit(ProbaVUtils.getStringAttributeValue(ds.getMetadata(), "UNITS")); }
private void addBand(String varName) { VariableMetadata variableMetadata = getVariableMetadata(varName); if (variableMetadata != null) { Band band = new Band(variableMetadata.name, ProductData.TYPE_INT16, _sceneRasterWidth, _sceneRasterHeight); band.setDescription(variableMetadata.description); band.setScalingOffset(variableMetadata.scalingOffset); band.setScalingFactor(variableMetadata.scalingFactor); band.setLog10Scaled(variableMetadata.log10Scaled); band.setNoDataValue(variableMetadata.fillValue); band.setNoDataValueUsed(variableMetadata.fillValue != Double.NaN); _product.addBand(band); bandMap.put(band, variableMetadata); } }
private Band addBand(Product product, BandReader bandReader, int channelIndex) { final Band band = product.addBand(bandReader.getBandName(), bandReader.getDataType()); band.setScalingFactor(bandReader.getScalingFactor()); band.setUnit(bandReader.getBandUnit()); band.setDescription(bandReader.getBandDescription()); band.setSpectralBandIndex(channelIndex + 1); band.setValidPixelExpression(band.getName() + " != NaN"); bandReaderMap.put(band, bandReader); return band; }
private void addBand(String varName) { VariableMetadata variableMetadata = getVariableMetadata(varName); if (variableMetadata != null) { Band band = new Band(variableMetadata.name, variableMetadata.dataType, sceneRasterWidth, sceneRasterHeight); band.setDescription(variableMetadata.description); band.setUnit(variableMetadata.variable.getUnitsString()); band.setNoDataValue(variableMetadata.fillValue); band.setNoDataValueUsed(variableMetadata.fillValue != Double.NaN); band.setSpectralWavelength(getWavelengthFromBandName(varName)); product.addBand(band); final VariableReader variableReader = new VariableReader(variableMetadata.variable); bandMap.put(band, variableReader); } }
static private SpectrumBand createBand(int index) { final Band band = new Band("Radiance_" + (index + 1), ProductData.TYPE_INT16, 100, 100); band.setDescription("Radiance for band " + (index + 1)); band.setSpectralWavelength((float) Math.random()); band.setSpectralBandwidth((float) Math.random()); band.setUnit("sr^-1"); if (index == 7) { band.setUnit("dl"); } return new SpectrumBand(band, true); }
private void setBandProperties(H5ScalarDS ds, Band band) throws HDF5Exception { band.setDescription(ProbaVUtils.getStringAttributeValue(ds.getMetadata(), "DESCRIPTION")); band.setUnit(ProbaVUtils.getStringAttributeValue(ds.getMetadata(), "UNITS")); band.setNoDataValue(ProbaVUtils.getFloatAttributeValue(ds.getMetadata(), "NO_DATA")); band.setNoDataValueUsed(true); setSpectralProperties(band); }
private static void addElevationBand(Product product, ElevationModel dem, String elevationBandName) { final GeoCoding geoCoding = product.getGeoCoding(); ElevationModelDescriptor demDescriptor = dem.getDescriptor(); final float noDataValue = dem.getDescriptor().getNoDataValue(); final Band elevationBand = product.addBand(elevationBandName, ProductData.TYPE_INT16); elevationBand.setSynthetic(true); elevationBand.setNoDataValue(noDataValue); elevationBand.setUnit("m"); elevationBand.setDescription(demDescriptor.getName()); elevationBand.setSourceImage(createElevationSourceImage(dem, geoCoding, elevationBand)); }
protected Band createBand(BandReader bandReader, int channel) { final Band band = new Band(bandReader.getBandName(), bandReader .getDataType(), avhrrFile.getProductWidth(), avhrrFile .getProductHeight()); band.setScalingFactor(bandReader.getScalingFactor()); band.setUnit(bandReader.getBandUnit()); band.setDescription(bandReader.getBandDescription()); band.setSpectralBandIndex(channel); band.setSpectralBandwidth(CH_BANDWIDTHS[channel]); band.setSpectralWavelength(CH_WAVELENGTHS[channel]); band.setValidPixelExpression(CH_VALID_MASK_EXPRESSIONS[channel]); band.setNoDataValue(NO_DATA_VALUE); band.setNoDataValueUsed(true); bandReaders.put(band, bandReader); return band; }
private static void attachSynthesisQualityFlagBand(Product probavProduct, Product flagProduct) { FlagCoding probavSmFlagCoding = new FlagCoding(ProbaVConstants.SM_FLAG_BAND_NAME); ProbaVUtils.addSynthesisQualityFlags(probavSmFlagCoding); ProbaVUtils.addSynthesisQualityMasks(probavProduct); probavProduct.getFlagCodingGroup().add(probavSmFlagCoding); final Band smFlagBand = probavProduct.addBand(ProbaVConstants.SM_FLAG_BAND_NAME, ProductData.TYPE_INT16); smFlagBand.setDescription("PROBA-V Synthesis SM Flags"); smFlagBand.setSampleCoding(probavSmFlagCoding); ProbaVSynthesisBitMaskOp bitMaskOp = new ProbaVSynthesisBitMaskOp(); bitMaskOp.setParameterDefaultValues(); bitMaskOp.setSourceProduct("sourceProduct", flagProduct); Product bitMaskProduct = bitMaskOp.getTargetProduct(); smFlagBand.setSourceImage(bitMaskProduct.getBand(ProbaVConstants.SM_FLAG_BAND_NAME).getSourceImage()); }