@Override public Integer getValue() throws IllegalAccessException, InvocationTargetException { return leaf.getData().getElemInt(); } }
/** * Get the number of data points. * * @return The number of data points. */ private int getNumOfDataPoints() { // Field 14 in PRI Platform Position Data Set Record final MetadataElement facility = origMetadataRoot.getElement("Leader").getElement("Platform Position"); if (facility == null) { throw new OperatorException("Platform Position not found"); } final MetadataAttribute attr = facility.getAttribute("Number of data points"); if (attr == null) { throw new OperatorException("Number of data points not found"); } return attr.getData().getElemInt(); }
/** * Get number of records in Main Processing Params data set. */ private void getNumOfRecordsInMainProcParam() { MetadataElement dsd = origMetadataRoot.getElement("DSD").getElement("DSD.3"); if (dsd == null) { throw new OperatorException("DSD not found"); } MetadataAttribute numRecordsAttr = dsd.getAttribute("num_records"); if (numRecordsAttr == null) { throw new OperatorException("num_records not found"); } numMPPRecords = numRecordsAttr.getData().getElemInt(); if (numMPPRecords < 1) { throw new OperatorException("Invalid num_records."); } //System.out.println("The number of Main Processing Params records is " + numMPPRecords); }
dimElem.addAttribute(metadataAttribute); if (metadataAttribute.getName().equals("owiRaSize")) { sceneWidth = metadataAttribute.getData().getElemInt(); // width = #columns } else if (metadataAttribute.getName().equals("owiAzSize")) { sceneHeight = metadataAttribute.getData().getElemInt(); // height = #rows
/** * Get number of records in Main Processing Params data set. * * @param sourceProduct The source prodict. * @return The number of records. * @throws OperatorException The exceptions. */ static int getNumOfRecordsInMainProcParam(Product sourceProduct) throws OperatorException { final MetadataElement origRoot = AbstractMetadata.getOriginalProductMetadata(sourceProduct); final MetadataElement dsdElem = origRoot.getElement("DSD"); if (dsdElem == null) { throw new OperatorException("DSD not found"); } final MetadataElement dsd = dsdElem.getElement("DSD.3"); if (dsd == null) { throw new OperatorException("DSD not found"); } final MetadataAttribute numRecordsAttr = dsd.getAttribute("num_records"); if (numRecordsAttr == null) { throw new OperatorException("num_records not found"); } int numMPPRecords = numRecordsAttr.getData().getElemInt(); if (numMPPRecords < 1) { throw new OperatorException("Invalid num_records."); } //System.out.println("The number of Main Processing Params records is " + numMPPRecords); return numMPPRecords; }