Package ucar.nc2.grib.grib2
Class Grib2Pds
- java.lang.Object
-
- ucar.nc2.grib.grib2.Grib2Pds
-
@Immutable public abstract class Grib2Pds extends Object
Abstract superclass for GRIB2 PDS handling. Inner classes are specific to each template.- Since:
- 3/28/11
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Grib2Pds.PdsAerosol
static interface
Grib2Pds.PdsEnsemble
static interface
Grib2Pds.PdsEnsembleDerived
static interface
Grib2Pds.PdsInterval
static interface
Grib2Pds.PdsPercentile
static interface
Grib2Pds.PdsProbability
static interface
Grib2Pds.PdsSatellite
static interface
Grib2Pds.PdsSpatialInterval
static class
Grib2Pds.SatelliteBand
static class
Grib2Pds.TimeInterval
-
Constructor Summary
Constructors Modifier Constructor Description protected
Grib2Pds(byte[] input)
Constructs a Grib2PDSVariables object from a byte[].
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CalendarDate
calcTime(int startIndex)
static Grib2Pds
factory(int template, byte[] input)
Factory for Grib2Pdsint
getBackProcessId()
Get Background generating process identifier (defined by originating centre)int
getExtraCoordinatesCount()
Number of coordinate values at end of template.int
getForecastTime()
Forecast time in units of getTimeUnit() forecast time for points, should not be used for intervalsint
getGenProcessId()
Forecast/Analysis generating process identifier (defined by originating centre).int
getGenProcessType()
Type of Generating Process (Code Table 4.3)int
getInt4StartingAtOctet(int index)
int
getLevelScale1()
int
getLevelScale2()
int
getLevelType1()
int
getLevelType2()
double
getLevelValue1()
double
getLevelValue2()
int
getOctet(int index)
Get the index'th byte in the PDS as an unsigned integer.int
getOctetSigned(int index)
int
getParameterCategory()
Parameter Categoryint
getParameterNumber()
Parameter Numberint
getRawLength()
protected double
getScaledValue(int start)
int
getStatisticalProcessType()
int
getTemplateNumber()
product Definition template, Table 4.0abstract int
getTimeUnit()
Indicator of unit of time range (see Code table 4.4)boolean
isAerosol()
boolean
isEnsemble()
boolean
isEnsembleDerived()
boolean
isPercentile()
boolean
isProbability()
boolean
isSatellite()
boolean
isSpatialInterval()
boolean
isTimeInterval()
void
show(Formatter f)
abstract int
templateLength()
-
-
-
Method Detail
-
factory
@Nullable public static Grib2Pds factory(int template, byte[] input)
Factory for Grib2Pds- Parameters:
template
- pds template numberinput
- raw bytes- Returns:
- Grib2Pds or null on error
-
templateLength
public abstract int templateLength()
-
getExtraCoordinatesCount
public int getExtraCoordinatesCount()
Number of coordinate values at end of template.- Returns:
- Coordinates number
-
getTemplateNumber
public final int getTemplateNumber()
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- Returns:
- ParameterNumber
-
getGenProcessType
public int getGenProcessType()
Type of Generating Process (Code Table 4.3)- Returns:
- Type of Generating Process
-
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- Returns:
- generating process id
-
getBackProcessId
public int getBackProcessId()
Get Background generating process identifier (defined by originating centre)- Returns:
- Background generating process identifier
-
getTimeUnit
public abstract int getTimeUnit()
Indicator of unit of time range (see Code table 4.4)- Returns:
- unit of time range
-
getForecastTime
public int getForecastTime()
Forecast time in units of getTimeUnit() forecast time for points, should not be used for intervals- Returns:
- Forecast time
-
getLevelValue1
public double getLevelValue1()
-
getLevelScale1
public int getLevelScale1()
-
getLevelValue2
public double getLevelValue2()
-
getLevelType1
public int getLevelType1()
-
getLevelType2
public int getLevelType2()
-
getLevelScale2
public int getLevelScale2()
-
isAerosol
public boolean isAerosol()
-
isEnsemble
public boolean isEnsemble()
-
isEnsembleDerived
public boolean isEnsembleDerived()
-
isProbability
public boolean isProbability()
-
isTimeInterval
public boolean isTimeInterval()
-
isSpatialInterval
public boolean isSpatialInterval()
-
isSatellite
public boolean isSatellite()
-
isPercentile
public boolean isPercentile()
-
show
public void show(Formatter f)
-
getOctet
public final int getOctet(int index)
Get the index'th byte in the PDS as an unsigned integer. THIS IS ONE BASED (not zero) to correspond with the manual. Will throw Exception if index is out of bounds.- Parameters:
index
- 1 based index- Returns:
- input[index-1] & 0xff
-
getInt4StartingAtOctet
public final int getInt4StartingAtOctet(int index)
-
getOctetSigned
public final int getOctetSigned(int index)
-
getRawLength
public final int getRawLength()
-
getScaledValue
protected double getScaledValue(int start)
-
getStatisticalProcessType
public int getStatisticalProcessType()
-
calcTime
protected CalendarDate calcTime(int startIndex)
-
-