Package ucar.grib

Examples of ucar.grib.GribPds


          if (!baseDate.equals(ref)) {
            log.warn(gr + " does not have same base date= " + baseDate + " != " + ref+ " for " + where);
            // continue; LOOK
          }

          GribPds pds = ggr.getPds();
          int[] timeInv = pds.getForecastTimeInterval(this.timeUnit);
          int start = timeInv[0];
          int end = timeInv[1];
          int intv2 = end - start;

          if (intv2 > 0) { // skip those weird zero-intervals when testing for constant interval
View Full Code Here


        Date ref = record.getReferenceTime();
        if (!baseDate.equals(ref))
          return false;

        GribGridRecord ggr = (GribGridRecord) record;
        GribPds pds = ggr.getPds();
        int[] timeInv = pds.getForecastTimeInterval(this.timeUnit);

        int start = timeInv[0];
        int end = timeInv[1];
        int intv2 = end - start;
        Date validTime = record.getValidTime();
View Full Code Here

      return times.indexOf(validTime);
    else {
      int index = 0;
      for (TimeCoordWithInterval t : timeIntvs) {
        GribGridRecord ggr = (GribGridRecord) record;  // only true for Grib     
        GribPds pds = ggr.getPds();
        int[] intv = pds.getForecastTimeInterval(timeUnit); // may need to convert units
        int diff = intv[1] - intv[0];
        if (t.coord.equals(validTime) && t.interval == diff) return index;
        index++;
      }
      return -1;
View Full Code Here

    Map<Integer, Product> pdsSet = new HashMap<Integer, Product>();

    List<GridRecord> grList = index.getGridRecords();
    for (GridRecord gr : grList) {
      GribGridRecord ggr = (GribGridRecord) gr;
      GribPds pds =  ggr.getPds();
      if (!pds.isInterval()) continue;

      //int startInterval = ggr.startOfInterval;
      //if ((startInterval == GribNumbers.UNDEFINED) || (startInterval == GribNumbers.MISSING)) continue;

      /* check valid time == base time + forecast
View Full Code Here

      List<GribGridRecord> runAccum = new ArrayList<GribGridRecord>(all.size());

      Set<Integer> ftimes = new HashSet<Integer>();

      for (GribGridRecord rb : all) {
        GribPds pds =  ggr.getPds();
        int ftime = pds.getForecastTime();
        ftimes.add(ftime);

        int[] intv = pds.getForecastTimeInterval();

        int start = intv[0];
        int end = intv[1];
        if (end - start == 1) hourAccum.add(rb);
        if (start == 0) runAccum.add(rb);
View Full Code Here


    private void showList(List<GribGridRecord> list, Formatter f) {
      f.format("(%d) ", list.size());
      for (GribGridRecord rb : list) {
        GribPds pds =  rb.getPds();
        int[] intv = pds.getForecastTimeInterval();
        f.format(" %d-%d", intv[0], intv[1]);
      }
      testConstantInterval(list, f);
    }
View Full Code Here

    private void testConstantInterval(List<GribGridRecord> list, Formatter f) {
      boolean same = true;
      int intv = -1;
      for (GribGridRecord rb : list) {
        GribPds pds =  rb.getPds();
        int[] interv = pds.getForecastTimeInterval();
        int start = interv[0];
        int end = interv[1];
        int intv2 = end - start;
        if (intv2 == 0) continue; // skip those weird zero-intervals
        else if (intv < 0) intv = intv2;
View Full Code Here

    private boolean testUniqueEndpoint(List<GribGridRecord> list, Formatter f) {
      boolean unique = true;
      HashSet<Integer> set = new HashSet<Integer>();
      for (GribGridRecord rb : list) {
        GribPds pds =  rb.getPds();
        int end = pds.getForecastTime();
        if (set.contains(end)) {
          unique = false;
          break;
        }
        set.add(end);
View Full Code Here

TOP

Related Classes of ucar.grib.GribPds

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.