Package ucar.grib

Examples of ucar.grib.GribIndexReader


    ncfileBinary.close();
    ncfileText.close();
  }

  void compareIndexes(String fileBinary, String fileText) throws IOException {
    GridIndex giB = new GribIndexReader().open(fileBinary + ".gbx8");
    GridIndex giT = new GribIndexReader().open(fileText + ".gbx");

    // Coordinate systems
    List<GridDefRecord> hcsB = giB.getHorizCoordSys();
    List<GridDefRecord> hcsT = giT.getHorizCoordSys();
View Full Code Here


      System.out.println("Creating new test index " + args[1]);
      Grib2WriteIndex.main(args);
    } else {
      args[1] = dataPath + "ndfd.wmo"+ GribIndexName.currentSuffix;
      Grib2WriteIndex.main(args);
      GridIndex index1 = new GribIndexReader().open(args[1]);

      GridIndex index2 = new GribIndexReader().open(testPath + "ndfd.wmo"+ GribIndexName.currentSuffix);
      // Compare Indexes
      testEquals(index1, index2);
      f = new File(args[1]);
      f.delete();
    }
    //if (true )
    //  return;

    System.out.println("\nTesting indexing of AVN.5deg.wmo");
    args[0] = dataPath + "AVN.5deg.wmo";
    if (reset) {
      args[1] = testPath + "AVN.5deg.wmo"+ GribIndexName.currentSuffix;
      f = new File(args[1]);
      f.delete();
      System.out.println("Creating new test index " + args[1]);
      Grib2WriteIndex.main(args);
    } else {
      args[1] = dataPath + "AVN.5deg.wmo"+ GribIndexName.currentSuffix;
      Grib2WriteIndex.main(args);
      GridIndex index1 = new GribIndexReader().open(args[1]);

      GridIndex index2 = new GribIndexReader().open(testPath + "AVN.5deg.wmo"+ GribIndexName.currentSuffix);
      // Compare Indexes
      testEquals(index1, index2);
      f = new File(args[1]);
      f.delete();
    }


    System.out.println("\nTesting indexing of CLDGRIB2.2005040905");
    args[0] = dataPath + "CLDGRIB2.2005040905";
    if (reset) {
      args[1] = testPath + "CLDGRIB2.2005040905"+ GribIndexName.currentSuffix;
      f = new File(args[1]);
      f.delete();
      System.out.println("Creating new test index " + args[1]);
      Grib2WriteIndex.main(args);
    } else {
      args[1] = dataPath + "CLDGRIB2.2005040905"+ GribIndexName.currentSuffix;
      Grib2WriteIndex.main(args);
      GridIndex index1 = new GribIndexReader().open(args[1]);

      GridIndex index2 = new GribIndexReader().open(testPath + "CLDGRIB2.2005040905"+ GribIndexName.currentSuffix);
      // Compare Indexes
      testEquals(index1, index2);
      f = new File(args[1]);
      f.delete();
    }

    System.out.println("\nTesting indexing of Global_1p0deg_Ensemble.grib2");
    args[0] = dataPath + "Global_1p0deg_Ensemble.grib2";
    if (reset) {
      args[1] = testPath + "Global_1p0deg_Ensemble.grib2"+ GribIndexName.currentSuffix;
      f = new File(args[1]);
      f.delete();
      System.out.println("Creating new test index " + args[1]);
      Grib2WriteIndex.main(args);
    } else {
      args[1] = dataPath + "Global_1p0deg_Ensemble.grib2"+ GribIndexName.currentSuffix;
      Grib2WriteIndex.main(args);
      GridIndex index1 = new GribIndexReader().open(args[1]);

      GridIndex index2 = new GribIndexReader().open(testPath + "Global_1p0deg_Ensemble.grib2"+ GribIndexName.currentSuffix);
      // Compare Indexes
      testEquals(index1, index2);
      f = new File(args[1]);
      f.delete();
    }
View Full Code Here

TOP

Related Classes of ucar.grib.GribIndexReader

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.