for (final Band band : bands) { boolean validBand = false; if (band.getImageInfo() != null) { validBand = true; for (RasterDataNode protectedRaster : protectedRasters) { bandsToBeModified = bandChooser.getSelectedBands(); for (final Band band : bandsToBeModified) { applyColorPaletteDef(getFormModel().getModifiedImageInfo().getColorPaletteDef(), band, band.getImageInfo()); modifiedRasters.add(band);
targetBand.setScalingOffset(0.0d); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); if (prefix.equals("Flat")) { targetBand.setDescription(String.format("Ground reflectance with the correction of slope effects, band %s", bandId));
targetBand.setNoDataValueUsed(false); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Defective Pixel"); targetBand.setSourceImage(srcBand.getSourceImage());
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()); }
targetBand.setNoDataValueUsed(false); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Detector footprint"); targetBand.setSourceImage(srcBand.getSourceImage());
targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Interpolated AOT pixels mask"); targetBand.setSourceImage(srcBand.getSourceImage());
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()); }
targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("saturation mask coded over 8 bits, 1 bit per spectral band (number of useful bits = number of " + "spectral bands)");
targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Edge mask"); targetBand.setSourceImage(srcBand.getSourceImage());
targetBand.setUnit(srcBand.getUnit()); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setSpectralBandIndex(srcBand.getSpectralBandIndex()); targetBand.setDescription(bandName);
targetBand.setUnit(srcBand.getUnit() != null ? srcBand.getUnit() : bandUnits[idx]); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setSpectralBandIndex(srcBand.getSpectralBandIndex()); targetBand.setDescription(bandName);
targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Geophysical mask of level 2, made of 1 band coded over 8 useful bits"); targetBand.setSourceImage(srcBand.getSourceImage());
targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Cloud mask computed by MACCS software, made of 1 band coded over 8 useful bits"); targetBand.setSourceImage(srcBand.getSourceImage());
targetBand.setUnit(srcBand.getUnit() != null ? srcBand.getUnit() : bandUnits[idx]); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo());
targetBand.setUnit(srcBand.getUnit()); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setSpectralBandIndex(srcBand.getSpectralBandIndex()); targetBand.setDescription(srcBand.getDescription());
targetBand.setSolarFlux(srcBand.getSolarFlux()); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setSpectralBandIndex(srcBand.getSpectralBandIndex()); targetBand.setDescription(bandName);
targetBand.setSpectralBandwidth(firstSourceBand.getSpectralBandwidth()); ImageInfo sourceImageInfo = firstSourceBand.getImageInfo(); if (sourceImageInfo != null) { targetBand.setImageInfo(new ImageInfo(new ColorPaletteDef(sourceImageInfo.getColorPaletteDef().getPoints())));
@Override protected SurfaceImage doInBackground() throws Exception { try { final Product newProduct = createSubsampledProduct(product); final Band band = newProduct.getBandAt(0); final BufferedImage image = ProductUtils.createRgbImage(new RasterDataNode[]{band}, band.getImageInfo(com.bc.ceres.core.ProgressMonitor.NULL), com.bc.ceres.core.ProgressMonitor.NULL); final GeoPos geoPos1 = product.getSceneGeoCoding().getGeoPos(new PixelPos(0, 0), null); final GeoPos geoPos2 = product.getSceneGeoCoding().getGeoPos(new PixelPos(product.getSceneRasterWidth() - 1, product.getSceneRasterHeight() - 1), null ); final Sector sector = new Sector(Angle.fromDegreesLatitude(geoPos1.getLat()), Angle.fromDegreesLatitude(geoPos2.getLat()), Angle.fromDegreesLongitude(geoPos1.getLon()), Angle.fromDegreesLongitude(geoPos2.getLon())); final SurfaceImage si = new SurfaceImage(image, sector); si.setOpacity(getOpacity()); return si; } catch (Exception e) { //e.printStackTrace(); } return null; }
ImageInfo imageInfo = computedBand.getImageInfo(); if (imageInfo != null) { realBand.setImageInfo(imageInfo.clone());