ucar.grib.grib2
Class Grib2Pds

java.lang.Object
  extended by ucar.grib.GribPds
      extended by ucar.grib.grib2.Grib2Pds

@Immutable
public abstract class Grib2Pds
extends GribPds


Nested Class Summary
static interface Grib2Pds.PdsEnsemble
           
static interface Grib2Pds.PdsEnsembleDerived
           
static interface Grib2Pds.PdsInterval
           
static interface Grib2Pds.PdsPercentile
           
static interface Grib2Pds.PdsProbability
           
static class Grib2Pds.SatelliteBand
           
static class Grib2Pds.TimeInterval
           
 
Field Summary
protected  int[] intv
           
protected  long refTime
           
protected  int template
           
protected  long validTime
           
 
Fields inherited from class ucar.grib.GribPds
input
 
Constructor Summary
protected Grib2Pds(byte[] input, long refTime, Calendar cal)
          Constructs a Grib2PDSVariables object from a byte[].
 
Method Summary
protected  int _getForecastTime()
           
static Grib2Pds factory(byte[] input, long refTime, Calendar cal)
          Factory for Grib2Pds
 Date getForecastDate()
          Forecast time as a Date
 int getForecastTime()
          Forecast time in units defined by octet 18 (getTimeUnit())
 int[] getForecastTimeInterval()
          Time Interval for accumulation type variables.
 int[] getForecastTimeInterval(int wantUnit)
           
 int getGenProcessId()
          Forecast/Analysis generating process identifier (defined by originating centre).
 int getGenProcessType()
          Type of Generating Process (Code Table 4.3)
 long getIntervalTimeEnd()
          Grib-2 encodes an "end of overall time interval" .
 int getLength()
           
 int getNumberCoordinates()
          Number of coordinate values at end of template.
 int getNumberEnsembleForecasts()
           
 int getParameterCategory()
          Parameter Category
 int getParameterNumber()
          Parameter Number
 int getPercentileValue()
           
 int getPerturbationNumber()
           
 int getPerturbationType()
           
 double getProbabilityLowerLimit()
           
 int getProbabilityType()
           
 double getProbabilityUpperLimit()
           
 int getProductDefinitionTemplate()
          product Definition template, Table 4.0
 long getReferenceTime()
          Reference time as a long millis.
 int getSection()
          Number of this section, should be 4.
 int getStatisticalProcessType()
          Get Grib-2 Interval Statistic Type code, only valid if isInterval()
 String getUseGenProcessType()
           
 boolean isEnsemble()
           
 boolean isEnsembleDerived()
           
 boolean isInterval()
          Is this a time interval.
 boolean isPercentile()
           
 boolean isProbability()
           
static long makeDate(long refTime, int timeUnit, int forecastTime, Calendar cal)
           
static int makeForecastTime(long refTime, long foreDate, int timeUnit)
           
 void show(Formatter f)
           
 
Methods inherited from class ucar.grib.GribPds
factory, getLevelType1, getLevelType2, getLevelValue1, getLevelValue2, getOctet, getPDSBytes, getReferenceDate, getTimeUnit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

template

protected final int template

refTime

protected final long refTime

validTime

protected long validTime

intv

protected int[] intv
Constructor Detail

Grib2Pds

protected Grib2Pds(byte[] input,
                   long refTime,
                   Calendar cal)
            throws IOException
Constructs a Grib2PDSVariables object from a byte[].

Parameters:
input - PDS
refTime - reference time in msecs
cal - helper for creating Dates
Throws:
IOException - if raf contains no valid GRIB file
Method Detail

factory

public static Grib2Pds factory(byte[] input,
                               long refTime,
                               Calendar cal)
                        throws IOException
Factory for Grib2Pds

Parameters:
input - raw bytes
refTime - reference time in msecs
cal - helper object
Returns:
Grib2Pds or null on error
Throws:
IOException - on read error

makeDate

public static long makeDate(long refTime,
                            int timeUnit,
                            int forecastTime,
                            Calendar cal)

makeForecastTime

public static int makeForecastTime(long refTime,
                                   long foreDate,
                                   int timeUnit)

getReferenceTime

public long getReferenceTime()
Description copied from class: GribPds
Reference time as a long millis.

Specified by:
getReferenceTime in class GribPds
Returns:
refTime

getLength

public final int getLength()

getSection

public final int getSection()
Number of this section, should be 4.


getNumberCoordinates

public final int getNumberCoordinates()
Number of coordinate values at end of template.

Returns:
Coordinates number

getProductDefinitionTemplate

public final int getProductDefinitionTemplate()
product Definition template, Table 4.0

Returns:
ProductDefinition

getParameterCategory

public final int getParameterCategory()
Parameter Category

Returns:
parameterCategory as int

getParameterNumber

public final int getParameterNumber()
Parameter Number

Specified by:
getParameterNumber in class GribPds
Returns:
ParameterNumber

getGenProcessType

public int getGenProcessType()
Type of Generating Process (Code Table 4.3)

Returns:
Type of Generating Process

getUseGenProcessType

public String getUseGenProcessType()

getForecastDate

public Date getForecastDate()
Description copied from class: GribPds
Forecast time as a Date

Specified by:
getForecastDate in class GribPds
Returns:
Forecast Date

getGenProcessId

public int getGenProcessId()
Forecast/Analysis generating process identifier (defined by originating centre).

For NCEP, apparently http://www.nco.ncep.noaa.gov/pmb/docs/on388/tablea.html as linked from here: http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp4-0.shtml

Specified by:
getGenProcessId in class GribPds
Returns:
generating process id

isInterval

public boolean isInterval()
Description copied from class: GribPds
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.

Specified by:
isInterval in class GribPds
Returns:
if time interval

getStatisticalProcessType

public int getStatisticalProcessType()
Description copied from class: GribPds
Get Grib-2 Interval Statistic Type code, only valid if isInterval()

Specified by:
getStatisticalProcessType in class GribPds
Returns:
Grib-2 Interval Statistic Type (Table 4-10), or < 0 is none

getIntervalTimeEnd

public long getIntervalTimeEnd()
Description copied from class: GribPds
Grib-2 encodes an "end of overall time interval" . Grib-1 return < 0.

Specified by:
getIntervalTimeEnd in class GribPds
Returns:
end of overall time interval

getForecastTime

public int getForecastTime()
Forecast time in units defined by octet 18 (getTimeUnit())

Specified by:
getForecastTime in class GribPds
Returns:
Forecast time

getForecastTimeInterval

public int[] getForecastTimeInterval()
Time Interval for accumulation type variables. Forecast Time is always at the end.

Specified by:
getForecastTimeInterval in class GribPds
Returns:
TimeInterval int[2] = start, end of interval in units of getTimeUnit()

getForecastTimeInterval

public int[] getForecastTimeInterval(int wantUnit)
Specified by:
getForecastTimeInterval in class GribPds

_getForecastTime

protected int _getForecastTime()

isEnsemble

public boolean isEnsemble()
Specified by:
isEnsemble in class GribPds

getPerturbationNumber

public int getPerturbationNumber()
Specified by:
getPerturbationNumber in class GribPds

getPerturbationType

public int getPerturbationType()
Specified by:
getPerturbationType in class GribPds

isEnsembleDerived

public boolean isEnsembleDerived()
Specified by:
isEnsembleDerived in class GribPds

getNumberEnsembleForecasts

public int getNumberEnsembleForecasts()
Specified by:
getNumberEnsembleForecasts in class GribPds

isProbability

public boolean isProbability()
Specified by:
isProbability in class GribPds

getProbabilityLowerLimit

public double getProbabilityLowerLimit()
Specified by:
getProbabilityLowerLimit in class GribPds

getProbabilityUpperLimit

public double getProbabilityUpperLimit()
Specified by:
getProbabilityUpperLimit in class GribPds

getProbabilityType

public int getProbabilityType()
Specified by:
getProbabilityType in class GribPds

isPercentile

public boolean isPercentile()
Specified by:
isPercentile in class GribPds

getPercentileValue

public int getPercentileValue()
Specified by:
getPercentileValue in class GribPds

show

public void show(Formatter f)


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