ucar.nc2.dataset.grid
Class GeoGrid

java.lang.Object
  extended by ucar.nc2.dataset.grid.GeoGrid
All Implemented Interfaces:
NamedObject

Deprecated. (use ucar.nc2.dt.grid)

public class GeoGrid
extends java.lang.Object
implements NamedObject

A georeferencing "gridded" VariableEnhanced, that has a GridCoordSys. In VisAD data model, it is a sampled Field. The dimension are put into canonical order: (t, z, y, x).

Implementation note: If the Horizontal axes are 2D, the x and y dimensions are arbitrarily chosen to be gcs.getXHorizAxis().getDimension(1), gcs.getXHorizAxis().getDimension(0) respectively.

Note: these classes should be considered experimental and will likely be refactored in the next release.

Version:
$Revision: 1.24 $ $Date: 2006/05/24 00:12:57 $
Author:
caron

Constructor Summary
GeoGrid(GridDataset dataset, VariableEnhanced dsvar, GridCoordSys gcs)
          Deprecated. Constructor.
 
Method Summary
 boolean equals(java.lang.Object oo)
          Deprecated. Instances which have same name and coordinate system are equal.
 Attribute findAttributeIgnoreCase(java.lang.String name)
          Deprecated. Convenience function; lookup Attribute by name.
 java.lang.String findAttValueIgnoreCase(java.lang.String attName, java.lang.String defaultValue)
          Deprecated.  
 java.util.List getAttributes()
          Deprecated.  
 GridCoordSys getCoordinateSystem()
          Deprecated. get the GridCoordSys for this GeoGrid.
 Array getDataSlice(int t, int z, int y, int x)
          Deprecated. use readDataSlice
 DataType getDataType()
          Deprecated. get the data type
 java.lang.String getDescription()
          Deprecated. get the standardized description, see VariableStandardized.getDescription()
 Dimension getDimension(int i)
          Deprecated. get the ith dimension
 java.util.List getDimensions()
          Deprecated. Returns an ArrayList containing the dimensions used by this geoGrid.
 java.lang.String getInfo()
          Deprecated. nicely formatted information
 java.util.ArrayList getLevels()
          Deprecated. ArrayList of thredds.util.NamedObject, from the GridCoordSys.
 MAMath.MinMax getMinMaxSkipMissingData(Array a)
          Deprecated. Get the minimum and the maximum data value of the previously read Array, skipping missing values as defined by isMissingData(double val).
 java.lang.String getName()
          Deprecated. get the name of the geoGrid.
 ProjectionImpl getProjection()
          Deprecated. get the Projection.
 int getRank()
          Deprecated. get the rank
 int[] getShape()
          Deprecated. get the shape
 Dimension getTimeDimension()
          Deprecated. get the time Dimension, or null if none
 int getTimeDimensionIndex()
          Deprecated. get the time Dimension index in the geogrid (canonical order), or -1 if none
 java.util.ArrayList getTimes()
          Deprecated. ArrayList of thredds.util.NamedObject, from the GridCoordSys.
 java.lang.String getUnitsString()
          Deprecated. get the unit as a string, see VariableStandardized.getUnitString()
 java.lang.String getUnitString()
          Deprecated. use getUnitsString()
 VariableEnhanced getVariable()
          Deprecated.  
 Dimension getXDimension()
          Deprecated. get the x Dimension
 int getXDimensionIndex()
          Deprecated. get the x Dimension index in the geogrid (canonical order)
 Dimension getYDimension()
          Deprecated. get the y Dimension,
 int getYDimensionIndex()
          Deprecated. get the y Dimension index in the geogrid (canonical order)
 Dimension getZDimension()
          Deprecated. get the z Dimension, or null if none
 int getZDimensionIndex()
          Deprecated. get the z Dimension index in the geogrid (canonical order), or -1 if none
 int hashCode()
          Deprecated. Override Object.hashCode() to be consistent with equals.
 boolean hasMissingData()
          Deprecated. true if there may be missing data, see VariableStandardized.hasMissing()
 boolean isMissingData(double val)
          Deprecated. if val is missing data, see VariableStandardized.isMissingData()
 Array readDataSlice(int t, int z, int y, int x)
          Deprecated. This reads in an arbitrary data slice, with the data in canonical order (t-z-y-x).
 Array readVolumeData(int t)
          Deprecated. Reads in the data "volume" at the given time index.
 Array readYXData(int t, int z)
          Deprecated. Reads a Y-X "horizontal slice" at the given time and vertical index.
 Array readZYData(int t, int x)
          Deprecated. Reads a Z-Y "vertical slice" at the given time and x index.
 float[] setMissingToNaN(float[] values)
          Deprecated. Convert (in place) all values in the given array that are considered as "missing" to Float.NaN, according to vs.isMissing(val).
 GeoGrid subset(Range t_range, Range z_range, LatLonRect bbox, int z_stride, int y_stride, int x_stride)
          Deprecated. Create a new GeoGrid that is a logical subset of this GeoGrid.
 GeoGrid subset(Range t_range, Range z_range, Range y_range, Range x_range)
          Deprecated. Create a new GeoGrid that is a logical subset of this GeoGrid.
 java.lang.String toString()
          Deprecated. string representation
 void writeFile(java.lang.String filename)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoGrid

public GeoGrid(GridDataset dataset,
               VariableEnhanced dsvar,
               GridCoordSys gcs)
Deprecated. 
Constructor.

Parameters:
dataset - belongs to this dataset
dsvar - wraps this Variable
gcs - has this grid coordinate system
Method Detail

getDimensions

public java.util.List getDimensions()
Deprecated. 
Returns an ArrayList containing the dimensions used by this geoGrid. The dimension are put into canonical order: (t, z, y, x). Note that the z and t dimensions are optional. If the Horizontal axes are 2D, the x and y dimensions are arbitrarily chosen to be gcs.getXHorizAxis().getDimension(1), gcs.getXHorizAxis().getDimension(0), respectively.

Returns:
List with objects of type Dimension, in canonical order.

getDimension

public Dimension getDimension(int i)
Deprecated. 
get the ith dimension

Parameters:
i - : which dimension
Returns:
ith Dimension

getTimeDimension

public Dimension getTimeDimension()
Deprecated. 
get the time Dimension, or null if none


getZDimension

public Dimension getZDimension()
Deprecated. 
get the z Dimension, or null if none


getYDimension

public Dimension getYDimension()
Deprecated. 
get the y Dimension,


getXDimension

public Dimension getXDimension()
Deprecated. 
get the x Dimension


getTimeDimensionIndex

public int getTimeDimensionIndex()
Deprecated. 
get the time Dimension index in the geogrid (canonical order), or -1 if none


getZDimensionIndex

public int getZDimensionIndex()
Deprecated. 
get the z Dimension index in the geogrid (canonical order), or -1 if none


getYDimensionIndex

public int getYDimensionIndex()
Deprecated. 
get the y Dimension index in the geogrid (canonical order)


getXDimensionIndex

public int getXDimensionIndex()
Deprecated. 
get the x Dimension index in the geogrid (canonical order)


findAttributeIgnoreCase

public Attribute findAttributeIgnoreCase(java.lang.String name)
Deprecated. 
Convenience function; lookup Attribute by name.

Parameters:
name - the name of the attribute
Returns:
the attribute, or null if not found

findAttValueIgnoreCase

public java.lang.String findAttValueIgnoreCase(java.lang.String attName,
                                               java.lang.String defaultValue)
Deprecated. 

getRank

public int getRank()
Deprecated. 
get the rank


getShape

public int[] getShape()
Deprecated. 
get the shape


getDataType

public DataType getDataType()
Deprecated. 
get the data type


getAttributes

public java.util.List getAttributes()
Deprecated. 

getVariable

public VariableEnhanced getVariable()
Deprecated. 

getName

public java.lang.String getName()
Deprecated. 
get the name of the geoGrid.

Specified by:
getName in interface NamedObject

getCoordinateSystem

public GridCoordSys getCoordinateSystem()
Deprecated. 
get the GridCoordSys for this GeoGrid.


getProjection

public ProjectionImpl getProjection()
Deprecated. 
get the Projection.


getLevels

public java.util.ArrayList getLevels()
Deprecated. 
ArrayList of thredds.util.NamedObject, from the GridCoordSys.


getTimes

public java.util.ArrayList getTimes()
Deprecated. 
ArrayList of thredds.util.NamedObject, from the GridCoordSys.


getDescription

public java.lang.String getDescription()
Deprecated. 
get the standardized description, see VariableStandardized.getDescription()

Specified by:
getDescription in interface NamedObject

getUnitsString

public java.lang.String getUnitsString()
Deprecated. 
get the unit as a string, see VariableStandardized.getUnitString()


getUnitString

public java.lang.String getUnitString()
Deprecated. use getUnitsString()


hasMissingData

public boolean hasMissingData()
Deprecated. 
true if there may be missing data, see VariableStandardized.hasMissing()


isMissingData

public boolean isMissingData(double val)
Deprecated. 
if val is missing data, see VariableStandardized.isMissingData()


setMissingToNaN

public float[] setMissingToNaN(float[] values)
Deprecated. 
Convert (in place) all values in the given array that are considered as "missing" to Float.NaN, according to vs.isMissing(val).

Parameters:
values - input array
Returns:
input array, with missing values converted to NaNs.

getMinMaxSkipMissingData

public MAMath.MinMax getMinMaxSkipMissingData(Array a)
Deprecated. 
Get the minimum and the maximum data value of the previously read Array, skipping missing values as defined by isMissingData(double val).

Parameters:
a - Array to get min/max values
Returns:
both min and max value.

readVolumeData

public Array readVolumeData(int t)
                     throws java.io.IOException
Deprecated. 
Reads in the data "volume" at the given time index. If its a product set, put into canonical order (z-y-x). If not a product set, reorder to (z,i,j), where i, j are from the original

Parameters:
t - time index; ignored if no time axis.
Returns:
data[z,y,x] or data[y,x] if no z axis.
Throws:
java.io.IOException

readYXData

public Array readYXData(int t,
                        int z)
                 throws java.io.IOException
Deprecated. 
Reads a Y-X "horizontal slice" at the given time and vertical index. If its a product set, put into canonical order (y-x).

Parameters:
t - time index; ignored if no time axis.
z - vertical index; ignored if no z axis.
Returns:
data[y,x]
Throws:
java.io.IOException

readZYData

public Array readZYData(int t,
                        int x)
                 throws java.io.IOException
Deprecated. 
Reads a Z-Y "vertical slice" at the given time and x index. If its a product set, put into canonical order (z-y).

Parameters:
t - time index; ignored if no time axis.
x - x index; ignored if no x axis.
Returns:
data[z,y]
Throws:
java.io.IOException

getDataSlice

public Array getDataSlice(int t,
                          int z,
                          int y,
                          int x)
                   throws java.io.IOException
Deprecated. use readDataSlice

Throws:
java.io.IOException

readDataSlice

public Array readDataSlice(int t,
                           int z,
                           int y,
                           int x)
                    throws java.io.IOException
Deprecated. 
This reads in an arbitrary data slice, with the data in canonical order (t-z-y-x). If any dimension does not exist, ignore it.

Parameters:
t - if < 0, get all of time dim; if valid index, fix sliceto that value.
z - if < 0, get all of z dim; if valid index, fix slice to that value.
y - if < 0, get all of y dim; if valid index, fix slice to that value.
x - if < 0, get all of x dim; if valid index, fix slice to that value.
Returns:
data[t,z,y,x], eliminating missing or fixed dimension.
Throws:
java.io.IOException

subset

public GeoGrid subset(Range t_range,
                      Range z_range,
                      LatLonRect bbox,
                      int z_stride,
                      int y_stride,
                      int x_stride)
               throws InvalidRangeException
Deprecated. 
Create a new GeoGrid that is a logical subset of this GeoGrid.

Parameters:
t_range - subset the time dimension, or null if you want all of it
z_range - subset the vertical dimension, or null if you want all of it
bbox - a lat/lon bounding box, or null if you want all x,y
z_stride - use only if z_range is null, then take all z with this stride (1 means all)
y_stride - use this stride on the y coordinate (1 means all)
x_stride - use this stride on the x coordinate (1 means all)
Returns:
subsetted GeoGrid
Throws:
InvalidRangeException

subset

public GeoGrid subset(Range t_range,
                      Range z_range,
                      Range y_range,
                      Range x_range)
               throws InvalidRangeException
Deprecated. 
Create a new GeoGrid that is a logical subset of this GeoGrid.

Parameters:
t_range - subset the time dimension, or null if you want all of it
z_range - subset the vertical dimension, or null if you want all of it
y_range - subset the y dimension, or null if you want all of it
x_range - subset the x dimension, or null if you want all of it
Returns:
subsetted GeoGrid
Throws:
InvalidRangeException

writeFile

public void writeFile(java.lang.String filename)
               throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object oo)
Deprecated. 
Instances which have same name and coordinate system are equal.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Deprecated. 
Override Object.hashCode() to be consistent with equals.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Deprecated. 
string representation

Overrides:
toString in class java.lang.Object

getInfo

public java.lang.String getInfo()
Deprecated. 
nicely formatted information