public MetadataTableLeaf(MetadataAttribute attribute) { this(attribute.getName(), attribute.getDataType(), attribute.getData(), attribute.getUnit(), attribute.getDescription()); }
private static void replaceAbstractedMetadataField(final MetadataElement abstractedMetadata, final String attrName, final String newValue) { final ProductData productData = abstractedMetadata.getAttribute(attrName).getData(); productData.setElems(newValue); }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); if (abs != null) { abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); } }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); }
private static void addAttrib(final MetadataElement elem, final String tag, final double value) { final MetadataAttribute attrib = new MetadataAttribute(tag, ProductData.TYPE_FLOAT64); attrib.getData().setElemDouble(value); elem.addAttribute(attrib); }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); if (abs != null) { abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); } }
protected void validateMetadata(final Product trgProduct) throws Exception { final MetadataElement absRoot = AbstractMetadata.getAbstractedMetadata(trgProduct); final MetadataAttribute[] attribs = absRoot.getAttributes(); for(MetadataAttribute attrib : attribs) { System.out.println(attrib.getName() +"= "+ attrib.getData().toString()); } } }
/** * Get calibration flag from abstract metadata. */ public void getCalibrationFlag() { if (absRoot.getAttribute(AbstractMetadata.abs_calibration_flag).getData().getElemBoolean()) { throw new OperatorException("Absolute radiometric calibration has already been applied to the product"); } }
public String getMasksFolder() { String maskFolderName = null; MetadataAttribute currentElement; MetadataElement filesElement; if (((filesElement = rootElement.getElement(SpotConstants.SPOT4_TAKE5_TAG_FILES)) != null)) { if ((currentElement = filesElement.getAttribute(SpotConstants.SPOT4_TAKE5_TAG_MASK_N2)) != null) { ProductData data = currentElement.getData(); maskFolderName = data != null ? data.toString() : null; } } return maskFolderName; }
default MetadataElement getMetadataObject(final MetadataElement origProdRoot, final String metadataObjectName) { final MetadataElement metadataSection = origProdRoot.getElement("XFDU").getElement("metadataSection"); final MetadataElement[] metadataObjects = metadataSection.getElements(); for (MetadataElement elem : metadataObjects) { if (elem.getAttribute("ID").getData().getElemString().equals(metadataObjectName)) { return elem; } } return null; } }
public ArrayList<String> getBandNames() { ArrayList<String> bands = new ArrayList<>(17); MetadataElement bandGlobalListElement = getRootElement().getElement("Product_Characteristics").getElement("Band_Global_List"); for (int j = 0; j < bandGlobalListElement.getNumAttributes(); j++) { if (bandGlobalListElement.getAttributeAt(j).getName().equals("BAND_ID")) { bands.add(bandGlobalListElement.getAttributeAt(j).getData().getElemString()); } } return bands; }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement absRoot = AbstractMetadata.getAbstractedMetadata(targetProduct); absRoot.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); if(!outputImageInComplex) { absRoot.setAttributeString(AbstractMetadata.SAMPLE_TYPE, "DETECTED"); } }
private void addFlagDescriptor(String name, int value, String description) { MetadataAttribute attribute = new MetadataAttribute(name, ProductData.TYPE_INT32); attribute.getData().setElemInt(value); attribute.setDescription(description); flagCoding.addAttribute(attribute); }
private double getData(MetadataElement element) { if (element.getElement("Values") != null) { return element.getElement("Values").getAttribute("data").getData().getElemDouble(); } return 0; }
/** * Get thermal noise correction flag from the original product metadata. */ private void getThermalNoiseCorrectionFlag() { final MetadataElement annotationElem = origMetadataRoot.getElement("annotation"); final MetadataElement[] annotationDataSetListElem = annotationElem.getElements(); final MetadataElement productElem = annotationDataSetListElem[0].getElement("product"); final MetadataElement imageAnnotationElem = productElem.getElement("imageAnnotation"); final MetadataElement processingInformationElem = imageAnnotationElem.getElement("processingInformation"); thermalNoiseCorrectionPerformed = Boolean.parseBoolean( processingInformationElem.getAttribute("thermalNoiseCorrectionPerformed").getData().getElemString()); }
private void addArrayDataToSeries(int domainAxisIndex, int rangeAxisIndex, int datasetIndex, String yName, MetadataElement metadataElement, double[] arrayIndices, String recordElementName) { double[] yAxisData = new double[arrayIndices.length]; ProductData attributeData = metadataElement.getElement(recordElementName).getAttribute(yName).getData(); Arrays.setAll(yAxisData, attributeData::getElemDoubleAt); String seriesKey = String.format("%s/%s", recordElementName, yName); DefaultXYDataset dataset = new DefaultXYDataset(); dataset.addSeries(seriesKey, new double[][]{arrayIndices, yAxisData}); xyPlot.setDataset(datasetIndex, dataset); xyPlot.mapDatasetToRangeAxis(datasetIndex, rangeAxisIndex); xyPlot.mapDatasetToDomainAxis(datasetIndex, domainAxisIndex); xyPlot.setRenderer(datasetIndex, creatItemRenderer(datasetIndex, ProductData.TYPE_INT32)); }
/** * Update the metadata in the target product. */ private void updateTargetProductMetadata() { final MetadataElement abs = AbstractMetadata.getAbstractedMetadata(targetProduct); abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true); final MetadataElement origProdRoot = AbstractMetadata.getOriginalProductMetadata(targetProduct); origProdRoot.removeElement(origProdRoot.getElement(lutsigma)); origProdRoot.removeElement(origProdRoot.getElement(lutgamma)); origProdRoot.removeElement(origProdRoot.getElement(lutbeta)); }