public void addOriginalMetaData(Product product){ final MetadataElement origRoot = AbstractMetadata.addOriginalProductMetadata(product.getMetadataRoot()); Iterator it = this.metadataSummary.entrySet().iterator(); while (it.hasNext()){ Map.Entry pair = (Map.Entry)it.next(); AbstractMetadata.setAttribute(origRoot, (String) pair.getKey(), (String) pair.getValue()); } }
public static InSARStackOverview.IfgStack[] calculateInSAROverview(final Product coregProduct) throws Exception { MetadataElement slaveElem = coregProduct.getMetadataRoot().getElement(AbstractMetadata.SLAVE_METADATA_ROOT); if (slaveElem == null) { slaveElem = coregProduct.getMetadataRoot().getElement("Slave Metadata"); } final List<MetadataElement> absMetaList = new ArrayList<>(); absMetaList.add(AbstractMetadata.getAbstractedMetadata(coregProduct)); absMetaList.addAll(Arrays.asList(slaveElem.getElements())); return InSARStackOverview.calculateInSAROverview(absMetaList.toArray(new MetadataElement[absMetaList.size()])); }
private void setEnableState() { ProductNode productNode = lkp.lookup(ProductNode.class); boolean state = false; if (productNode != null) { product = productNode.getProduct(); state = product.getMetadataRoot() != null; } setEnabled(state); }
private void setEnableState() { ProductNode productNode = lkp.lookup(ProductNode.class); boolean state = false; if (productNode != null) { product = productNode.getProduct(); state = product.getMetadataRoot() != null; } setEnabled(state); }
private void setEnableState() { ProductNode productNode = lkp.lookup(ProductNode.class); boolean state = false; if (productNode != null) { product = productNode.getProduct(); state = product.getMetadataRoot() != null; } setEnabled(state); }
private static void clearProductMetadata(final Product product) { final String[] tpgNames = product.getTiePointGridNames(); for (String tpg : tpgNames) { product.removeTiePointGrid(product.getTiePointGrid(tpg)); } final MetadataElement root = product.getMetadataRoot(); final MetadataElement[] elems = root.getElements(); for (MetadataElement e : elems) { root.removeElement(e); } AbstractMetadata.addAbstractedMetadataHeader(product.getMetadataRoot()); }
private void addMetadataToProduct() { final Group rootGroup = netcdfFile.getRootGroup(); NetCDFUtils.addGroups(product.getMetadataRoot(), rootGroup); AbstractMetadata.getAbstractedMetadata(product); }
private void addMetadata(final Product product) { final MetadataElement rootElem = product.getMetadataRoot(); final Group rootGroup = netCDFWriteable.getRootGroup(); addElements(rootElem, rootGroup); addAttributes(rootElem, rootGroup); }
private String getTime(final Product product, final String tag){ final MetadataElement m = product.getMetadataRoot(); MetadataElement eAux = m.getElement("Auxiliary"); MetadataElement eRoot = eAux.getElement("Root"); //final String time = m.getElement("Auxilliary").getElement("Root").getAttributeString(tag); return eRoot.getAttributeString(tag); } private ProductData.UTC getStartTime(final Product product) {
private void updateSettings() { Product product = getProduct(); if (product == null) { plotSettings.setMetadataElements(null); return; } removeAllDatasetSeries(); MetadataElement metadataRoot = product.getMetadataRoot(); MetadataElement[] elements = metadataRoot.getElements(); recordSlider.setValue(1); plotSettings.setMetadataElements(elements); }
private void constructSourceMetadata() throws Exception { final MetadataElement masterMeta = AbstractMetadata.getAbstractedMetadata(sourceProduct); masterMetaMapPut(masterMeta, sourceProduct, masterMap); final String slaveMetadataRoot = AbstractMetadata.SLAVE_METADATA_ROOT; MetadataElement[] slaveRoot = sourceProduct.getMetadataRoot().getElement(slaveMetadataRoot).getElements(); for (MetadataElement slaveMeta : slaveRoot) { if (!slaveMeta.getName().equals(AbstractMetadata.ORIGINAL_PRODUCT_METADATA)) slaveMetaMapPut(masterMeta, slaveMeta, sourceProduct, slaveMap); } }
private void addMetadataToProduct() throws IOException { final MetadataElement origMetadataRoot = AbstractMetadata.addOriginalProductMetadata(product.getMetadataRoot()); NetCDFUtils.addAttributes(origMetadataRoot, NetcdfConstants.GLOBAL_ATTRIBUTES_NAME, netcdfFile.getGlobalAttributes()); addDeliveryNote(product); for (final Variable variable : variableMap.getAll()) { NetCDFUtils.addAttributes(origMetadataRoot, variable.getShortName(), variable.getAttributes()); } //final Group rootGroup = netcdfFile.getRootGroup(); //NetCDFUtils.addGroups(product.getMetadataRoot(), rootGroup); addAbstractedMetadataHeader(product, product.getMetadataRoot()); }
private void getMetadata() { mstRoot = AbstractMetadata.getAbstractedMetadata(sourceProduct[0]); MetadataElement slaveElem1 = sourceProduct[0].getMetadataRoot().getElement(AbstractMetadata.SLAVE_METADATA_ROOT); if (slaveElem1 == null) { throw new OperatorException("Slave_Metadata not found in product " + sourceProduct[0].getName()); } slv1Root = slaveElem1.getElements()[0]; MetadataElement slaveElem2 = sourceProduct[1].getMetadataRoot().getElement(AbstractMetadata.SLAVE_METADATA_ROOT); if (slaveElem2 == null) { throw new OperatorException("Slave_Metadata not found in product " + sourceProduct[1].getName()); } slv2Root = slaveElem2.getElements()[0]; }
private float[] getAttributes(Product product, String attribute) { return (float[]) product.getMetadataRoot().getElement("Variable_Attributes"). getElement(attribute).getElement("Values").getAttribute("data").getDataElems(); }
private void addMetaData(final Product product, final File inputFile) throws IOException { final MetadataElement root = product.getMetadataRoot(); final MetadataElement absRoot = AbstractMetadata.addAbstractedMetadataHeader(root); AbstractMetadata.setAttribute(absRoot, AbstractMetadata.PRODUCT, inputFile.getName()); AbstractMetadata.setAttribute(absRoot, AbstractMetadata.PRODUCT_TYPE, productType); AbstractMetadata.setAttribute(absRoot, AbstractMetadata.num_samples_per_line, imgIOFile.getSceneWidth()); AbstractMetadata.setAttribute(absRoot, AbstractMetadata.num_output_lines, imgIOFile.getSceneHeight()); AbstractMetadataIO.loadExternalMetadata(product, absRoot, inputFile); }
private void getMetadata() throws Exception { final MetadataElement slvAbsRoot = AbstractMetadata.getSlaveMetadata(sourceProduct.getMetadataRoot()).getElementAt(0); final double mstFirstLineTime = AbstractMetadata.parseUTC( mstAbsRoot.getAttributeString(AbstractMetadata.first_line_time)).getMJD(); // in days rangeSpacing = AbstractMetadata.getAttributeDouble(mstAbsRoot, AbstractMetadata.range_spacing); azimuthSpacing = AbstractMetadata.getAttributeDouble(mstAbsRoot, AbstractMetadata.azimuth_spacing); final double slvFirstLineTime = AbstractMetadata.parseUTC( slvAbsRoot.getAttributeString(AbstractMetadata.first_line_time)).getMJD(); // in days acquisitionTimeInterval = Math.abs(slvFirstLineTime - mstFirstLineTime); // in days maxOffset = maxVelocity * acquisitionTimeInterval; // in m }
private void copySlaveMetadata(final Product slaveProduct) { final MetadataElement targetSlaveMetadataRoot = AbstractMetadata.getSlaveMetadata( targetProduct.getMetadataRoot()); final MetadataElement slvAbsMetadata = AbstractMetadata.getAbstractedMetadata(slaveProduct); if (slvAbsMetadata != null) { final String timeStamp = StackUtils.createBandTimeStamp(slaveProduct); final MetadataElement targetSlaveMetadata = new MetadataElement(slaveProduct.getName() + timeStamp); targetSlaveMetadataRoot.addElement(targetSlaveMetadata); ProductUtils.copyMetadata(slvAbsMetadata, targetSlaveMetadata); } }
private void copySlaveMetadata() { final MetadataElement targetSlaveMetadataRoot = AbstractMetadata.getSlaveMetadata(targetProduct.getMetadataRoot()); for (Product prod : sourceProduct) { if (prod != masterProduct) { final MetadataElement slvAbsMetadata = AbstractMetadata.getAbstractedMetadata(prod); if (slvAbsMetadata != null) { final String timeStamp = StackUtils.createBandTimeStamp(prod); final MetadataElement targetSlaveMetadata = new MetadataElement(prod.getName() + timeStamp); targetSlaveMetadataRoot.addElement(targetSlaveMetadata); ProductUtils.copyMetadata(slvAbsMetadata, targetSlaveMetadata); } } } }
private void getBaseline() throws Exception { final MetadataElement masterMeta = AbstractMetadata.getAbstractedMetadata(sourceProduct); final SLCImage masterMetaData = new SLCImage(masterMeta, sourceProduct); final Orbit masterOrbit = new Orbit(masterMeta, 3); final MetadataElement[] slaveRoot = sourceProduct.getMetadataRoot(). getElement(AbstractMetadata.SLAVE_METADATA_ROOT).getElements(); final SLCImage slaveMetaData = new SLCImage(slaveRoot[0], sourceProduct); final Orbit slaveOrbit = new Orbit(slaveRoot[0], 3); baseline.model(masterMetaData, slaveMetaData, masterOrbit, slaveOrbit); }
protected static void updateProduct(final Product product, final MetadataElement newRoot) { final MetadataElement root = product.getMetadataRoot(); for(MetadataElement elem : newRoot.getElements()) { root.addElement(elem); } final MetadataElement absRoot = AbstractMetadata.getAbstractedMetadata(product); product.setStartTime(absRoot.getAttributeUTC(AbstractMetadata.first_line_time)); product.setEndTime(absRoot.getAttributeUTC(AbstractMetadata.last_line_time)); product.setProductType(absRoot.getAttributeString(AbstractMetadata.PRODUCT_TYPE)); product.setDescription(absRoot.getAttributeString(AbstractMetadata.SPH_DESCRIPTOR)); }