Package ucar.nc2

Examples of ucar.nc2.Attribute


  private void makeGrib1Vocabulary(List<GridDatatype> grids, PrintStream out) {
    String stdName;
    out.println("\n<variables vocabulary='GRIB-1'>");
    for (GridDatatype grid : grids) {
      Attribute att = grid.findAttributeIgnoreCase("GRIB_param_number");
      stdName = (att != null) ? att.getNumericValue().toString() : null;

      out.print("  <variable name='");
      out.print(grid.getFullName());
      out.print("' vocabulary_name='");
      out.print(stdName != null ? stdName : "dunno");
View Full Code Here


     */
    @Override
    public String stringValue(final String name) {
        if (name != null) { // For createResponsibleParty(...) convenience.
            for (final Group group : groups) {
                final Attribute attribute = findAttribute(group, name);
                if (attribute != null && attribute.isString()) {
                    String value = attribute.getStringValue();
                    if (value != null && !(value = value.trim()).isEmpty()) {
                        return value;
                    }
                }
            }
View Full Code Here

     */
    @Override
    public Number numericValue(final String name) {
        if (name != null) {
            for (final Group group : groups) {
                final Attribute attribute = findAttribute(group, name);
                if (attribute != null) {
                    final Number value = attribute.getNumericValue();
                    if (value != null) {
                        return value;
                    }
                    String asString = attribute.getStringValue();
                    if (asString != null && !(asString = asString.trim()).isEmpty()) {
                        return parseNumber(asString);
                    }
                }
            }
View Full Code Here

     */
    @Override
    public Date dateValue(final String name) {
        if (name != null) {
            for (final Group group : groups) {
                final Attribute attribute = findAttribute(group, name);
                if (attribute != null && attribute.isString()) {
                    String value = attribute.getStringValue();
                    if (value != null && !(value = value.trim()).isEmpty()) {
                        final CalendarDate date;
                        try {
                            date = CalendarDateFormatter.isoStringToCalendarDate(Calendar.proleptic_gregorian, value);
                        } catch (IllegalArgumentException e) {
View Full Code Here

      group = toto.getParentGroup();

      // Scan node's attribute
      List<?> list_attr = group.getAttributes();
      for (Object name : list_attr) {
        Attribute attr = (Attribute) name;
        System.out.println(">> attribut : " + attr.toString());
      }
    }

    System.out.println("Total execution time: " + (System.currentTimeMillis() - time) / 1000. + "s");
  }
View Full Code Here

          log.info("Opening dataset to get global attributes");
          //--- if not a dataset collection then
          //--- open and check global attributes for metadata conventions
          try {
            NetcdfDataset ncD = NetcdfDataset.openDataset("thredds:"+ds.getCatalogUrl());
            Attribute mdCon = ncD.findGlobalAttributeIgnoreCase("metadata_conventions");
            if (mdCon != null) {
              List<Attribute> ga = ncD.getGlobalAttributes();
              for (Attribute att : ga ) {
                                if(log.isDebugEnabled()) log.debug("Attribute found "+att.toString());
                //--- TODO: Attach the attributes to the metadata node
View Full Code Here

     */
    @Override
    public String stringValue(final String name) {
        if (name != null) { // For createResponsibleParty(...) convenience.
            for (final Group group : groups) {
                final Attribute attribute = findAttribute(group, name);
                if (attribute != null && attribute.isString()) {
                    String value = attribute.getStringValue();
                    if (value != null && !(value = value.trim()).isEmpty()) {
                        return value;
                    }
                }
            }
View Full Code Here

     */
    @Override
    public Number numericValue(final String name) {
        if (name != null) {
            for (final Group group : groups) {
                final Attribute attribute = findAttribute(group, name);
                if (attribute != null) {
                    final Number value = attribute.getNumericValue();
                    if (value != null) {
                        return value;
                    }
                    String asString = attribute.getStringValue();
                    if (asString != null && !(asString = asString.trim()).isEmpty()) {
                        return parseNumber(asString);
                    }
                }
            }
View Full Code Here

     */
    @Override
    public Date dateValue(final String name) {
        if (name != null) {
            for (final Group group : groups) {
                final Attribute attribute = findAttribute(group, name);
                if (attribute != null && attribute.isString()) {
                    String value = attribute.getStringValue();
                    if (value != null && !(value = value.trim()).isEmpty()) {
                        final CalendarDate date;
                        try {
                            date = CalendarDateFormatter.isoStringToCalendarDate(Calendar.proleptic_gregorian, value);
                        } catch (IllegalArgumentException e) {
View Full Code Here

     * determined by comparing its name with the name of all dimensions in the NetCDF file.
     */
    @Override
    public boolean isCoordinateSystemAxis() {
        String name = null;
        final Attribute attribute = variable.findAttributeIgnoreCase(_CoordinateVariableAlias);
        if (attribute != null) {
            name = attribute.getStringValue();
        }
        if (name == null) {
            name = getName();
        }
        for (final Dimension dimension : all) {
View Full Code Here

TOP

Related Classes of ucar.nc2.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.