net.sourceforge.jgrib.gdsgrids
Class GribGDSRotatedLatLon

Object
  extended by GribRecordGDS
      extended by GribGDSRotatedLatLon

public final class GribGDSRotatedLatLon
extends GribRecordGDS

A class that represents the grid definition section (GDS) of a GRIB record with a Rotated Lat/Lon grid projection.

Author:
Simone Giannecchini (simboss@tiscali.it) based heavily on the original GribRecordGDS

Field Summary
protected  double grid_latspst
          y-coordinate/latitude of south pole of stretching.
protected  double grid_lonspst
          x-coordinate/longitude of south pole of stretching.
protected  double grid_stretchfact
          Stretching factor rotated lat/lon grid.
static int ROTATED_LATLON_GRID_TYPE
           
 
Fields inherited from class GribRecordGDS
adiacent_i, EARTH_RADIUS, grid_dx, grid_dy, grid_lat1, grid_lat2, grid_latsp, grid_lon1, grid_lon2, grid_lonsp, grid_mode, grid_nx, grid_ny, grid_rotang, grid_scan, grid_type, length
 
Constructor Summary
GribGDSRotatedLatLon()
          GribGDSRotatedLatLon
GribGDSRotatedLatLon(ImageInputStream in, int[] header)
          Constructs a GribRecordGDS object from a bit input stream.
 
Method Summary
 boolean canProduce(int GDSType)
           
 boolean equals(Object obj)
           
 double[] getGridCoords()
          Get grid coordinates in longitude/latitude pairs Longitude is returned in the range +/- 180 degrees
 double getGridDX()
          Get delta-Lon between two grid points.
 double getGridDY()
          Get delta-Lat between two grid points.
 double getGridLat1()
          Get latitude of grid start point.
 double getGridLat2()
          Get latitude of grid end point.
 double getGridLatSPST()
          Get y-coordinate/latitude of south pole of stretching.
 double getGridLon1()
          Get longitude of grid start point.
 double getGridLon2()
          Get longitude of grid end point.
 double getGridLonSPST()
          Get x-coordinate/longitude of south pole of of stretching.
 int getGridMode()
          Get grid mode.
 int getGridNX()
          Get number of grid columns.
 int getGridNY()
          Get number of grid rows.
 double getGridRotAngle()
          Get grid rotation angle of a rotated latitude/longitude grid.
 int getGridScanmode()
          Get scan mode (sign of increments).
 double getGridStretchingFactor()
          Get stretching factor.
 int getGridType()
          Get type of grid.
 Map getImplementationHints()
           
 int getLength()
          Get length in bytes of this section.
 String getName()
           
 Set<Integer> getSupportedTypes()
           
 int hashCode()
           
 boolean isAvailable()
           
 void setGridLatSPST(double grid_latspst)
           
 void setGridLonSPST(double grid_lonspst)
           
 void setGridStretchingFactor(double grid_strfact)
          Set stretching factor.
 String toString()
          Get a string representation of this GDS.
 void writeTo(OutputStream out)
          writeTo
 
Methods inherited from class GribRecordGDS
compare, getGridLatSP, getGridLonSP, isAdiacent_i_Or_j, setGridDX, setGridDY, setGridLat1, setGridLat2, setGridLatSP, setGridLon1, setGridLon2, setGridLonSP, setGridMode, setGridNX, setGridNY, setGridRotAngle, setGridScanmode, setGridType, setLength
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROTATED_LATLON_GRID_TYPE

public static final int ROTATED_LATLON_GRID_TYPE
See Also:
Constant Field Values

grid_latspst

protected double grid_latspst
y-coordinate/latitude of south pole of stretching.


grid_lonspst

protected double grid_lonspst
x-coordinate/longitude of south pole of stretching.


grid_stretchfact

protected double grid_stretchfact
Stretching factor rotated lat/lon grid.

Constructor Detail

GribGDSRotatedLatLon

public GribGDSRotatedLatLon(ImageInputStream in,
                            int[] header)
                     throws IOException
Constructs a GribRecordGDS object from a bit input stream. See Table D of NCEP Office Note 388 for details

Parameters:
in - bit input stream with GDS content
Throws:
IOException - if stream can not be opened etc.
NoValidGribException - if stream contains no valid GRIB file

GribGDSRotatedLatLon

public GribGDSRotatedLatLon()
GribGDSRotatedLatLon

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class GribRecordGDS

equals

public boolean equals(Object obj)
Overrides:
equals in class GribRecordGDS

getLength

public int getLength()
Get length in bytes of this section.

Overrides:
getLength in class GribRecordGDS
Returns:
length in bytes of this section

getGridType

public int getGridType()
Get type of grid. This is type 0.

Overrides:
getGridType in class GribRecordGDS
Returns:
type of grid

getGridNX

public int getGridNX()
Get number of grid columns.

Overrides:
getGridNX in class GribRecordGDS
Returns:
number of grid columns

getGridNY

public int getGridNY()
Get number of grid rows.

Overrides:
getGridNY in class GribRecordGDS
Returns:
number of grid rows.

getGridLat1

public double getGridLat1()
Get latitude of grid start point.

Overrides:
getGridLat1 in class GribRecordGDS
Returns:
latitude of grid start point

getGridLon1

public double getGridLon1()
Get longitude of grid start point.

Overrides:
getGridLon1 in class GribRecordGDS
Returns:
longitude of grid start point

getGridMode

public int getGridMode()
Get grid mode. Only 128 (increments given) supported so far.

Overrides:
getGridMode in class GribRecordGDS
Returns:
grid mode

getGridLat2

public double getGridLat2()
Get latitude of grid end point.

Overrides:
getGridLat2 in class GribRecordGDS
Returns:
latitude of grid end point

getGridLon2

public double getGridLon2()
Get longitude of grid end point.

Overrides:
getGridLon2 in class GribRecordGDS
Returns:
longitude of grid end point

getGridDX

public double getGridDX()
Get delta-Lon between two grid points.

Overrides:
getGridDX in class GribRecordGDS
Returns:
Lon increment

getGridDY

public double getGridDY()
Get delta-Lat between two grid points.

Overrides:
getGridDY in class GribRecordGDS
Returns:
Lat increment

getGridScanmode

public int getGridScanmode()
Get scan mode (sign of increments). Only 64, 128 and 192 supported so far.

Overrides:
getGridScanmode in class GribRecordGDS
Returns:
scan mode

getGridCoords

public double[] getGridCoords()
Get grid coordinates in longitude/latitude pairs Longitude is returned in the range +/- 180 degrees

Overrides:
getGridCoords in class GribRecordGDS
Returns:
longitide/latituide as doubles

toString

public String toString()
Get a string representation of this GDS.

Overrides:
toString in class GribRecordGDS
Returns:
string representation of this GDS

getGridStretchingFactor

public double getGridStretchingFactor()
Get stretching factor.

Returns:
stretching factor.

setGridStretchingFactor

public void setGridStretchingFactor(double grid_strfact)
Set stretching factor.


getGridRotAngle

public double getGridRotAngle()
Get grid rotation angle of a rotated latitude/longitude grid.

Overrides:
getGridRotAngle in class GribRecordGDS
Returns:
rotation angle

getGridLatSPST

public double getGridLatSPST()
Get y-coordinate/latitude of south pole of stretching.

Returns:
latitude of south pole of stretching.

getGridLonSPST

public double getGridLonSPST()
Get x-coordinate/longitude of south pole of of stretching.

Returns:
longitude of south pole of stretching.

setGridLatSPST

public void setGridLatSPST(double grid_latspst)
Parameters:
grid_latspst - The grid_latspst to set.

setGridLonSPST

public void setGridLonSPST(double grid_lonspst)
Parameters:
grid_lonspst - The grid_lonspst to set.

writeTo

public void writeTo(OutputStream out)
             throws IOException
Description copied from class: GribRecordGDS
writeTo

Specified by:
writeTo in class GribRecordGDS
Parameters:
out - OutputStream
Throws:
IOException - DOCUMENT ME!

getName

public String getName()

getSupportedTypes

public Set<Integer> getSupportedTypes()

isAvailable

public boolean isAvailable()

canProduce

public boolean canProduce(int GDSType)

getImplementationHints

public Map getImplementationHints()


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.