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 interfaceGrib2Pds.PdsAerosolstatic interfaceGrib2Pds.PdsEnsemblestatic interfaceGrib2Pds.PdsEnsembleDerivedstatic interfaceGrib2Pds.PdsIntervalstatic interfaceGrib2Pds.PdsPercentilestatic interfaceGrib2Pds.PdsProbabilitystatic interfaceGrib2Pds.PdsSatellitestatic interfaceGrib2Pds.PdsSpatialIntervalstatic classGrib2Pds.SatelliteBandstatic classGrib2Pds.TimeInterval
-
Constructor Summary
Constructors Modifier Constructor Description protectedGrib2Pds(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 ucar.nc2.time.CalendarDatecalcTime(int startIndex)static Grib2Pdsfactory(int template, byte[] input)Factory for Grib2PdsintgetBackProcessId()Get Background generating process identifier (defined by originating centre)intgetExtraCoordinatesCount()Number of coordinate values at end of template.intgetForecastTime()Forecast time in units of getTimeUnit() forecast time for points, should not be used for intervalsintgetGenProcessId()Forecast/Analysis generating process identifier (defined by originating centre).intgetGenProcessType()Type of Generating Process (Code Table 4.3)intgetInt4StartingAtOctet(int index)intgetLevelScale1()intgetLevelScale2()intgetLevelType1()intgetLevelType2()doublegetLevelValue1()doublegetLevelValue2()intgetOctet(int index)Get the index'th byte in the PDS as an unsigned integer.intgetOctetSigned(int index)intgetParameterCategory()Parameter CategoryintgetParameterNumber()Parameter NumberintgetRawLength()protected doublegetScaledValue(int start)intgetStatisticalProcessType()intgetTemplateNumber()product Definition template, Table 4.0abstract intgetTimeUnit()Indicator of unit of time range (see Code table 4.4)booleanisAerosol()booleanisEnsemble()booleanisEnsembleDerived()booleanisPercentile()booleanisProbability()booleanisSatellite()booleanisSpatialInterval()booleanisTimeInterval()voidshow(Formatter f)abstract inttemplateLength()
-
-
-
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 ucar.nc2.time.CalendarDate calcTime(int startIndex)
-
-