private static void replaceAbstractedMetadataField(final MetadataElement abstractedMetadata, final String attrName, final String newValue) { final ProductData productData = abstractedMetadata.getAttribute(attrName).getData(); productData.setElems(newValue); }
ProductData.TYPE_ASCII, unit, comment); if (!value.isEmpty()) attrib.getData().setElems(value);
/** * Update target product metadata. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); final String[] targetBandNames = targetProduct.getBandNames(); Sentinel1Utils.updateBandNames(abs, selectedPolList, targetBandNames); final MetadataElement origMetadataRoot = AbstractMetadata.getOriginalProductMetadata(targetProduct); final MetadataElement annotationElem = origMetadataRoot.getElement("annotation"); final MetadataElement[] annotationDataSetListElem = annotationElem.getElements(); for (MetadataElement elem : annotationDataSetListElem) { final MetadataElement productElem = elem.getElement("product"); final MetadataElement imageAnnotationElem = productElem.getElement("imageAnnotation"); final MetadataElement processingInformationElem = imageAnnotationElem.getElement("processingInformation"); if (removeThermalNoise) { processingInformationElem.getAttribute("thermalNoiseCorrectionPerformed").getData().setElems("true"); } if (reIntroduceThermalNoise) { processingInformationElem.getAttribute("thermalNoiseCorrectionPerformed").getData().setElems("false"); } } }
private void updateMetadata() { final MetadataElement abstractedMetadata = AbstractMetadata.getAbstractedMetadata(targetProduct); if(abstractedMetadata != null) { abstractedMetadata.setAttributeInt("collocated_stack", 1); } final MetadataElement inputElem = ProductInformation.getInputProducts(targetProduct); getBaselines(sourceProduct, targetProduct); for (Product srcProduct : sourceProduct) { if (srcProduct == masterProduct) continue; final MetadataElement slvInputElem = ProductInformation.getInputProducts(srcProduct); final MetadataAttribute[] slvInputProductAttrbList = slvInputElem.getAttributes(); for (MetadataAttribute attrib : slvInputProductAttrbList) { final MetadataAttribute inputAttrb = AbstractMetadata.addAbstractedAttribute(inputElem, "InputProduct", ProductData.TYPE_ASCII, "", ""); inputAttrb.getData().setElems(attrib.getData().getElemString()); } } }
gainsAttrib.getData().setElems(gainsArray); lut.addAttribute(gainsAttrib);
/** * Update target product metadata. */ private void updateTargetProductMetadata() { final MetadataElement abstractedMetadata = AbstractMetadata.getAbstractedMetadata(targetProduct); if(abstractedMetadata != null) { abstractedMetadata.setAttributeInt("collocated_stack", 1); } final MetadataElement absTgt = AbstractMetadata.getAbstractedMetadata(targetProduct); AbstractMetadata.setAttribute(absTgt, AbstractMetadata.coregistered_stack, 1); final MetadataElement inputElem = ProductInformation.getInputProducts(targetProduct); for(Product slaveProduct : slaveProducts) { final MetadataElement slvInputElem = ProductInformation.getInputProducts(slaveProduct); final MetadataAttribute[] slvInputProductAttrbList = slvInputElem.getAttributes(); for (MetadataAttribute attrib : slvInputProductAttrbList) { final MetadataAttribute inputAttrb = AbstractMetadata.addAbstractedAttribute( inputElem, "InputProduct", ProductData.TYPE_ASCII, "", ""); inputAttrb.getData().setElems(attrib.getData().getElemString()); } } CreateStackOp.getBaselines(sourceProduct, targetProduct); }
inputAttrb.getData().setElems(targetProduct.getName());
nameAttr.getData().setElems(dataFilename);
productData.setElems(valStr); parentMetadataElem.addAttribute(attr);