Class 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
    • Field Detail

      • input

        protected final byte[] input
      • template

        protected final int template
    • Constructor Detail

      • Grib2Pds

        protected Grib2Pds​(byte[] input)
        Constructs a Grib2PDSVariables object from a byte[].
        Parameters:
        input - raw bytes
    • Method Detail

      • factory

        @Nullable
        public static Grib2Pds factory​(int template,
                                       byte[] input)
        Factory for Grib2Pds
        Parameters:
        template - pds template number
        input - 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()
      • 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)