Package ucar.grib.grib2

Examples of ucar.grib.grib2.Grib2GDSVariables


    if (firstRecord instanceof GribGridRecord) {
      GribGridRecord ggr = (GribGridRecord) firstRecord;

      if (ggr.getEdition() == 2) {
        Grib2Pds pds2 = (Grib2Pds) ggr.getPds();
        String useGenType = pds2.getUseGenProcessType();
        if (useGenType != null)
          f.format("_%s", useGenType);
      }

      String suffixName = ggr.makeSuffix( );
View Full Code Here


  }

  private GridParameter getParameter() {
    GridParameter p = null;
      if (edition == 2) {
        Grib2Pds pds2 = (Grib2Pds) pds;
        p = ParameterTable.getParameter(discipline, pds2.getParameterCategory(), pds.getParameterNumber());

      } else {
        GribPDSParamTable pt = null;
        try {
          pt = GribPDSParamTable.getParameterTable(center, subCenter, tableVersion);
View Full Code Here

        result += result * 37 + getParameterName().hashCode();
        String statName = getStatisticalProcessTypeNameShort();
        if (statName != null) result += result * 37 + statName.hashCode();

      } else {
        Grib2Pds pds2 = (Grib2Pds) pds;
        int productTemplate = pds2.getProductDefinitionTemplate();

        result += result * 37 + discipline;
        result += result * 37 + getLevelType1();
        result += result * 37 + pds2.getParameterCategory();
        result += result * 37 + productTemplate;
        String statName = getStatisticalProcessTypeNameShort();
        if (statName != null) result += result * 37 + statName.hashCode();

        result += result * 37 +  getLevelType2(); // ??
        result += result * 37 + pds2.getParameterNumber();
        String useGenType = pds2.getUseGenProcessType();
        if (useGenType != null) result += result * 37 + useGenType.hashCode();

        if (pds2.isEnsembleDerived()) {
          Grib2Pds.PdsEnsembleDerived pdsDerived = (Grib2Pds.PdsEnsembleDerived) pds2;
          result += result * 37 + pdsDerived.getDerivedForecastType(); // derived type (table 4.7)

        } else if (pds2.isEnsemble()) {
          result += result * 37 + 1;
        }

        if (pds2.isProbability()) {
          Grib2Pds.PdsProbability pdsProb = (Grib2Pds.PdsProbability) pds2;
          String name = getProbabilityVariableNameSuffix(pdsProb.getProbabilityLowerLimit(), pdsProb.getProbabilityUpperLimit(), pdsProb.getProbabilityType());
          result +=  result * 37 + name.hashCode();
        }
      }
View Full Code Here

    Formatter f = new Formatter();
    String desc = getParameterDescription();
    f.format("%s", desc);

    if (edition == 2) {
      Grib2Pds pds2 = (Grib2Pds) pds;
      String useGenType = pds2.getUseGenProcessType();
      if (useGenType != null)
        f.format("_%s", useGenType);
    }

    if (useLevel) {
View Full Code Here

       f.format("_%s", statName);
       disambig = true;
    }

    if (edition == 2) {
       Grib2Pds pds2 = (Grib2Pds) pds;

       if (pds2.isEnsembleDerived()) {
         Grib2Pds.PdsEnsembleDerived pdsDerived = (Grib2Pds.PdsEnsembleDerived) pds2;
         int type = pdsDerived.getDerivedForecastType(); // derived type (table 4.7)
         f.format("_%s", Grib2Tables.codeTable4_7short(type));
         disambig = true;

       } else if (pds2.isProbability()) {
         Grib2Pds.PdsProbability pdsProb = (Grib2Pds.PdsProbability) pds2;
         String name = getProbabilityVariableNameSuffix(pdsProb.getProbabilityLowerLimit(), pdsProb.getProbabilityUpperLimit(), pdsProb.getProbabilityType());
         f.format("_%s", name);
         disambig = true;
       }
View Full Code Here

    List<GridRecord> grList = index.getGridRecords();
    for (GridRecord gr : grList) {
      GribGridRecord ggr = (GribGridRecord) gr;
      int genType = ggr.getPds().getGenProcessId();
      if (!isGrib1) {
        Grib2Pds pds =  (Grib2Pds) ggr.getPds();
        genType = pds.getGenProcessType();
      }
      List<String> uses = map.get(genType);
      if (uses == null) {
        uses = new ArrayList<String>();
        map.put(genType, uses);
View Full Code Here

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

      Grib2Pds pds = (Grib2Pds) ggr.getPds();
      Grib2Pds.PdsInterval pdsIntv = (Grib2Pds.PdsInterval) pds;
      for (Grib2Pds.TimeInterval intv : pdsIntv.getTimeIntervals()) {
        int val = intv.timeIncrementType;
        List<String> uses = map.get(val);
        if (uses == null) {
View Full Code Here

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

      Grib2Pds pds = (Grib2Pds) ggr.getPds();
      System.out.printf(" ref=%s fore=%s%n", df.toDateTimeStringISO(gr.getReferenceTime()), df.toDateTimeStringISO(pds.getForecastDate()));

      Grib2Pds.PdsInterval pdsIntv = (Grib2Pds.PdsInterval) pds;
      long timeEnd = pdsIntv.getIntervalTimeEnd();
      int[] intv = pds.getForecastTimeInterval();
      long startDate = Grib2Pds.makeDate(gr.getReferenceTime().getTime(), pds.getTimeUnit(), intv[0], cal);
      long endDate = Grib2Pds.makeDate(gr.getReferenceTime().getTime(), pds.getTimeUnit(), intv[1], cal);

      System.out.printf("  intv=[%s, %s] = [%d,%d]%n",  df.toDateTimeStringISO(new Date(startDate)),
              df.toDateTimeStringISO(new Date(endDate)), intv[0], intv[1]);
      System.out.printf("  timeEnd=%s", df.toDateTimeStringISO(new Date(timeEnd)));
View Full Code Here

    // params getProducts (implies  unique GDSs too), oneRecord
    g2i.scan(true, false);
    List<Grib2Product> products = g2i.getProducts();
    boolean passOne = true;
    for (int i = 0; i < products.size(); i++) {
      Grib2Product product = products.get(i);
      raf.seek(product.getPdsOffset());
      PdsReader2 pds = new PdsReader2(raf);
      Grib2Pds gpv = pds.pdsVars;
      if (passOne) {
        System.out.println(" Section = " + gpv.getSection());
        System.out.println(" Length = " + gpv.getLength());
View Full Code Here

    // params getProducts (implies  unique GDSs too), oneRecord
    g2i.scan(true, false);
    List<Grib2Product> products = g2i.getProducts();
    boolean passOne = true;
    for (int i = 0; i < products.size(); i++) {
      Grib2Product product = products.get(i);
      raf.seek(product.getGdsOffset());
      GdsReader2 gds = new GdsReader2(raf, true);
      Grib2GDSVariables gpv = gds.gdsVars;
      if (passOne) {
        System.out.println(" Section = " + gpv.getSection());
        System.out.println(" Length = " + gpv.getLength());
View Full Code Here

TOP

Related Classes of ucar.grib.grib2.Grib2GDSVariables

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.