Examples of Grib1GDSVariables


Examples of ucar.grib.grib1.Grib1GDSVariables

   * check for Sigma Pressure Levels
   */

  boolean checkForPressureLevels( List<GridRecord> records, GridHorizCoordSys hcs ) {
      GridDefRecord gdr = hcs.getGds();
      Grib1GDSVariables g1dr = (Grib1GDSVariables) gdr.getGdsv();
      if( g1dr == null || ! g1dr.hasVerticalPressureLevels() )
        return false;

      // add hybrid numbers
      coordValues = new double[ levels.size()];
        for (int i = 0; i < levels.size(); i++ ) {
          LevelCoord lc = levels.get( i );
          coordValues[ i ] =   lc.value1  ;
        }
      int NV = g1dr.getNV();
      // add new variables
      if NV > 2 && NV < 255 ) { // Some data doesn't add Pressure Level values
         factors = g1dr.getVerticalPressureLevels();
      }
      return true;
  }
View Full Code Here

Examples of ucar.grib.grib1.Grib1GDSVariables

        dis.read(gdsData);
        if (grid_edition_2) {
          Grib2GDSVariables gdsv = new Grib2GDSVariables(gdsData);
          gdsMap.put(Integer.toString(gdsv.getGdsKey()), gdsv);
        } else {
          Grib1GDSVariables gdsv = new Grib1GDSVariables(gdsData);
          gdsMap.put(Integer.toString(gdsv.getGdsKey()), gdsv);
        }
      }
    } finally {
      if (dis != null)
        dis.close();
View Full Code Here

Examples of ucar.grib.grib1.Grib1GDSVariables

          byte[] gdsData = new byte[gdsSize];
          dis.readFully(gdsData);

          int gdskey;
          if (grid_edition_1) {
            Grib1GDSVariables gdsv = new Grib1GDSVariables(gdsData);
            GribGridDefRecord ggdr = new GribGridDefRecord(gdsv);
            if (index_version.startsWith("8.0")) {
              gdskey = gdsv.get80TypeGdsKey();
            } else {
              gdskey = gdsv.getGdsKey();
            }
            populateGDS1(ggdr, gdsv, gdskey);
            gridIndex.addHorizCoordSys(ggdr);
            //System.out.println("GDS length =" + gdsv.getLength());
            //System.out.println("GDS GdsKey =" + gdsv.getOldTypeGdsKey());
          } else {
            Grib2GDSVariables gdsv = new Grib2GDSVariables(gdsData);
            GribGridDefRecord ggdr = new GribGridDefRecord(gdsv);
            if (index_version.startsWith("8.0")) {
              gdskey = gdsv.get80TypeGdsKey();
            } else {
              gdskey = gdsv.getGdsKey(); // version higher than 8.0
            }
            populateGDS2(ggdr, gdsv, gdskey);
            gridIndex.addHorizCoordSys(ggdr);
            //System.out.println("GDS length =" + gdsv.getLength());
            //System.out.println("GDS GdsKey =" + gdsv.getGdsKey());
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.