ucar.grib
Class GribPds

java.lang.Object
  extended by ucar.grib.GribPds
Direct Known Subclasses:
Grib1Pds, Grib2Pds

public abstract class GribPds
extends Object

Grib1 and Grib 2 PDS superclass. Try to abstract the common fields. This is fairly low-level, corresponding to the actual values in the file. Meaning often depends if its GRIB1 or GRIB2 GridRecord translates these into values that are file type independdednt.

Since:
Aug 4, 2010
Author:
caron

Field Summary
protected  byte[] input
           
 
Constructor Summary
GribPds()
           
 
Method Summary
static GribPds factory(int edition, byte[] raw, long baseTime, Calendar cal)
           
abstract  Date getForecastDate()
          Forecast time as a Date
abstract  int getForecastTime()
          Forecast time in units defined by getTimeUnit()) from getReferenceTime()
abstract  int[] getForecastTimeInterval()
          Get the time interval of the forecast.
abstract  int[] getForecastTimeInterval(int wantUnit)
           
abstract  int getGenProcessId()
           
abstract  long getIntervalTimeEnd()
          Grib-2 encodes an "end of overall time interval" .
abstract  int getLevelType1()
          Get the type for the first level
abstract  int getLevelType2()
          Get the type for the second level
abstract  double getLevelValue1()
          Get the first level value
abstract  double getLevelValue2()
          Get the second level
abstract  int getNumberEnsembleForecasts()
           
 int getOctet(int index)
          Get the indexth byte in the PDS as an integer.
abstract  int getParameterNumber()
          Parameter number
 byte[] getPDSBytes()
          PDS as byte[]
abstract  int getPercentileValue()
           
abstract  int getPerturbationNumber()
           
abstract  int getPerturbationType()
           
abstract  double getProbabilityLowerLimit()
           
abstract  int getProbabilityType()
           
abstract  double getProbabilityUpperLimit()
           
 Date getReferenceDate()
          Reference time as a Date
abstract  long getReferenceTime()
          Reference time as a long millis.
abstract  int getStatisticalProcessType()
          Get Grib-2 Interval Statistic Type code, only valid if isInterval()
abstract  int getTimeUnit()
          Time Unit code
abstract  boolean isEnsemble()
           
abstract  boolean isEnsembleDerived()
           
abstract  boolean isInterval()
          Is this a time interval.
abstract  boolean isPercentile()
           
abstract  boolean isProbability()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected byte[] input
Constructor Detail

GribPds

public GribPds()
Method Detail

factory

public static GribPds factory(int edition,
                              byte[] raw,
                              long baseTime,
                              Calendar cal)
                       throws IOException
Throws:
IOException

getPDSBytes

public byte[] getPDSBytes()
PDS as byte[]

Returns:
PDS as byte[]

getOctet

public final int getOctet(int index)
Get the indexth byte in the PDS as an integer. THIS IS ONE BASED (not zero) to correspond with the manual

Parameters:
index - 1 based index
Returns:
input[index-1] & 0xff

getParameterNumber

public abstract int getParameterNumber()
Parameter number

Returns:
Parameter number

getLevelValue1

public abstract double getLevelValue1()
Get the first level value

Returns:
the first level value

getLevelValue2

public abstract double getLevelValue2()
Get the second level

Returns:
the second level value

getLevelType1

public abstract int getLevelType1()
Get the type for the first level

Returns:
level type

getLevelType2

public abstract int getLevelType2()
Get the type for the second level

Returns:
level type

getTimeUnit

public abstract int getTimeUnit()
Time Unit code

Returns:
Time Unit code

getForecastTime

public abstract int getForecastTime()
Forecast time in units defined by getTimeUnit()) from getReferenceTime()

Returns:
Forecast time

getForecastDate

public abstract Date getForecastDate()
Forecast time as a Date

Returns:
Forecast Date

getReferenceTime

public abstract long getReferenceTime()
Reference time as a long millis.

Returns:
refTime

getReferenceDate

public final Date getReferenceDate()
Reference time as a Date

Returns:
Reference Date

isInterval

public abstract boolean isInterval()
Is this a time interval. If so, then coordinate is a range [min, max]. Otherwise coord is assumed to be a point (instance) in time.

Returns:
if time interval

getStatisticalProcessType

public abstract int getStatisticalProcessType()
Get Grib-2 Interval Statistic Type code, only valid if isInterval()

Returns:
Grib-2 Interval Statistic Type (Table 4-10), or < 0 is none

getIntervalTimeEnd

public abstract long getIntervalTimeEnd()
Grib-2 encodes an "end of overall time interval" . Grib-1 return < 0.

Returns:
end of overall time interval

getForecastTimeInterval

public abstract int[] getForecastTimeInterval()
Get the time interval of the forecast.

Returns:
interval as int[2], or null if not isInterval()

getForecastTimeInterval

public abstract int[] getForecastTimeInterval(int wantUnit)

getGenProcessId

public abstract int getGenProcessId()

isEnsemble

public abstract boolean isEnsemble()

getPerturbationNumber

public abstract int getPerturbationNumber()

getPerturbationType

public abstract int getPerturbationType()

isEnsembleDerived

public abstract boolean isEnsembleDerived()

getNumberEnsembleForecasts

public abstract int getNumberEnsembleForecasts()

isProbability

public abstract boolean isProbability()

getProbabilityLowerLimit

public abstract double getProbabilityLowerLimit()

getProbabilityUpperLimit

public abstract double getProbabilityUpperLimit()

getProbabilityType

public abstract int getProbabilityType()

isPercentile

public abstract boolean isPercentile()

getPercentileValue

public abstract int getPercentileValue()


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.