Package ucar.nc2.grib.grib1
Class Grib1SectionProductDefinition
- java.lang.Object
-
- ucar.nc2.grib.grib1.Grib1SectionProductDefinition
-
@Immutable public final class Grib1SectionProductDefinition extends Object
The Product Definition Section for GRIB-1 files
-
-
Constructor Summary
Constructors Constructor Description Grib1SectionProductDefinition(byte[] rawData)Set PDS section from byte array.Grib1SectionProductDefinition(ucar.unidata.io.RandomAccessFile raf)Read Product Definition section from raf.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbmsExists()Check if BMS exists from the flaglongcalcCRC()booleangdsExists()Check if GDS exists from the flag.intgetCenter()Center (octet 5) common code C-1.intgetDecimalScale()Units decimal scale factor (octet 27-28) .intgetFlag()Flag (octet 8).intgetGenProcess()Generating Process (octet 6).intgetGridDefinition()Grid Definition (octet 7).intgetLength()intgetLevelType()Level type (octet 10) - code table 3.intgetLevelValue1()Level value1 (octet 11).intgetLevelValue2()Level value2 (octet 12).intgetNincluded()Number included in statistics (octet 22-23).intgetNmissing()Number missing in statistics (octet 24).intgetParameterNumber()Parameter number (octet 9) - code table 2.intgetPerturbationNumber()intgetPerturbationType()byte[]getRawBytes()get the raw bytes of the PDS.intgetReferenceCentury()Century of reference (octet 25).ucar.nc2.time.CalendarDategetReferenceDate()Reference Date (octet 13-17).intgetSubCenter()Center (octet 26) common code C-12.intgetTableVersion()gets the Table version (octet 4).intgetTimeRangeIndicator()Time range indicator (octet 21) - code table 5.intgetTimeUnit()Time unit (octet 18) - code table 4.intgetTimeValue1()Time value 1 (octet 19).intgetTimeValue2()Time value 2 (octet 20).booleanisEnsemble()voidshowPds(Grib1Customizer cust, Formatter f)
-
-
-
Constructor Detail
-
Grib1SectionProductDefinition
public Grib1SectionProductDefinition(ucar.unidata.io.RandomAccessFile raf) throws IOExceptionRead Product Definition section from raf.- Parameters:
raf- RandomAccessFile, with pointer at start of section- Throws:
IOException- on I/O errorIllegalArgumentException- if not a GRIB-2 record
-
Grib1SectionProductDefinition
public Grib1SectionProductDefinition(byte[] rawData)
Set PDS section from byte array.- Parameters:
rawData- the byte array
-
-
Method Detail
-
getRawBytes
public byte[] getRawBytes()
get the raw bytes of the PDS.- Returns:
- PDS as byte[]
-
getLength
public int getLength()
-
getTableVersion
public final int getTableVersion()
gets the Table version (octet 4).- Returns:
- table version
-
getCenter
public final int getCenter()
Center (octet 5) common code C-1.- Returns:
- center id
-
getGenProcess
public final int getGenProcess()
Generating Process (octet 6).- Returns:
- typeGenProcess
-
getGridDefinition
public final int getGridDefinition()
Grid Definition (octet 7). "Number of grid used – from catalogue defined by originating centre". So this is center dependent. "Where octet 7 defines a catalogued grid, that grid should also be defined in Section 2, provided the flag in octet 8 indicates inclusion of Section 2. Octet 7 must be set to 255 to indicate a non-catalogued grid, in which case the grid will be defined in Section 2."- Returns:
- Grid Definition.
-
getFlag
public final int getFlag()
Flag (octet 8).- Returns:
- Flag
-
getParameterNumber
public final int getParameterNumber()
Parameter number (octet 9) - code table 2.- Returns:
- index number of parameter in table
-
getLevelType
public final int getLevelType()
Level type (octet 10) - code table 3.- Returns:
- level type
-
getLevelValue1
public final int getLevelValue1()
Level value1 (octet 11).- Returns:
- level value1
-
getLevelValue2
public final int getLevelValue2()
Level value2 (octet 12).- Returns:
- level value2
-
getReferenceDate
public final ucar.nc2.time.CalendarDate getReferenceDate()
Reference Date (octet 13-17). Reference time of data – date and time of start of averaging or accumulation period.- Returns:
- Reference Date as CalendarDate.
-
getTimeUnit
public final int getTimeUnit()
Time unit (octet 18) - code table 4. Same as GRIB2 Table 4.4- Returns:
- time unit
-
getTimeValue1
public final int getTimeValue1()
Time value 1 (octet 19). Period of time (number of time units) (0 for analyses or initialized analyses). Units of time given by octet 18- Returns:
- time value 1
-
getTimeValue2
public final int getTimeValue2()
Time value 2 (octet 20). Period of time (number of time units); or Time interval between successive analyses, initialized analyses or forecasts, undergoing averaging or accumulation. Units of time given by octet 18- Returns:
- time value 2
-
getTimeRangeIndicator
public final int getTimeRangeIndicator()
Time range indicator (octet 21) - code table 5.- Returns:
- Time range indicator
-
getNincluded
public final int getNincluded()
Number included in statistics (octet 22-23). Number included in calculation when octet 21 (Code table 5) refers to a statistical process, such as average or accumulation; otherwise set to zero- Returns:
- Number included in statistics
-
getNmissing
public final int getNmissing()
Number missing in statistics (octet 24). Number missing from calculation in case of statistical process- Returns:
- Number missing in statistics
-
getReferenceCentury
public final int getReferenceCentury()
Century of reference (octet 25).- Returns:
- Century of reference
-
getSubCenter
public final int getSubCenter()
Center (octet 26) common code C-12.- Returns:
- subcenter id
-
getDecimalScale
public final int getDecimalScale()
Units decimal scale factor (octet 27-28) .- Returns:
- Units decimal scale factor
-
gdsExists
public final boolean gdsExists()
Check if GDS exists from the flag.- Returns:
- true, if GDS exists
-
bmsExists
public final boolean bmsExists()
Check if BMS exists from the flag- Returns:
- true, if BMS exists
-
showPds
public void showPds(Grib1Customizer cust, Formatter f)
-
isEnsemble
public boolean isEnsemble()
-
getPerturbationType
public final int getPerturbationType()
-
getPerturbationNumber
public final int getPerturbationNumber()
-
calcCRC
public long calcCRC()
-
-