/** * Copies all bands which contain a flagcoding from the source product to the target product. * * @param sourceProduct the source product * @param targetProduct the target product * * @deprecated since BEAM 4.10, use {@link #copyFlagBands(Product, Product, boolean)} instead. */ @Deprecated public static void copyFlagBands(Product sourceProduct, Product targetProduct) { copyFlagBands(sourceProduct, targetProduct, false); }
ProductUtils.copyFlagBands(n1Product, targetProduct, false); try { File originalFileLocation = n1Product.getFileLocation();
/** * Creates the output product skeleton. */ private void initOutputProduct() throws IOException, ParseException { if (!EnvisatConstants.MERIS_L1_TYPE_PATTERN.matcher(l1bProduct.getProductType()).matches()) { throw new OperatorException("Product type '" + l1bProduct.getProductType() + "' is not supported." + "It must be a MERIS Level 1b product."); } tempCloudProduct = cloudNode.readProductNodes(l1bProduct, null); targetProduct = cloudNode.createTargetProductImpl(); ProductUtils.copyFlagBands(l1bProduct, targetProduct, true); ProductUtils.copyTiePointGrids(l1bProduct, targetProduct); ProductUtils.copyGeoCoding(l1bProduct, targetProduct); ProductUtils.copyMetadata(l1bProduct, targetProduct); targetProduct.setStartTime(l1bProduct.getStartTime()); targetProduct.setEndTime(l1bProduct.getEndTime()); cloudNode.startProcessing(); getLogger().info("Output product successfully initialised"); }
ProductUtils.copyFlagBands(sourceProduct, targetProduct, true);
private void createOutputProduct() throws IOException { String productType = sourceProduct.getProductType() + "_SMAC"; String productName = sourceProduct.getName() + "_SMAC"; int sceneWidth = sourceProduct.getSceneRasterWidth(); int sceneHeight = sourceProduct.getSceneRasterHeight(); targetProduct = new Product(productName, productType, sceneWidth, sceneHeight); // loop over bands and create them // ------------------------------- if (ObjectUtils.equalObjects(sensorType, SensorCoefficientManager.MERIS_NAME)) { addBandsToOutput("Atmosphere corrected MERIS band ", true); } else { addBandsToOutput("Atmosphere corrected band ", false); } ProductUtils.copyTiePointGrids(sourceProduct, targetProduct); // the following line copies the processing request as metadata into the target product. // there is no such mechanism in GPF yet, so it is commented out. // copyRequestMetaData(_outputProduct); ProductUtils.copyFlagBands(sourceProduct, targetProduct, true); // for MERIS FSG / FRG products ProductUtils.copyBand(EnvisatConstants.MERIS_AMORGOS_L1B_CORR_LATITUDE_BAND_NAME, sourceProduct, targetProduct, true); ProductUtils.copyBand(EnvisatConstants.MERIS_AMORGOS_L1B_CORR_LONGITUDE_BAND_NAME, sourceProduct, targetProduct, true); ProductUtils.copyBand(EnvisatConstants.MERIS_AMORGOS_L1B_ALTIUDE_BAND_NAME, sourceProduct, targetProduct, true); ProductUtils.copyGeoCoding(sourceProduct, targetProduct); }
ProductUtils.copyFlagBands(sourceProduct, flhProduct, true);
@Override protected void configureTargetProduct(ProductConfigurer productConfigurer) { super.configureTargetProduct(productConfigurer); final String validPixelExpression = createValidMaskExpression(); final Band lineHeightBand = productConfigurer.addBand(lineHeightBandName, ProductData.TYPE_FLOAT32); final Band signalBand = sourceProduct.getBand(signalBandName); lineHeightBand.setUnit(signalBand.getUnit()); lineHeightBand.setDescription("Line height band"); lineHeightBand.setValidPixelExpression(validPixelExpression); lineHeightBand.setNoDataValueUsed(true); lineHeightBand.setNoDataValue(invalidFlhMciValue); ProductUtils.copySpectralBandProperties(signalBand, lineHeightBand); if (slope) { final Band slopeBand = productConfigurer.addBand(slopeBandName, ProductData.TYPE_FLOAT32); slopeBand.setUnit(signalBand.getUnit() + " nm-1"); slopeBand.setDescription("Baseline slope band"); slopeBand.setNoDataValueUsed(true); slopeBand.setNoDataValue(Double.NaN); slopeBand.setValidPixelExpression(validPixelExpression); } ProductUtils.copyFlagBands(sourceProduct, productConfigurer.getTargetProduct(), true); }
ProductUtils.copyFlagBands(source, target, false); ProductUtils.copyFlagBands(source, target, true);