Package ucar.nc2.util

Examples of ucar.nc2.util.Indent


   */
  private double getGridSpacingInKm(String type) {
    double value = gds.getDouble(type);
    if (Double.isNaN(value)) return value;
    String gridUnit = gds.getParam(GridDefRecord.GRID_UNITS);
    SimpleUnit unit = null;

    if (gridUnit == null || gridUnit.length() == 0) {
      unit = SimpleUnit.meterUnit;
    } else {
      unit = SimpleUnit.factory(gridUnit);
    }
    if (unit != null && SimpleUnit.isCompatible(unit.getUnitString(), "km")) {
      value = unit.convertTo(value, SimpleUnit.kmUnit);
    }
    return value;

  }
View Full Code Here


    } catch (Exception e) {
      // ok
    }

    try {
      new TimeUnit(unit);
      return "time";
    } catch (Exception e) {
      // ok
    }
View Full Code Here

   * @param out   send output here.
   * @param ct    allow task to be cancelled; may be null.
   * @throws java.io.IOException on read error
   */
  static public void printArray(Array array, String name, PrintWriter out, CancelTask ct) throws IOException {
    printArray(array, name, null, out, new Indent(2), ct, true);
    out.flush();
  }
View Full Code Here

  }

  static public String printArray(Array array, String name, CancelTask ct) throws IOException {
    CharArrayWriter carray = new CharArrayWriter(100000);
    PrintWriter pw = new PrintWriter(carray);
    printArray(array, name, null, pw, new Indent(2), ct, true);
    return carray.toString();
  }
View Full Code Here

   * @param out   send output here.
   * @param sdata StructureData to print.
   * @throws java.io.IOException on read error
   */
  static public void printStructureData(PrintWriter out, StructureData sdata) throws IOException {
    printStructureData(out, sdata, new Indent(2), null);
    out.flush();
  }
View Full Code Here

    if (ncfile.getId() != null)
      out.format("    id='%s'%n", StringUtil.quoteXmlAttribute(ncfile.getId()));
    if (ncfile.getTitle() != null)
      out.format("    title='%s'%n", StringUtil.quoteXmlAttribute(ncfile.getTitle()));

    writeNcMLGroup(ncfile, ncfile.getRootGroup(), out, new Indent(2), showValues);

    out.format("</netcdf>%n");
    out.flush();
  }
View Full Code Here

    out.flush();
  }

  static public void writeNcMLVariable(Variable v, Formatter out) throws IOException {
    if (v instanceof Structure) {
      writeNcMLStructure((Structure) v, out, new Indent(2), WantValues.none);
    } else {
      writeNcMLVariable(v, out, new Indent(2), WantValues.none);
    }
  }
View Full Code Here

   * @param name title the output.
   * @param out send output here.
   * @param ct allow task to be cancelled; may be null.
   */
  static public void printArray(Array array, String name, PrintStream out, CancelTask ct) {
    printArray( array, name, null, out, new Indent(2), ct);
  }
View Full Code Here

   * Print contents of a StructureData.
   * @param out send output here.
   * @param  sdata StructureData to print.
   */
  static public void printStructureData(PrintStream out, StructureData sdata) {
     printStructureData(out, sdata, new Indent(2), null);
  }
View Full Code Here

    if (ncfile.getId() != null)
      out.print("    id='"+ StringUtil.quoteXmlAttribute(ncfile.getId())+"' >\n");
    if (ncfile.getTitle() != null)
      out.print("    title='"+ StringUtil.quoteXmlAttribute(ncfile.getTitle())+"' >\n");

    writeNcMLGroup( ncfile, ncfile.getRootGroup(), out, new Indent(2), showCoords);

    out.print("</netcdf>\n");
    out.flush();
  }
View Full Code Here

TOP

Related Classes of ucar.nc2.util.Indent

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.