Example #1
0
  public void addBandMetadata(Product product) throws ProductIOException {
    Group group = ncFile.findGroup("Geophysical_Data");
    if (productReader.getProductType() == SeadasProductReader.ProductType.Level2_Aquarius) {
      group = ncFile.findGroup("Aquarius_Data");
    }
    if (productReader.getProductType() == SeadasProductReader.ProductType.Level1B_HICO) {
      group = ncFile.findGroup("products");
    }
    if (group != null) {
      final MetadataElement bandAttributes = new MetadataElement("Band_Attributes");
      List<Variable> variables = group.getVariables();
      for (Variable variable : variables) {
        final String name = variable.getShortName();
        final MetadataElement sdsElement = new MetadataElement(name + ".attributes");
        final int dataType = getProductDataType(variable);
        final MetadataAttribute prodtypeattr = new MetadataAttribute("data_type", dataType);

        sdsElement.addAttribute(prodtypeattr);
        bandAttributes.addElement(sdsElement);

        final List<Attribute> list = variable.getAttributes();
        for (Attribute varAttribute : list) {
          addAttributeToElement(sdsElement, varAttribute);
        }
      }
      final MetadataElement metadataRoot = product.getMetadataRoot();
      metadataRoot.addElement(bandAttributes);
    }
  }
Example #2
0
  public static boolean isMine(NetcdfFile ncfile) {
    if (!ncfile.getFileTypeId().equals("HDF5")) return false;

    Group loc = ncfile.findGroup("VHRR/Geo-Location");
    if (null == loc) return false;
    if (null == loc.findVariable("Latitude")) return false;
    if (null == loc.findVariable("Longitude")) return false;

    if (null == ncfile.findGroup("VHRR/Image Data")) return false;
    return true;
  }
Example #3
0
  public void addScientificMetadata(Product product) throws ProductIOException {

    Group group = ncFile.findGroup("Scan-Line_Attributes");
    if (group != null) {
      final MetadataElement scanLineAttrib =
          getMetadataElementSave(product, "Scan_Line_Attributes");
      handleMetadataGroup(group, scanLineAttrib);
    }

    group = ncFile.findGroup("Sensor_Band_Parameters");
    if (group != null) {
      final MetadataElement sensorBandParam =
          getMetadataElementSave(product, "Sensor_Band_Parameters");
      handleMetadataGroup(group, sensorBandParam);
    }
  }