ucar.grib.grib2
Class Grib2GDSVariables

java.lang.Object
  extended by ucar.grib.grib2.Grib2GDSVariables
All Implemented Interfaces:
GribGDSVariablesIF

public class Grib2GDSVariables
extends java.lang.Object
implements GribGDSVariablesIF

Representing the grid definition section (GDS) of a GRIB record as variables are extracted from a byte[]. This is section 3 of a Grib record that contains information about the grid


Field Summary
 
Fields inherited from interface ucar.grib.GribGDSVariablesIF
tenToNegSix, tenToNegThree, tenToSix, tenToThree
 
Constructor Summary
Grib2GDSVariables(byte[] input)
          Constructs a Grib2GDSVariables object from a byte[].
 
Method Summary
 int calculateNx()
          Gets the Maximum number of points in a parallel for Quasi/Thin grids
 float get80La1()
          octet 47-50.
 float get80Lo1()
          octet 51-54.
 int get80TypeGdsKey()
          gdsKey for version 8.0
 int getAngle()
          octet 61-64.
 int getBasicAngle()
          octet 39-42.
 float getDx()
          octet 64-67.
 float getDy()
          octet 68-71.
 float getEarthRadius()
          EarthRadius
 byte[] getGDSBytes()
          GDS as byte[]
 int getGdsKey()
          .
 int getGdtn()
          Get type of grid.
 java.lang.String getGridUnits()
          GridUnits
 int getInt(int index)
          Converts byte to int.
 int getIolon()
          octet 12 are extreme points in the quasi regular grid.
 float getLa1()
          octet 47-50.
 float getLa2()
          octet 56-59.
 float getLaD()
          octet 48-51.
 float getLap()
          octet 39-42.
 float getLatin1()
          octet 66-69.
 float getLatin2()
          octet 70-73.
 int getLength()
           
 float getLo1()
          octet 51-54.
 float getLo2()
          octet 60-63.
 float getLop()
          octet 43-46.
 float getLoV()
          octet 52-55.
 float getMajorAxis()
          MajorAxis
 float getMinorAxis()
          MinorAxis
 int getN()
          octet 61-62.
 int getNp()
          octet 68-71.
 float getNr()
          octet 69-72.
 int getNumberPoints()
          octets 7-10 number of data points .
 int getNx()
          octet 31-34.
 int getNy()
          octet 35-38.
 int getOlon()
          octet 11 olon > 0 is a quasi regular grid.
 int[] getParallels()
          Gets the number of points in each parallel for Quasi/Thin grids
 float getPoleLat()
          octet 85-88.
 float getPoleLon()
          octet 89-92.
 int getProjectionFlag()
          octet 64.
 int getResolution()
          octet 55.
 float getRotationAngle()
          octet 81-84.
 int getScaleFactorMajor()
          octet 21.
 int getScaleFactorMinor()
          octet 26.
 int getScaleFactorRadius()
          octet 16.
 int getScaleValueMajor()
          octet 22-25.
 int getScaleValueMinor()
          octet 27-30.
 int getScaleValueRadius()
          octet 17-20.
 int getScanMode()
          octet 72.
 int getSection()
          octet 5 Number of this section, should be 3.
 int getShape()
          octet 15.
 int getSource()
          octet 6 source of grid definition.
 float getSpLat()
          octet 73-76.
 float getSpLon()
          octet 77-80.
 float getStretchingFactor()
          octet 93-96.
 int getSubDivisions()
          octet 43-46.
 int getUnscaledLa1()
          octet 47-50.
 int getUnscaledLo1()
          octet 51-54.
 float getXo()
          octet 73-76.
 float getXp()
          octet 56-59.
 float getYo()
          octet 77-80.
 float getYp()
          octet 60-63.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grib2GDSVariables

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

Parameters:
input - PDS
Throws:
java.io.IOException - if raf contains no valid GRIB file
Method Detail

getGDSBytes

public byte[] getGDSBytes()
GDS as byte[]

Specified by:
getGDSBytes in interface GribGDSVariablesIF
Returns:
input as byte[]

getLength

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

getSection

public final int getSection()
octet 5 Number of this section, should be 3.

Specified by:
getSection in interface GribGDSVariablesIF
Returns:
section as int

getSource

public final int getSource()
octet 6 source of grid definition.

Specified by:
getSource in interface GribGDSVariablesIF
Returns:
source

getNumberPoints

public final int getNumberPoints()
octets 7-10 number of data points .

Specified by:
getNumberPoints in interface GribGDSVariablesIF
Returns:
numberPoints

getOlon

public final int getOlon()
octet 11 olon > 0 is a quasi regular grid.

Specified by:
getOlon in interface GribGDSVariablesIF
Returns:
olon

getIolon

public final int getIolon()
octet 12 are extreme points in the quasi regular grid.

Specified by:
getIolon in interface GribGDSVariablesIF
Returns:
iolon

getGdtn

public final int getGdtn()
Get type of grid.

Specified by:
getGdtn in interface GribGDSVariablesIF
Returns:
type of grid

getShape

public final int getShape()
octet 15.

Specified by:
getShape in interface GribGDSVariablesIF
Returns:
shape as a int

getScaleFactorRadius

public final int getScaleFactorRadius()
octet 16.

Returns:
scaleFactorRadius as a int

getScaleValueRadius

public final int getScaleValueRadius()
octet 17-20.

Returns:
scaleValueRadius as a int

getScaleFactorMajor

public final int getScaleFactorMajor()
octet 21.

Returns:
scaleFactorMajor as a int

getScaleValueMajor

public final int getScaleValueMajor()
octet 22-25.

Returns:
scaleValueMajor as a int

getScaleFactorMinor

public final int getScaleFactorMinor()
octet 26.

Returns:
scaleFactorMinor as a int

getScaleValueMinor

public final int getScaleValueMinor()
octet 27-30.

Returns:
scaleValueMinor as a int

getNx

public final int getNx()
octet 31-34.

Specified by:
getNx in interface GribGDSVariablesIF
Returns:
Number of points on x-axis or parallel as a int

getNy

public final int getNy()
octet 35-38.

Specified by:
getNy in interface GribGDSVariablesIF
Returns:
Number of points on y-axis or meridian as a int

getLap

public final float getLap()
octet 39-42.

Specified by:
getLap in interface GribGDSVariablesIF
Returns:
Lap as float

getLop

public final float getLop()
octet 43-46.

Specified by:
getLop in interface GribGDSVariablesIF
Returns:
Lop as float

getBasicAngle

public final int getBasicAngle()
octet 39-42.

Returns:
BasicAngle as a int

getSubDivisions

public final int getSubDivisions()
octet 43-46.

Specified by:
getSubDivisions in interface GribGDSVariablesIF
Returns:
SubDivisions as a int

getLa1

public final float getLa1()
octet 47-50.

Specified by:
getLa1 in interface GribGDSVariablesIF
Returns:
La1 as float

getUnscaledLa1

public final int getUnscaledLa1()
octet 47-50. Used in creating GdsKey from ints

Returns:
La1 as int

get80La1

public final float get80La1()
octet 47-50.

Returns:
La1 as float

getLo1

public final float getLo1()
octet 51-54.

Specified by:
getLo1 in interface GribGDSVariablesIF
Returns:
Lo1 as float

getUnscaledLo1

public final int getUnscaledLo1()
octet 51-54. used to create a gdsKey from ints

Returns:
Lo1 int

get80Lo1

public final float get80Lo1()
octet 51-54.

Returns:
Lo1 as float

getResolution

public final int getResolution()
octet 55.

Specified by:
getResolution in interface GribGDSVariablesIF
Returns:
Resolution as int

getLaD

public final float getLaD()
octet 48-51.

Specified by:
getLaD in interface GribGDSVariablesIF
Returns:
LaD as float

getLoV

public final float getLoV()
octet 52-55.

Specified by:
getLoV in interface GribGDSVariablesIF
Returns:
LoV as float

getLa2

public final float getLa2()
octet 56-59.

Specified by:
getLa2 in interface GribGDSVariablesIF
Returns:
La2 as float

getLo2

public final float getLo2()
octet 60-63.

Specified by:
getLo2 in interface GribGDSVariablesIF
Returns:
Lo2 as float

getDx

public final float getDx()
octet 64-67.

Specified by:
getDx in interface GribGDSVariablesIF
Returns:
Dx as float

getDy

public final float getDy()
octet 68-71.

Specified by:
getDy in interface GribGDSVariablesIF
Returns:
Dy as float

getXp

public final float getXp()
octet 56-59.

Specified by:
getXp in interface GribGDSVariablesIF
Returns:
Xp as float

getYp

public final float getYp()
octet 60-63.

Specified by:
getYp in interface GribGDSVariablesIF
Returns:
Yp as float

getNp

public final int getNp()
octet 68-71.

Specified by:
getNp in interface GribGDSVariablesIF
Returns:
Np as a int

getN

public final int getN()
octet 61-62.

Returns:
N as a int

getProjectionFlag

public final int getProjectionFlag()
octet 64.

Specified by:
getProjectionFlag in interface GribGDSVariablesIF
Returns:
ProjectionFlag as int

getScanMode

public final int getScanMode()
octet 72.

Specified by:
getScanMode in interface GribGDSVariablesIF
Returns:
ScanMode as int

getLatin1

public final float getLatin1()
octet 66-69.

Specified by:
getLatin1 in interface GribGDSVariablesIF
Returns:
Latin1 as float

getLatin2

public final float getLatin2()
octet 70-73.

Specified by:
getLatin2 in interface GribGDSVariablesIF
Returns:
Latin2 as float

getAngle

public final int getAngle()
octet 61-64.

Specified by:
getAngle in interface GribGDSVariablesIF
Returns:
Angle as float

getNr

public final float getNr()
octet 69-72.

Specified by:
getNr in interface GribGDSVariablesIF
Returns:
Nr as float

getXo

public final float getXo()
octet 73-76.

Specified by:
getXo in interface GribGDSVariablesIF
Returns:
Xo as float

getYo

public final float getYo()
octet 77-80.

Specified by:
getYo in interface GribGDSVariablesIF
Returns:
Yo as float

getSpLat

public final float getSpLat()
octet 73-76.

Specified by:
getSpLat in interface GribGDSVariablesIF
Returns:
SpLat as float

getSpLon

public final float getSpLon()
octet 77-80.

Specified by:
getSpLon in interface GribGDSVariablesIF
Returns:
SpLon as float

getRotationAngle

public final float getRotationAngle()
octet 81-84.

Specified by:
getRotationAngle in interface GribGDSVariablesIF
Returns:
RotationAngle as float

getPoleLat

public final float getPoleLat()
octet 85-88.

Specified by:
getPoleLat in interface GribGDSVariablesIF
Returns:
PoleLat as float

getPoleLon

public final float getPoleLon()
octet 89-92.

Specified by:
getPoleLon in interface GribGDSVariablesIF
Returns:
PoleLon as float

getStretchingFactor

public final float getStretchingFactor()
octet 93-96.

Specified by:
getStretchingFactor in interface GribGDSVariablesIF
Returns:
StretchingFactor as float

getMajorAxis

public final float getMajorAxis()
MajorAxis

Specified by:
getMajorAxis in interface GribGDSVariablesIF
Returns:
MajorAxis as float

getMinorAxis

public final float getMinorAxis()
MinorAxis

Specified by:
getMinorAxis in interface GribGDSVariablesIF
Returns:
MajorAxis as float

getEarthRadius

public final float getEarthRadius()
EarthRadius

Specified by:
getEarthRadius in interface GribGDSVariablesIF
Returns:
EarthRadius as float

getGridUnits

public final java.lang.String getGridUnits()
GridUnits

Specified by:
getGridUnits in interface GribGDSVariablesIF
Returns:
GridUnits as String

calculateNx

public final int calculateNx()
Gets the Maximum number of points in a parallel for Quasi/Thin grids

Returns:
parallels as int[]

getParallels

public final int[] getParallels()
Gets the number of points in each parallel for Quasi/Thin grids

Returns:
parallels as int[]

getGdsKey

public final int getGdsKey()
Description copied from interface: GribGDSVariablesIF
.

Specified by:
getGdsKey in interface GribGDSVariablesIF
Returns:
gdsKey as int

get80TypeGdsKey

public final int get80TypeGdsKey()
gdsKey for version 8.0

Returns:
gdsKey as int

getInt

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

Parameters:
index - in the byte[] to convert
Returns:
int byte as int