ucar.unidata.data.grid
Class GeoGridAdapter

java.lang.Object
  extended by ucar.unidata.data.grid.GeoGridAdapter

public class GeoGridAdapter
extends Object

Adapt a ucar.unidata.GeoGrid into VisAD Data object(s). GeoGridAdapter gets a Geogrid and has methods to create a a VisAD 2D or 3D FlatField, or sequence of same, from the GeoGrid for parameter names and time(s) desired.

Version:
$Revision: 1.112 $ $Date: 2007/08/20 22:33:38 $
Author:
Don Murray

Field Summary
 String cacheFile
          cache file
 
Constructor Summary
GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid)
          Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, ucar.nc2.NetcdfFile ncFile)
          Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, String paramName)
          Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, String paramName, ucar.nc2.NetcdfFile ncFile)
          Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, String paramName, ucar.nc2.NetcdfFile ncFile, Object extraCacheKey)
          Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
 
Method Summary
 FieldImpl getData()
          Get all the data from this GeoGrid.
protected  List getLevels()
          Create the list of levels for this grid
 FieldImpl getSequence()
          Get a time ordered sequence of 2D flat fields
 FieldImpl getSequence(int[] timeIndices)
          Get a time ordered sequence of 2D flat fields
 FieldImpl getSequence(int[] timeIndices, Object loadId)
          Get a time ordered sequence of 2D flat fields
static boolean isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
          Utility to check if we should ignore the given z axis
static boolean isZUnitOk(Unit zUnit, ucar.unidata.geoloc.vertical.VerticalTransform vt)
          Utility to check if we can handle the vertical transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheFile

public String cacheFile
cache file

Constructor Detail

GeoGridAdapter

public GeoGridAdapter(GeoGridDataSource dataSource,
                      ucar.nc2.dt.grid.GeoGrid geoGrid)
               throws VisADException
Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.

Parameters:
dataSource - source of this GeoGrid
geoGrid - the GeoGrid in question
Throws:
VisADException - unable to create one of the VisAD objects

GeoGridAdapter

public GeoGridAdapter(GeoGridDataSource dataSource,
                      ucar.nc2.dt.grid.GeoGrid geoGrid,
                      String paramName)
               throws VisADException
Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.

Parameters:
dataSource - source of this GeoGrid
geoGrid - the GeoGrid in question
paramName - name of the parameter
Throws:
VisADException - unable to create one of the VisAD objects

GeoGridAdapter

public GeoGridAdapter(GeoGridDataSource dataSource,
                      ucar.nc2.dt.grid.GeoGrid geoGrid,
                      ucar.nc2.NetcdfFile ncFile)
               throws VisADException
Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.

Parameters:
dataSource - source of this GeoGrid
geoGrid - the GeoGrid in question
ncFile - file that the GeoGrid data is coming from
Throws:
VisADException - unable to create one of the VisAD objects

GeoGridAdapter

public GeoGridAdapter(GeoGridDataSource dataSource,
                      ucar.nc2.dt.grid.GeoGrid geoGrid,
                      String paramName,
                      ucar.nc2.NetcdfFile ncFile)
               throws VisADException
Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.

Parameters:
dataSource - source of this GeoGrid
geoGrid - the GeoGrid in question
paramName - name of the parameter
ncFile - file that the GeoGrid data is coming from
Throws:
VisADException - unable to create one of the VisAD objects

GeoGridAdapter

public GeoGridAdapter(GeoGridDataSource dataSource,
                      ucar.nc2.dt.grid.GeoGrid geoGrid,
                      String paramName,
                      ucar.nc2.NetcdfFile ncFile,
                      Object extraCacheKey)
               throws VisADException
Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.

Parameters:
dataSource - source of this GeoGrid
geoGrid - the GeoGrid in question
paramName - name of the parameter
ncFile - file that the GeoGrid data is coming from
extraCacheKey - Extra key to use when caching
Throws:
VisADException - unable to create one of the VisAD objects
Method Detail

getLevels

protected List getLevels()
                  throws VisADException
Create the list of levels for this grid

Returns:
List of levels as Real-s
Throws:
VisADException - On badness

getSequence

public FieldImpl getSequence()
Get a time ordered sequence of 2D flat fields

Returns:
data for all the times for a particular 2D field

getSequence

public FieldImpl getSequence(int[] timeIndices)
Get a time ordered sequence of 2D flat fields

Parameters:
timeIndices - indices of times in the data
Returns:
data for all the times for a particular 2D field

getSequence

public FieldImpl getSequence(int[] timeIndices,
                             Object loadId)
Get a time ordered sequence of 2D flat fields

Parameters:
timeIndices - indices of times in the data
loadId - loadId
Returns:
data for all the times for a particular 2D field

getData

public FieldImpl getData()
                  throws VisADException
Get all the data from this GeoGrid.

Returns:
VisAD representation of this GeoGrid
Throws:
VisADException - problem creating the grid

isZAxisOk

public static boolean isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
Utility to check if we should ignore the given z axis

Parameters:
zaxis - given z axis
Returns:
Is ok

isZUnitOk

public static boolean isZUnitOk(Unit zUnit,
                                ucar.unidata.geoloc.vertical.VerticalTransform vt)
Utility to check if we can handle the vertical transform

Parameters:
zUnit - zUnit
vt - vertical transform
Returns:
true if we can