Unidata / thredds

THREDDS Data Server v4.6
https://www.unidata.ucar.edu/software/tds/v4.6/index.html
265 stars 179 forks source link

GRIB MRUTC should remove missing records #584

Open JohnLCaron opened 8 years ago

JohnLCaron commented 8 years ago

GribCollectionBuilder determines that allTimesAreUnique, so makes MRUTC which flattens into a 1D coord.

But some cases have missing data, and the coordinates include all coords runtime x times, which are not necessarly unique.

Should just use the unique coords.

JohnLCaron commented 8 years ago

TestCoordinatesMatchGbxtestNonUniqueTimeCoordsProblem

  /*
   time intervals =
   discontiguous values (240)=
   (0.000000,1.000000) (0.000000,6.000000) (6.000000,12.000000) (12.000000,18.000000) (18.000000,24.000000) (1.000000,2.000000)
   (1.000000,7.000000) (7.000000,13.000000) (13.000000,19.000000) (19.000000,25.000000) (2.000000,3.000000) (2.000000,8.000000)
   (8.000000,14.000000) (14.000000,20.000000) (20.000000,26.000000) (3.000000,4.000000) (3.000000,9.000000) (9.000000,15.000000)
   (15.000000,21.000000) (21.000000,27.000000) (4.000000,5.000000) (4.000000,10.000000) (10.000000,16.000000) (16.000000,22.000000)
   (22.000000,28.000000) (5.000000,6.000000) (5.000000,11.000000) (11.000000,17.000000) (17.000000,23.000000) (23.000000,29.000000)
   (6.000000,7.000000) (6.000000,12.000000) (12.000000,18.000000) (18.000000,24.000000) (24.000000,30.000000) (7.000000,8.000000)
   (7.000000,13.000000) (13.000000,19.000000) (19.000000,25.000000) (25.000000,31.000000) (8.000000,9.000000) (8.000000,14.000000)
   (14.000000,20.000000) (20.000000,26.000000) (26.000000,32.000000) (9.000000,10.000000) (9.000000,15.000000) (15.000000,21.000000)
   (21.000000,27.000000) (27.000000,33.000000) (10.000000,11.000000) (10.000000,16.000000) (16.000000,22.000000) (22.000000,28.000000)
   (28.000000,34.000000) (11.000000,12.000000) (11.000000,17.000000) (17.000000,23.000000) (23.000000,29.000000) (29.000000,35.000000)
   (12.000000,13.000000) (12.000000,18.000000) (18.000000,24.000000) (24.000000,30.000000) (30.000000,36.000000) (13.000000,14.000000)
   (13.000000,19.000000) (19.000000,25.000000) (25.000000,31.000000) (31.000000,37.000000) (14.000000,15.000000) (14.000000,20.000000) (
   (20.000000,26.000000) (26.000000,32.000000) (32.000000,38.000000) (15.000000,16.000000) (15.000000,21.000000) (21.000000,27.000000)
   (27.000000,33.000000) (33.000000,39.000000) (16.000000,17.000000) (16.000000,22.000000) (22.000000,28.000000) (28.000000,34.000000)
   (34.000000,40.000000) (17.000000,18.000000) (17.000000,23.000000) (23.000000,29.000000) (29.000000,35.000000) (35.000000,41.000000)
   (18.000000,19.000000) (18.000000,24.000000) (24.000000,30.000000) (30.000000,36.000000) (36.000000,42.000000) (19.000000,20.000000)
   (19.000000,25.000000) (25.000000,31.000000) (31.000000,37.000000) (37.000000,43.000000) (20.000000,21.000000) (20.000000,26.000000)
   (26.000000,32.000000) (32.000000,38.000000) (38.000000,44.000000) (21.000000,22.000000) (21.000000,27.000000) (27.000000,33.000000)
   (33.000000,39.000000) (39.000000,45.000000) (22.000000,23.000000) (22.000000,28.000000) (28.000000,34.000000) (34.000000,40.000000)
   (40.000000,46.000000) (23.000000,24.000000) (23.000000,29.000000) (29.000000,35.000000) (35.000000,41.000000) (41.000000,47.000000)
    (24, 30) repeated twice.
    Problem is the actual coords are unique (so made into a MRUTC) but we have:
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      XXXXX
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----
      X----

      should remove the missing records.
   */
  @Ignore("Overlapping time interval")
  public void testOverlappingIntervalProblem() throws IOException {
    ucar.nc2.util.Counters counters = GribCoordsMatchGbx.getCounters();
    String filename = TestDir.cdmUnitTestDir + "formats/grib1/QPE.20101005.009.157";
    GribCoordsMatchGbx helper = new GribCoordsMatchGbx(filename, counters);
    helper.readGridDataset();
    helper.readCoverageDataset();
    System.out.printf("counters= %s%n", counters);
  }