Package ucar.nc2.units

Examples of ucar.nc2.units.DateType.toDateTimeString()


    } catch (ParseException e) {
      throw new RuntimeException("Cant read start_date="+start_date);
    }

    Variable v = ds.findVariable("time_offset");
    v.addAttribute(new Attribute( "units", "seconds since "+dfo.toDateTimeString(start)));

    Group root = ds.getRootGroup();
    root.addAttribute(new Attribute( "Convention", "Suomi-Station-CDM"));   
    ds.finish();
  }
View Full Code Here


        Variable timeVar = new Variable(ncfile, null, null, "time");
        timeVar.setDataType(DataType.INT);
        timeVar.setDimensions("time");
        timeVar.addAttribute(new Attribute("units",
                                           "seconds since "
                                           + df.toDateTimeString(nomTime)));
        timeVar.addAttribute(new Attribute("long_name", "time"));
        varArray = new ArrayInt.D1(1);
        ((ArrayInt.D1) varArray).set(0, 0);
        timeVar.setCachedData(varArray, false);
        ncfile.addVariable(null, timeVar);
View Full Code Here

        // add the attributes
        ncfile.addAttribute(null, new Attribute("Conventions", "CF-1.0"));
        ncfile.addAttribute(null, new Attribute("netCDF-Java", "4.0"));
        ncfile.addAttribute(null,
                            new Attribute("nominal_image_time",
                                          df.toDateTimeString(nomTime)));
        String encStr = "netCDF encoded on "
                        + df.toDateTimeString(new Date());
        ncfile.addAttribute(null, new Attribute("history", encStr));

        //Lastly, finish the file
View Full Code Here

        ncfile.addAttribute(null, new Attribute("netCDF-Java", "4.0"));
        ncfile.addAttribute(null,
                            new Attribute("nominal_image_time",
                                          df.toDateTimeString(nomTime)));
        String encStr = "netCDF encoded on "
                        + df.toDateTimeString(new Date());
        ncfile.addAttribute(null, new Attribute("history", encStr));

        //Lastly, finish the file
        ncfile.finish();
        return true;
View Full Code Here

  public List<NamedObject> getNames() {
    DateFormatter formatter = new DateFormatter();
    int n = (int) getSize();
    List<NamedObject> names = new ArrayList<NamedObject>(n);
    for (int i = 0; i < n; i++) {
      names.add(new NamedAnything(formatter.toDateTimeString(getTimeDate(i)), "date/time"));
    }
    return names;
  }

  /**
 
View Full Code Here

    Formatter sbuff = new Formatter();
    sbuff.format("%s %d %n", name, records.size());
    for (GridRecord record : records) {
      sbuff.format(" level = %d %f", record.getLevelType1(), record.getLevel1());
      if (null != record.getValidTime())
        sbuff.format(" time = %s", formatter.toDateTimeString(record.getValidTime()));
      sbuff.format("%n");
    }
    return sbuff.toString();
  }
View Full Code Here

        f.format("  %s%n", grid.getFullName());
      }

      f.format("%nRun Dates= %s%n", runtimes.size());
      for (Date date : runtimes) {
        f.format(" %s (", df.toDateTimeString(date));
        List<Inventory> list = runMap.get(date);
        if (list == null)
          f.format(" none");
        else {
          for (Inventory inv : list) {
View Full Code Here

        f.format(") %n");
      }

      f.format("%nForecast Dates= %d %n",forecasts.size());
      for (Date date : forecasts) {
        f.format(" %s(", df.toDateTimeString(date));
        List<Inventory> list = timeMap.get(date);
        if (list == null)
          f.format(" none");
        else {
          for (Inventory inv : list) {
View Full Code Here

    DateFormatter formatter = new  DateFormatter();

    for (ErrMessage err : errs) {
      if (err.runDate != currentDate) {
        if (currentDate != null) out.println();
        out.println(" Run " + formatter.toDateTimeString(err.runDate));
        currentDate = err.runDate;
        currentType = null;
      }

      if (!err.type.equals(currentType)) {
View Full Code Here

    StringBuffer sbuff = new StringBuffer();

    sbuff.append("  location= ").append(getLocation()).append("\n");
    sbuff.append("  title= ").append(getTitle()).append("\n");
    sbuff.append("  desc= ").append(getDescription()).append("\n");
    sbuff.append("  start= ").append(formatter.toDateTimeString(getStartDate())).append("\n");
    sbuff.append("  end  = ").append(formatter.toDateTimeString(getEndDate())).append("\n");
    sbuff.append("  bb   = ").append(getBoundingBox()).append("\n");
    if (getBoundingBox() != null )
      sbuff.append("  bb   = ").append(getBoundingBox().toString2()).append("\n");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.