ucar.grib.grib1
Class Grib1PDSVariables

java.lang.Object
  extended by ucar.grib.grib1.Grib1PDSVariables
All Implemented Interfaces:
GribPDSVariablesIF

public final class Grib1PDSVariables
extends java.lang.Object
implements GribPDSVariablesIF

A class representing the product definition section (PDS) of a GRIB product. This is section 1 of a Grib record that contains information about the parameter


Constructor Summary
Grib1PDSVariables(byte[] input)
          Constructs Grib1PDSVariables from a byte[].
 
Method Summary
 boolean bmsExists()
          Check if BMS exists.
 boolean gdsExists()
          Check if GDS exists.
 int getAnalysisGenProcess()
          analysisGenProcess.
 int getAvgInclude()
          AvgInclude as int.
 int getAvgMissing()
          getAvgMissing as int.
 int getBackGenProcess()
          backGenProcess.
 java.util.Date getBaseTime()
          Get the base (analysis) time of the forecast.
 int getCenter()
          Center as int.
 int getChemicalType()
          ChemicalType.
 int getCoordinates()
          Number of this coordinates.
 int getDecimalScale()
          Get the exponent of the decimal scale used for all data values.
 float getEastLongitude()
          Eastern Longitude
 int getEcmwfClass()
          Class
 int getEnsembleNumber()
          Class
 int getExtension()
           
 int getForecastPercentile()
          ForecastPercentile.
 int getForecastProbability()
          ForecastProbability.
 int getForecastTime()
          Get the time of the forecast.
 int[] getForecastTimeInterval()
          Get the time interval of the forecast.
 int getGrid_Id()
          Grid ID as int.
 int getHoursAfter()
          hoursAfter.
 int getID()
          ID of ensemble
 int getInt(int index)
          Converts byte to int.
 int getIntervalStatType()
           
 int getLength()
           
 int[] getMembership()
          Membership
 int getMethod()
          Method
 int getMinutesAfter()
          minutesAfter.
 int getNB()
          Number Bands.
 float getNorthLatitude()
          Northern latitude
 int getNumberClusters()
          number Clusters
 int getNumberForecasts()
          number members / forecasts
 int getObservationProcess()
          ObservationProcess.
 int getOctet50()
          Octet 50
 int getOctet51()
          Octet 51
 int getOctet52()
          Octet 52
 int getP1()
          P1.
 int getP2()
          P2.
 int getParameterCategory()
          parameter Category .
 int getParameterNumber()
          Get the number of the parameter.
 byte[] getPDSBytes()
          PDS as byte[]
 int getPerturbation()
          Perturbation number
 int getProbabilityProduct()
          Product of ensemble
 int getProbabilityType()
          Product type of probability
 int getProductDefinition()
          ProductDefinition Since Grib1 doesn't have a Product Definition, use the ime range.
 int getProductID()
          Product of ensemble
 long getRefTime()
          gets reference time as a long millis.
 int getSection()
          Number PDS section .
 int getSizeClusters()
          size Clusters
 float getSouthLatitude()
          Southern latitude
 int getSpatialorProbability()
          Spatial Identifier or Probability of ensemble
 int getStream()
          Stream.
 int getSubCenter()
          SubCenter as int.
 int getTableVersion()
          gets the Table version as a int.
 int getTimeRange()
          TimeRange as int.
 java.lang.String getTimeRangeString()
          // TODO: move to Grib1GridTableLookup TimeRange as String.
 int getTimeRangeUnit()
          returns timeRangeUnit .
 int getType()
          type of ensemble
 int getTypeFirstFixedSurface()
          Get the numeric type for 1st level.
 int getTypeGenProcess()
          Process Id as int.
 int getTypeSecondFixedSurface()
          Get the numeric type for 2nd level.
 float getValueFirstFixedSurface()
          Get the numeric value for this level.
 float getValueLowerLimit()
          lower limit of probability
 float getValueSecondFixedSurface()
          Get value 2 (if it exists) for this level.
 float getValueUpperLimit()
          upper limit of probability
 float getWestLongitude()
          Western Longitude
 boolean isEnsemble()
          NCEP Appendix C Manual 388 states that if the PDS is > 28 bytes and octet 41 == 1 then it's ensemble an product.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grib1PDSVariables

public Grib1PDSVariables(byte[] input)
                  throws java.io.IOException
Constructs Grib1PDSVariables from a byte[].

Parameters:
input - PDS
Throws:
java.io.IOException - byte[] read
Method Detail

getPDSBytes

public byte[] getPDSBytes()
PDS as byte[]

Specified by:
getPDSBytes in interface GribPDSVariablesIF
Returns:
PDS bytes

getLength

public final int getLength()
Specified by:
getLength in interface GribPDSVariablesIF

getSection

public final int getSection()
Number PDS section .

Specified by:
getSection in interface GribPDSVariablesIF
Returns:
section number

getTableVersion

public final int getTableVersion()
gets the Table version as a int.

Returns:
table_version

getCenter

public final int getCenter()
Center as int.

Returns:
center_id

getTypeGenProcess

public final int getTypeGenProcess()
Process Id as int.

Specified by:
getTypeGenProcess in interface GribPDSVariablesIF
Returns:
typeGenProcess

getGrid_Id

public final int getGrid_Id()
Grid ID as int.

Returns:
grid_id

gdsExists

public final boolean gdsExists()
Check if GDS exists.

Returns:
true, if GDS exists

bmsExists

public final boolean bmsExists()
Check if BMS exists.

Returns:
true, if BMS exists

getParameterCategory

public final int getParameterCategory()
parameter Category .

Specified by:
getParameterCategory in interface GribPDSVariablesIF
Returns:
parameterCategory as int

getParameterNumber

public final int getParameterNumber()
Get the number of the parameter.

Specified by:
getParameterNumber in interface GribPDSVariablesIF
Returns:
index number of parameter in table

getTypeFirstFixedSurface

public final int getTypeFirstFixedSurface()
Get the numeric type for 1st level.

Specified by:
getTypeFirstFixedSurface in interface GribPDSVariablesIF
Returns:
type of level (height or pressure)

getValueFirstFixedSurface

public final float getValueFirstFixedSurface()
Get the numeric value for this level.

Specified by:
getValueFirstFixedSurface in interface GribPDSVariablesIF
Returns:
int level value

getTypeSecondFixedSurface

public final int getTypeSecondFixedSurface()
Get the numeric type for 2nd level.

Specified by:
getTypeSecondFixedSurface in interface GribPDSVariablesIF
Returns:
type of level always 255, Grib1 does't have type 2nd level

getValueSecondFixedSurface

public final float getValueSecondFixedSurface()
Get value 2 (if it exists) for this level.

Specified by:
getValueSecondFixedSurface in interface GribPDSVariablesIF
Returns:
int level value

getBaseTime

public final java.util.Date getBaseTime()
Get the base (analysis) time of the forecast.

Returns:
date of basetime

getRefTime

public final long getRefTime()
gets reference time as a long millis.

Returns:
refTime

getTimeRangeUnit

public final int getTimeRangeUnit()
Description copied from interface: GribPDSVariablesIF
returns timeRangeUnit .

Specified by:
getTimeRangeUnit in interface GribPDSVariablesIF
Returns:
int time unit index

getP1

public final int getP1()
P1.

Returns:
p1

getP2

public final int getP2()
P2.

Returns:
p2

getTimeRange

public final int getTimeRange()
TimeRange as int.

Returns:
timeRangeValue

getProductDefinition

public final int getProductDefinition()
ProductDefinition Since Grib1 doesn't have a Product Definition, use the ime range. This is subjective but works.

Specified by:
getProductDefinition in interface GribPDSVariablesIF
Returns:
ProductDefinition

getForecastTime

public final int getForecastTime()
Get the time of the forecast.

Specified by:
getForecastTime in interface GribPDSVariablesIF
Returns:
date and time

getForecastTimeInterval

public int[] getForecastTimeInterval()
Get the time interval of the forecast.

Returns:
interval as int[2]

getTimeRangeString

public final java.lang.String getTimeRangeString()
// TODO: move to Grib1GridTableLookup TimeRange as String.

Returns:
timeRange

getIntervalStatType

public int getIntervalStatType()

getAvgInclude

public final int getAvgInclude()
AvgInclude as int.

Returns:
AvgInclude

getAvgMissing

public final int getAvgMissing()
getAvgMissing as int.

Returns:
getAvgMissing

getSubCenter

public final int getSubCenter()
SubCenter as int.

Returns:
subCenter

getDecimalScale

public final int getDecimalScale()
Get the exponent of the decimal scale used for all data values.

Returns:
exponent of decimal scale

isEnsemble

public final boolean isEnsemble()
NCEP Appendix C Manual 388 states that if the PDS is > 28 bytes and octet 41 == 1 then it's ensemble an product.

Returns:

getExtension

public final int getExtension()

getType

public final int getType()
type of ensemble

Specified by:
getType in interface GribPDSVariablesIF
Returns:
type

getEcmwfClass

public final int getEcmwfClass()
Class

Returns:
Class

getID

public final int getID()
ID of ensemble

Returns:
ID

getStream

public final int getStream()
Stream.

Returns:
Stream.

getProductID

public final int getProductID()
Product of ensemble

Returns:
ID

getSpatialorProbability

public final int getSpatialorProbability()
Spatial Identifier or Probability of ensemble

Returns:
ID

getProbabilityProduct

public final int getProbabilityProduct()
Product of ensemble

Returns:
ID

getProbabilityType

public final int getProbabilityType()
Product type of probability

Returns:
ID

getOctet50

public final int getOctet50()
Octet 50

Returns:
int octet 50

getEnsembleNumber

public final int getEnsembleNumber()
Class

Returns:
Class

getOctet51

public final int getOctet51()
Octet 51

Returns:
int octet 51

getOctet52

public final int getOctet52()
Octet 52

Returns:
int octet 52

getValueLowerLimit

public final float getValueLowerLimit()
lower limit of probability

Specified by:
getValueLowerLimit in interface GribPDSVariablesIF
Returns:
ID

getValueUpperLimit

public final float getValueUpperLimit()
upper limit of probability

Specified by:
getValueUpperLimit in interface GribPDSVariablesIF
Returns:
ID

getNumberForecasts

public final int getNumberForecasts()
number members / forecasts

Specified by:
getNumberForecasts in interface GribPDSVariablesIF
Returns:
ID

getSizeClusters

public final int getSizeClusters()
size Clusters

Returns:
ID

getNumberClusters

public final int getNumberClusters()
number Clusters

Returns:
Number

getMethod

public final int getMethod()
Method

Returns:
Method

getNorthLatitude

public final float getNorthLatitude()
Northern latitude

Returns:
Northern latitude

getSouthLatitude

public final float getSouthLatitude()
Southern latitude

Returns:
Southern latitude

getEastLongitude

public final float getEastLongitude()
Eastern Longitude

Returns:
Eastern Longitude

getWestLongitude

public final float getWestLongitude()
Western Longitude

Returns:
Western Longitude

getMembership

public final int[] getMembership()
Membership

Returns:
Membership

getCoordinates

public final int getCoordinates()
Number of this coordinates.

Specified by:
getCoordinates in interface GribPDSVariablesIF
Returns:
Coordinates number

getChemicalType

public final int getChemicalType()
ChemicalType.

Specified by:
getChemicalType in interface GribPDSVariablesIF
Returns:
ChemicalType

getBackGenProcess

public final int getBackGenProcess()
backGenProcess.

Specified by:
getBackGenProcess in interface GribPDSVariablesIF
Returns:
BackGenProcess

getObservationProcess

public final int getObservationProcess()
ObservationProcess.

Specified by:
getObservationProcess in interface GribPDSVariablesIF
Returns:
ObservationProcess

getNB

public final int getNB()
Number Bands.

Specified by:
getNB in interface GribPDSVariablesIF
Returns:
NB

getAnalysisGenProcess

public final int getAnalysisGenProcess()
analysisGenProcess.

Specified by:
getAnalysisGenProcess in interface GribPDSVariablesIF
Returns:
analysisGenProcess

getHoursAfter

public final int getHoursAfter()
hoursAfter.

Specified by:
getHoursAfter in interface GribPDSVariablesIF
Returns:
HoursAfter

getMinutesAfter

public final int getMinutesAfter()
minutesAfter.

Specified by:
getMinutesAfter in interface GribPDSVariablesIF
Returns:
MinutesAfter

getForecastProbability

public final int getForecastProbability()
ForecastProbability.

Specified by:
getForecastProbability in interface GribPDSVariablesIF
Returns:
int ForecastProbability

getForecastPercentile

public final int getForecastPercentile()
ForecastPercentile.

Specified by:
getForecastPercentile in interface GribPDSVariablesIF
Returns:
int ForecastPercentile

getPerturbation

public final int getPerturbation()
Perturbation number

Specified by:
getPerturbation in interface GribPDSVariablesIF
Returns:
int Perturbation

getInt

public final int getInt(int index)
Converts byte to int.

Returns:
int byte as int