targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); if (prefix.equals("Flat")) {
ProductUtils.copyGeoCoding(srcBand, targetBand); targetBand.setNoDataValueUsed(false); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Defective Pixel");
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.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Detector footprint");
targetBand.setScalingFactor(1); targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Interpolated AOT pixels mask");
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.setScalingFactor(1); 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 " +
targetBand.setScalingFactor(1); targetBand.setScalingOffset(0); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setDescription("Edge mask");
protected void readMasks() { File file; if (metadata != null) { try { String maskFileName = metadata.getMaskFileName(); if (maskFileName != null) { file = productDirectory.getFile(maskFileName); if (file != null && file.exists()) { GeoTiffProductReader reader = new GeoTiffProductReader(getReaderPlugIn()); Product udmProduct = reader.readProductNodes(file, null); Band srcBand = udmProduct.getBandAt(0); float scaleX = (float)metadata.getRasterWidth() / (float)udmProduct.getSceneRasterWidth(); float scaleY = (float)metadata.getRasterHeight() / (float)udmProduct.getSceneRasterHeight(); RenderedOp renderedOp = ScaleDescriptor.create(srcBand.getSourceImage(), scaleX, scaleY, 0.0f, 0.0f, Interpolation.getInstance(Interpolation.INTERP_NEAREST), null); Band targetBand = product.addBand("unusable_data", srcBand.getDataType()); targetBand.setSourceImage(renderedOp); FlagCoding cloudsFlagCoding = createFlagCoding(product); targetBand.setSampleCoding(cloudsFlagCoding); List<Mask> cloudsMasks = createMasksFromFlagCodding(product, cloudsFlagCoding); for (Mask mask : cloudsMasks) { product.getMaskGroup().add(mask); } } } } catch (IOException e) { logger.warning(e.getMessage()); } } }
targetBand.setSolarFlux(srcBand.getSolarFlux()); targetBand.setUnit(srcBand.getUnit()); targetBand.setSampleCoding(srcBand.getSampleCoding()); targetBand.setImageInfo(srcBand.getImageInfo()); targetBand.setSpectralBandIndex(srcBand.getSpectralBandIndex());
@Override public void initialize() throws OperatorException { String pname = aotProduct.getName(); String ptype = aotProduct.getProductType(); rasterWidth = aotProduct.getSceneRasterWidth(); rasterHeight = aotProduct.getSceneRasterHeight(); targetProduct = new Product(pname, ptype, rasterWidth, rasterHeight); FlagCoding aotFlagCoding = new FlagCoding(AotConsts.aotFlags.name); aotFlagCoding.addFlag("aot_climatology", BitSetter.setFlag(0, F_CLIM), "aot from climatology only"); aotFlagCoding.addFlag("aot_interp", BitSetter.setFlag(0, F_INTERP), "aot spatially interpolated"); targetProduct.getFlagCodingGroup().add(aotFlagCoding); AerosolUtils.createFlagMasks(targetProduct); Band targetBand = AerosolUtils.createTargetBand(AotConsts.aotFlags, rasterWidth, rasterHeight); targetBand.setSampleCoding(aotFlagCoding); targetProduct.addBand(targetBand); ProductUtils.copyBand(AotConsts.aot.name, aotProduct, targetProduct, false); ProductUtils.copyBand(AotConsts.aotErr.name, aotProduct, targetProduct, false); setTargetProduct(targetProduct); }
band.setSpectralBandwidth(0); band.setSpectralBandIndex(-1); band.setSampleCoding(indexBandInfo.getIndexCoding()); band.setImageInfo(indexBandInfo.getImageInfo()); band.setDescription(bandInfo.getBandInformation().getDescription());
private void copyBands(Product sourceProduct, Product targetProduct) { Guardian.assertNotNull("source", sourceProduct); Guardian.assertNotNull("target", targetProduct); ProductNodeGroup<FlagCoding> targetFCG = targetProduct.getFlagCodingGroup(); for (int iBand = 0; iBand < sourceProduct.getNumBands(); iBand++) { Band sourceBand = sourceProduct.getBandAt(iBand); if (!targetProduct.containsBand(sourceBand.getName())) { Band targetBand = copyBandScl(sourceBand.getName(), sourceProduct, sourceBand.getName(), targetProduct); if (sourceBand.isFlagBand()) { FlagCoding flgCoding = sourceBand.getFlagCoding(); if (!targetFCG.contains(flgCoding.getName())) { ProductUtils.copyFlagCoding(flgCoding, targetProduct); } if (targetBand != null) { targetBand.setSampleCoding(targetFCG.get(flgCoding.getName())); } } } } }
band.setSpectralBandwidth(0); band.setSpectralBandIndex(-1); band.setSampleCoding(indexBandInfo.getIndexCoding()); band.setImageInfo(indexBandInfo.getImageInfo()); } else {
band.setSpectralBandwidth(0); band.setSpectralBandIndex(-1); band.setSampleCoding(indexBandInfo.getIndexCoding()); band.setImageInfo(indexBandInfo.getImageInfo());
band.setSampleCoding(imgIOFile.getIndexCoding()); product.getIndexCodingGroup().add(imgIOFile.getIndexCoding());
flagsOutputBand.setSampleCoding(flagCoding);
targetBand.setScalingOffset(srcBand.getScalingOffset()); targetBand.setSolarFlux(srcBand.getSolarFlux()); targetBand.setSampleCoding(srcBand.getSampleCoding());
cloudCoding.addIndex("land_pot_haze", 5010, ""); cloudCoding.addIndex("invalid", 10000, ""); targetBandCloudShadow.setSampleCoding(cloudCoding); targetBandCloudShadow.getProduct().getIndexCodingGroup().add(cloudCoding);
Band contextBand = contextProduct.addBand(srcBand.getName(), srcBand.getDataType()); if (srcBand.isFlagBand()) { contextBand.setSampleCoding(contextProduct.getFlagCodingGroup().get(srcBand.getFlagCoding().getName()));