visad.jmet
Class GRIBCoordinateSystem
- java.lang.Object
-
- visad.CoordinateSystem
-
- visad.georef.NavigatedCoordinateSystem
-
- visad.georef.MapProjection
-
- visad.jmet.GRIBCoordinateSystem
-
- All Implemented Interfaces:
- java.io.Serializable
public class GRIBCoordinateSystem extends MapProjection
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GRIBCoordinateSystem(int gridNumber)constructor for well-known grid numbers.GRIBCoordinateSystem(int gridTypeCode, double La1, double Lo1, double DxDy, double lov)Constructor for a Polar Stereographic (GRIB type code = 5) with RealTupleType.LatitudeLongitudeTuple as a reference.GRIBCoordinateSystem(int gridTypeCode, double La1, double Lo1, double DxDy, double Latin1, double Latin2, double Lov)Constructor for a Lambert conformal (GRIB type code = 3) with RealTupleType.LatitudeLongitudeTuple as a reference.GRIBCoordinateSystem(int Ni, int Nj, double La1, double Lo1, double Di, double Dj)Constructor for a simple latitude-longitude (GRIB type code = 0) with RealTupleType.LatitudeLongitudeTuple as a reference.GRIBCoordinateSystem(int gridTypeCode, int Ni, int Nj, double La1, double Lo1, double La2, double Lo2, double Di, double Dj)Constructor for a latitude-longitude (GRIB type code = 0) with RealTupleType.LatitudeLongitudeTuple as a reference.GRIBCoordinateSystem(RealTupleType ref, int gridNumber)constructor for well-known grid numbersGRIBCoordinateSystem(RealTupleType ref, int gridTypeCode, double La1, double Lo1, double DxDy, double lov)Constructor for a Polar Stereographic (GRIB type code = 5) with RealTupleType.LatitudeLongitudeTuple as a reference.GRIBCoordinateSystem(RealTupleType ref, int gridTypeCode, double La1, double Lo1, double DxDy, double Latin1, double Latin2, double Lov)Constructor for a Lambert conformal (GRIB type code = 3)GRIBCoordinateSystem(RealTupleType ref, int gridTypeCode, int Ni, int Nj, double La1, double Lo1, double La2, double Lo2, double Di, double Dj)constructor for a latitude-longitude (GRIB type code = 0).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object cs)determine if the Coordinate System in question is an GRIBCoordinateSystemdouble[][]fromReference(double[][] tuples)convert from lat,lon to x,ydoublegetAspectRatio()return the ratio of the grid spacing between rows and columnsjava.awt.geom.Rectangle2DgetDefaultMapArea()return the bounding box for this projectionstatic booleanisGridNumberKnown(int gridNumber)find out if the specified grid number (GRIB code) is knownstatic voidmain(java.lang.String[] args)double[][]toReference(double[][] tuples)convert from x,y to lat,lon-
Methods inherited from class visad.georef.MapProjection
getCenterLatLon, getLatLon, getXIndex, getYIndex, isLatLonOrder, isXYOrder, toString
-
Methods inherited from class visad.georef.NavigatedCoordinateSystem
getLatitudeIndex, getLongitudeIndex
-
Methods inherited from class visad.CoordinateSystem
canConvert, fromReference, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
-
-
-
-
Constructor Detail
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(int gridTypeCode, double La1, double Lo1, double DxDy, double lov) throws VisADExceptionConstructor for a Polar Stereographic (GRIB type code = 5) with RealTupleType.LatitudeLongitudeTuple as a reference.- Parameters:
gridTypeCode- GRIB-1 grid typeLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)DxDy- spacing between grid points at 60Nlov- orientation of the grid (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(RealTupleType ref, int gridTypeCode, double La1, double Lo1, double DxDy, double lov) throws VisADException
Constructor for a Polar Stereographic (GRIB type code = 5) with RealTupleType.LatitudeLongitudeTuple as a reference.- Parameters:
ref- reference RealTupleType (should be lat/lon)gridTypeCode- GRIB-1 grid typeLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)DxDy- spacing between grid points at 60Nlov- orientation of the grid (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(RealTupleType ref, int gridTypeCode, double La1, double Lo1, double DxDy, double Latin1, double Latin2, double Lov) throws VisADException
Constructor for a Lambert conformal (GRIB type code = 3)- Parameters:
ref- reference RealTupleType (should be lat/lon)gridTypeCode- GRIB-1 grid typeLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)DxDy- ?Latin1- first intersecting latitude (degrees)Latin2- second intersecting latitude (degrees)Lov- orientation of the grid (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(int gridTypeCode, double La1, double Lo1, double DxDy, double Latin1, double Latin2, double Lov) throws VisADExceptionConstructor for a Lambert conformal (GRIB type code = 3) with RealTupleType.LatitudeLongitudeTuple as a reference.- Parameters:
gridTypeCode- GRIB-1 grid typeLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)DxDy- ?Latin1- first intersecting latitude (degrees)Latin2- second intersecting latitude (degrees)Lov- orientation of the grid (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(int gridTypeCode, int Ni, int Nj, double La1, double Lo1, double La2, double Lo2, double Di, double Dj) throws VisADExceptionConstructor for a latitude-longitude (GRIB type code = 0) with RealTupleType.LatitudeLongitudeTuple as a reference.- Parameters:
gridTypeCode- GRIB-1 grid typeNi- number of points (W-E) along a latitude circleNj- number of points (N-S) along a longitude circleLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)La2- latitude of last grid point (degrees)Lo2- longitude of last grid point (degrees)Di- longitudinal direction increment (degrees)Dj- latitudinal direction increment (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(RealTupleType ref, int gridTypeCode, int Ni, int Nj, double La1, double Lo1, double La2, double Lo2, double Di, double Dj) throws VisADException
constructor for a latitude-longitude (GRIB type code = 0). Reference should be RealTupleType.LatitudeLongitudeTuple. [this is overloaded to also handle LambertConformal (above, type = 3)]- Parameters:
ref- reference RealTupleType (should be lat/lon)gridTypeCode- GRIB-1 grid typeNi- number of points (W-E) along a latitude circleNj- number of points (N-S) along a longitude circleLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)La2- latitude of last grid point (degrees)Lo2- longitude of last grid point (degrees)Di- longitudinal direction increment (degrees)Dj- latitudinal direction increment (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object When type=3, then the parameters are (see construtor for 3): ref = ref, Ni = Ni, Nj = Nj, La1 = La1, Lo1 = Lo1, La2 = DxDy, Lo2 = Latin1, Di = Latin2, Dj = lov
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(int Ni, int Nj, double La1, double Lo1, double Di, double Dj) throws VisADExceptionConstructor for a simple latitude-longitude (GRIB type code = 0) with RealTupleType.LatitudeLongitudeTuple as a reference.- Parameters:
Ni- number of points (W-E) along a latitude circleNj- number of points (N-S) along a longitude circleLa1- latitude of first grid point (degrees)Lo1- longitude of first grid point (degrees)Di- longitudinal direction increment (degrees)Dj- latitudinal direction increment (degrees)- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(int gridNumber) throws VisADExceptionconstructor for well-known grid numbers. Uses RealTupleType.LatitudeLongitudeTuple for a reference.- Parameters:
gridNumber- GRIB grid number- Throws:
VisADException- couldn't create the necessary VisAD object
-
GRIBCoordinateSystem
public GRIBCoordinateSystem(RealTupleType ref, int gridNumber) throws VisADException
constructor for well-known grid numbers- Parameters:
ref- reference RealTupleType (should be lat/lon)gridNumber- GRIB grid number- Throws:
VisADException- couldn't create the necessary VisAD object
-
-
Method Detail
-
toReference
public double[][] toReference(double[][] tuples) throws VisADExceptionconvert from x,y to lat,lon- Specified by:
toReferencein classCoordinateSystem- Parameters:
tuples- contains the x,y coordinates (grid col, row)- Returns:
- tuple of (lat,lon);
- Throws:
VisADException- if problem with conversion.
-
fromReference
public double[][] fromReference(double[][] tuples) throws VisADExceptionconvert from lat,lon to x,y- Specified by:
fromReferencein classCoordinateSystem- Parameters:
tuples- contains the lat,lon coordinates- Returns:
- array of double values in CoordinateSystem Units.
- Throws:
VisADException- if problem with conversion.
-
equals
public boolean equals(java.lang.Object cs)
determine if the Coordinate System in question is an GRIBCoordinateSystem- Specified by:
equalsin classCoordinateSystem- Parameters:
cs- the object in question.- Returns:
trueif and only if this instance equals cs.
-
getDefaultMapArea
public java.awt.geom.Rectangle2D getDefaultMapArea()
return the bounding box for this projection- Specified by:
getDefaultMapAreain classMapProjection- Returns:
- the bounding box of the MapProjection
-
getAspectRatio
public double getAspectRatio()
return the ratio of the grid spacing between rows and columns
-
isGridNumberKnown
public static boolean isGridNumberKnown(int gridNumber)
find out if the specified grid number (GRIB code) is known
-
main
public static void main(java.lang.String[] args)
-
-
DMelt 3.0 © DataMelt by jWork.ORG