private void aggregate(String productName, MetadataElement processingGraphElement) { final MetadataElement inputMetaElement = Utilities.createSourceMetaElement(productName, aggregatedCount); if (processingGraphElement != null && aggregatedCount == 0) { inputMetaElement.addElement(processingGraphElement.createDeepClone()); } inputsMetaElement.addElementAt(inputMetaElement, aggregatedCount); ++aggregatedCount; } }
private void assignSPH(MetadataElement metadataRoot) throws IOException, IllegalCeosFormatException { final MetadataElement sphElement = new MetadataElement("SPH"); metadataRoot.addElement(sphElement); sphElement.addElement(getMapProjectionMetadata()); sphElement.addElement(getRadiometricMetadata()); sphElement.addElement(getPlatformMetadata()); }
/** * Set the metadata for location and radiance */ private void setMetadata() { final List metadata = landsatTM.getMetadata(); for (Iterator iter = metadata.iterator(); iter.hasNext(); ) { MetadataElement element = (MetadataElement) iter.next(); product.getMetadataRoot().addElement(element); } }
private void aggregate(String productName, MetadataElement processingGraphElement) { final MetadataElement productElement = Utilities.createSourceMetaElement(productName, aggregatedCount); if (processingGraphElement != null) { productElement.addElement(processingGraphElement.createDeepClone()); } inputsMetaElement.addElementAt(productElement, aggregatedCount); ++aggregatedCount; } }
private void addMetaData(final Product product) throws IOException, IllegalCeosFormatException { final MetadataElement metadata = new MetadataElement("SPH"); metadata.addElement(leaderFile.getMapProjectionMetadata()); metadata.addElement(leaderFile.getRadiometricMetadata()); metadata.addElement(leaderFile.getPlatformMetadata()); addSummaryMetadata(metadata); product.getMetadataRoot().addElement(metadata); final MetadataElement volumeDescriptor = new MetadataElement("VOLUME_DESCRIPTOR"); volumeDirectoryFile.assignMetadataTo(volumeDescriptor); product.getMetadataRoot().addElement(volumeDescriptor); }
private static void createTimeSeriesMetadataStructure(Product tsProduct) { if (!tsProduct.getMetadataRoot().containsElement(TIME_SERIES_ROOT_NAME)) { final MetadataElement timeSeriesRoot = new MetadataElement(TIME_SERIES_ROOT_NAME); final MetadataElement productListElement = new MetadataElement(PRODUCT_LOCATIONS); final MetadataElement sourceProductPathsElement = new MetadataElement(SOURCE_PRODUCT_PATHS); final MetadataElement variablesListElement = new MetadataElement(VARIABLES); timeSeriesRoot.addElement(productListElement); timeSeriesRoot.addElement(sourceProductPathsElement); timeSeriesRoot.addElement(variablesListElement); tsProduct.getMetadataRoot().addElement(timeSeriesRoot); } }
public static MetadataElement readVariableDescriptions(final List<Variable> variableList, String elementName, int maxNumValuesRead) { MetadataElement metadataElement = new MetadataElement(elementName); for (Variable variable : variableList) { metadataElement.addElement(createMetadataElement(variable, maxNumValuesRead)); } return metadataElement; }
public void addGlobalMetadata(Product product) { final MetadataElement globalElement = new MetadataElement("Global_Attributes"); addAttributesToElement(globalAttributes, globalElement); final MetadataElement metadataRoot = product.getMetadataRoot(); metadataRoot.addElement(globalElement); }
private void addMetadata(Product product) throws IOException { final MetadataElement tbmHeaderElement = HeaderWrapper.getAsMetadataElement( data.getCompound(tbmHeaderRecordIndex)); product.getMetadataRoot().addElement(tbmHeaderElement); final MetadataElement datasetHeaderElement = HeaderWrapper.getAsMetadataElement( data.getCompound(datasetHeaderRecordIndex)); product.getMetadataRoot().addElement(datasetHeaderElement); }
@Override public void addMetaData(MetadataElement metadataRoot) throws IOException { if (hasArsHeader) { HeaderWrapper headerWrapper = new HeaderWrapper(noaaData.getCompound(0)); metadataRoot.addElement(headerWrapper.getAsMetadataElement()); } HeaderWrapper headerWrapper = new HeaderWrapper(getHeader()); metadataRoot.addElement(headerWrapper.getAsMetadataElement()); }
private static void addIDNode(final MetadataElement absRoot, final MetadataElement identNode, final String title, final String tag) { final MetadataAttribute attrib = absRoot.getAttribute(tag); if (attrib == null) return; final String value = title + ": " + attrib.getData().getElemString(); final MetadataElement newAttrib = new MetadataElement(value); identNode.addElement(newAttrib); }
private void initGraphMetadata() { final MetadataElement metadataRoot = targetProduct.getMetadataRoot(); MetadataElement targetGraphME = metadataRoot.getElement(PROCESSING_GRAPH_ELEMENT_NAME); if (targetGraphME == null) { targetGraphME = new MetadataElement(PROCESSING_GRAPH_ELEMENT_NAME); metadataRoot.addElement(targetGraphME); } convertOperatorContextToMetadata(this, targetGraphME); }
private MetadataElement getMetadataElementSave(Product product, String name) { final MetadataElement metadataElement = product.getMetadataRoot().getElement(name); final MetadataElement namedElem; if (metadataElement == null) { namedElem = new MetadataElement(name); product.getMetadataRoot().addElement(namedElem); } else { namedElem = metadataElement; } return namedElem; }
private void prepareProduct() { final MetadataElement tsRoot = new MetadataElement(AbstractTimeSeries.TIME_SERIES_ROOT_NAME); testProduct.getMetadataRoot().addElement(tsRoot); final MetadataElement productLocations = new MetadataElement(AbstractTimeSeries.PRODUCT_LOCATIONS); tsRoot.addElement(productLocations); final MetadataElement sourcePaths = new MetadataElement(AbstractTimeSeries.SOURCE_PRODUCT_PATHS); tsRoot.addElement(sourcePaths); addProductLocationElements(productLocations); addSourceProductPathsElemets(sourcePaths); }
private void addVariableToMetadata(String variable) { MetadataElement variableListElement = tsProduct.getMetadataRoot(). getElement(TIME_SERIES_ROOT_NAME). getElement(VARIABLES); final ProductData variableName = ProductData.createInstance(variable); final ProductData isSelected = ProductData.createInstance(Boolean.toString(false)); int length = variableListElement.getElements().length + 1; MetadataElement elem = new MetadataElement(String.format("%s.%s", VARIABLES, Integer.toString(length))); elem.addAttribute(new MetadataAttribute(VARIABLE_NAME, variableName, true)); elem.addAttribute(new MetadataAttribute(VARIABLE_SELECTION, isSelected, true)); variableListElement.addElement(elem); }
private void addInputProductPathsToMetadata(Product product) { final MetadataElement productsElement = new MetadataElement("Input products"); final String[] absoluteInputProductPaths = getAbsoluteInputProductPaths(); for (int i = 0; i < absoluteInputProductPaths.length; i++) { String inputProductAbsPath = absoluteInputProductPaths[i]; final ProductData pathData = ProductData.createInstance(inputProductAbsPath); final MetadataAttribute pathAttribute = new MetadataAttribute("product_" + i, pathData, true); productsElement.addAttribute(pathAttribute); } product.getMetadataRoot().addElement(productsElement); }
private void addSynthesisMetadataElement(List<Attribute> rootMetadata, final Product product, String metadataElementName) { final MetadataElement metadataElement = new MetadataElement(metadataElementName); for (Attribute attribute : rootMetadata) { metadataElement.addAttribute(new MetadataAttribute(attribute.getName(), ProductData.createInstance(ProbaVUtils.getAttributeValue(attribute)), true)); } product.getMetadataRoot().addElement(metadataElement); }
private void addSynthesisMetadataElement(List<Attribute> rootMetadata, final Product product, String metadataElementName) { final MetadataElement metadataElement = new MetadataElement(metadataElementName); for (Attribute attribute : rootMetadata) { metadataElement.addAttribute(new MetadataAttribute(attribute.getName(), ProductData.createInstance(ProbaVUtils.getAttributeValue(attribute)), true)); } product.getMetadataRoot().addElement(metadataElement); }
private void addMetadata(Product sp) { final MetadataElement meta1 = new MetadataElement("meta1"); meta1.addAttribute(new MetadataAttribute("attrib1", ProductData.createInstance("value"), true)); final MetadataElement meta2 = new MetadataElement("meta2"); final MetadataElement meta2_1 = new MetadataElement("meta2_1"); meta2_1.addAttribute(new MetadataAttribute("attrib2_1", ProductData.createInstance("meta2_1_value"), true)); meta2.addElement(meta2_1); final MetadataElement metadataRoot = sp.getMetadataRoot(); metadataRoot.addAttribute(new MetadataAttribute("attribRoot", ProductData.createInstance("rootValue"), true)); metadataRoot.addElement(meta1); metadataRoot.addElement(meta2); }
private void addProductLocationElements(MetadataElement productLocations) { final MetadataElement location0 = new MetadataElement(AbstractTimeSeries.PRODUCT_LOCATIONS + "." + 0); final MetadataElement location1 = new MetadataElement(AbstractTimeSeries.PRODUCT_LOCATIONS + "." + 1); productLocations.addElement(location0); productLocations.addElement(location1); location0.addAttribute(new MetadataAttribute(AbstractTimeSeries.PL_PATH, ProductData.createInstance(absoluteProductPath1), true)); location0.addAttribute(new MetadataAttribute(AbstractTimeSeries.PL_TYPE, ProductData.createInstance("FILE"), true)); location1.addAttribute(new MetadataAttribute(AbstractTimeSeries.PL_PATH, ProductData.createInstance(absoluteProductPath2), true)); location1.addAttribute(new MetadataAttribute(AbstractTimeSeries.PL_TYPE, ProductData.createInstance("FILE"), true)); }