Examples of DateFormatter


Examples of ucar.nc2.units.DateFormatter

  }

  private List<InvDatasetImpl> makeForecastDatasets() throws IOException {

    List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>();
    DateFormatter formatter = new DateFormatter();

    String id = getID();
    if (id == null)
      id = getPath();

    for (Date forecastDate : fmrc.getForecastDates()) {
      String name = getName() + "_" + FORECAST_NAME + formatter.toDateTimeStringISO(forecastDate);
      name = StringUtil.replace(name, ' ', "_");
      InvDatasetImpl nested = new InvDatasetImpl(this, name);
      nested.setUrlPath(path + "/" + FORECAST + "/" + name);
      nested.setID(id + "/" + FORECAST + "/" + name);
      ThreddsMetadata tm = nested.getLocalMetadata();
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

      } else if (wantType.equals(RUNS) && wantDatasets.contains(FeatureCollectionConfig.FmrcDatasetType.Runs)) {
        int pos1 = wantName.indexOf(RUN_NAME);
        if (pos1<0) return null;
        String id = wantName.substring(pos1+RUN_NAME.length());

        DateFormatter formatter = new DateFormatter();
        Date date = formatter.getISODate(id);
        return fmrc.getRunTimeDataset(date);

      } else if (wantType.equals(FORECAST) && wantDatasets.contains(FeatureCollectionConfig.FmrcDatasetType.ConstantForecasts)) {
        int pos1 = wantName.indexOf(FORECAST_NAME);
        if (pos1<0) return null;
        String id = wantName.substring(pos1+FORECAST_NAME.length());

        DateFormatter formatter = new DateFormatter();
        Date date = formatter.getISODate(id);
        return fmrc.getConstantForecastDataset(date);

      } else if (config.fmrcConfig.getBestDatasets() != null) {
        for (FeatureCollectionConfig.BestDataset bd : config.fmrcConfig.getBestDatasets()) {
          if (wantName.endsWith(bd.name)) {
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

  public void close() throws java.io.IOException {
    if (ncfile != null) ncfile.close();
  }

  public String getDetailInfo() {
    DateFormatter formatter = new DateFormatter();
    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");

    sbuff.append("  has netcdf = ").append(getNetcdfFile() != null).append("\n");
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    assert time.getRank() == 1;
    assert time.getSize() == nagg;
    assert time.getShape()[0] == nagg;
    assert time.getDataType() == DataType.DOUBLE;

    DateFormatter formatter = new DateFormatter();
    try {
      Array data = time.read();
      assert data.getRank() == 1;
      assert data.getSize() == nagg;
      assert data.getShape()[0] == nagg;
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    List<String> gridList = new ArrayList<String>();
    gridList.add("RH");
    gridList.add("T");

    DateFormatter format = new DateFormatter();
    Date start = format.isoDateTimeFormat("2005-12-06T18:00:00Z");
    Date end = format.isoDateTimeFormat("2005-12-07T18:00:00Z");

    writer.makeFile(fileOut, gds, gridList,
            new LatLonRect(new LatLonPointImpl(37, -109), 400, 7),
            new DateRange(start, end),
            true,
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    assert time.getDataType() == DataType.DOUBLE || time.getDataType() == DataType.INT;

    String units = time.getUnitsString();
    DateUnit du = new DateUnit( units);

    DateFormatter formatter = new DateFormatter();
    Array data = time.read();
    if (true) {
      PrintWriter pw = new PrintWriter(System.out);
      NCdumpW.printArray(data, "timeCoords", pw, null);
      pw.flush();
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    NetcdfCFWriter writer = new NetcdfCFWriter();

    List<String> gridList = new ArrayList<String>();
    gridList.add("Z_sfc");

    DateFormatter format = new DateFormatter();
    Date start = format.isoDateTimeFormat("2003-06-01T03:00:00Z");
    Date end = format.isoDateTimeFormat("2004-01-01T00:00:00Z");

    writer.makeFile(fileOut, gds, gridList, null,
            // new LatLonRect(new LatLonPointImpl(30, -109), 10, 50),
            new DateRange(start, end),
            true,
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    if (ncfile == null) return null;
    return ncfile.findGlobalAttributeIgnoreCase( name);
  }

  public void getDetailInfo( java.util.Formatter sf) {
    DateFormatter formatter = new DateFormatter();

    sf.format("FeatureDataset on location= %s\n", getLocation());
    sf.format("  featureType= %s\n",getFeatureType());
    sf.format("  title= %s\n",getTitle());
    sf.format("  desc= %s\n",getDescription());
    sf.format("  range= %s\n",getDateRange());
    sf.format("  start= %s\n", formatter.toDateTimeString(getStartDate()));
    sf.format("  end  = %s\n",formatter.toDateTimeString(getEndDate()));
    LatLonRect bb = getBoundingBox();
    sf.format("  bb   = %s\n", bb);
    if (bb != null)
      sf.format("  bb   = %s\n",getBoundingBox().toString2());
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

        //log.error("GridDatasetInv missing rundate in file=" + location);
        //throw new IllegalArgumentException("File must have " + _Coordinate.ModelBaseDate + " or " + _Coordinate.ModelRunDate + " attribute ");
      }
    }

    DateFormatter df = new DateFormatter();
    this.runTime = df.toDateTimeStringISO(this.runDate);

    // add each variable, collect unique time and vertical axes
    for (GridDatatype gg : gds.getGrids()) {
      GridCoordSystem gcs = gg.getCoordinateSystem();
      Grid grid = new Grid(gg.getFullName());
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    Element rootElem = new Element("gridInventory");
    Document doc = new Document(rootElem);
    rootElem.setAttribute("location", location);
    rootElem.setAttribute("runTime", runTime);
    if (lastModified != null) {
      DateFormatter df = new DateFormatter();
      rootElem.setAttribute("lastModified", df.toDateTimeString(lastModified));
    }
    rootElem.setAttribute("version", Integer.toString(CURR_VERSION));

    // list all the vertical coords
    Collections.sort(vaxes);
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.