visad.data.netcdf.in
Class DefaultView

java.lang.Object
  extended by visad.data.netcdf.in.View
      extended by visad.data.netcdf.in.DefaultView

public class DefaultView
extends View

Provides support for the default view of a netCDF dataset as documented in the netCDF User's Guide.

Version:
$Revision: 1.9 $ $Date: 2004-11-19 23:31:08 $
Author:
Steven R. Emmerson

Nested Class Summary
 
Nested classes/interfaces inherited from class visad.data.netcdf.in.View
View.DataIterator, View.Domain
 
Constructor Summary
DefaultView(ucar.netcdf.Netcdf netcdf, QuantityDB quantityDB)
          Constructs from a netCDF dataset and a quantity database.
DefaultView(ucar.netcdf.Netcdf netcdf, QuantityDB quantityDB, boolean charToText)
          Constructs from a netCDF dataset and a quantity database.
 
Method Summary
protected  View.Domain getDomain(ucar.netcdf.Variable var)
          Returns the domain of a netCDF variable.
protected  SampledSet getDomainSet(ucar.netcdf.Dimension[] dims)
          Returns the VisAD domain set corresponding to an array of netCDF dimension in netCDF order (outermost dimension first).
protected  MathType getDomainType(ucar.netcdf.Dimension[] dims)
          Returns the VisAD MathType corresponding to an array of netCDF dimensions.
protected  boolean isIgnorable(ucar.netcdf.Variable var)
          Indicates if a given variable should be ignored during iteration.
 
Methods inherited from class visad.data.netcdf.in.View
getAttributeString, getAttributeString, getConventionsString, getCoordinateVariable, getData, getData, getDimensions, getDomainSet, getInstance, getInstance, getLongName, getNetcdf, getOuterDimensionNameSet, getRangeSet, getRealType, getRealType, getRealTypeFromLongName, getRealTypeFromName, getScalarType, getTextType, getUnitFromAttribute, getUnitString, getVariable, getVetter, getVirtualDataIterator, isCharToText, isCoordinateVariable, isLatitude, isLongitude, isLongitude, isNumeric, isNumeric, isTime, isTime, newName, setOuterDimensionNameSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultView

public DefaultView(ucar.netcdf.Netcdf netcdf,
                   QuantityDB quantityDB)
Constructs from a netCDF dataset and a quantity database.

Parameters:
netcdf - The netCDF dataset.
quantityDB - The quantity database to use to map netCDF variables to VisAD Quantity-s.

DefaultView

public DefaultView(ucar.netcdf.Netcdf netcdf,
                   QuantityDB quantityDB,
                   boolean charToText)
Constructs from a netCDF dataset and a quantity database.

Parameters:
netcdf - The netCDF dataset.
quantityDB - The quantity database to use to map netCDF variables to VisAD Quantity-s.
charToText - Specifies whether the View should map char variables to VisAD Text objects
Method Detail

isIgnorable

protected boolean isIgnorable(ucar.netcdf.Variable var)

Indicates if a given variable should be ignored during iteration.

This implementation returns the value of View.isCoordinateVariable(Variable).

Specified by:
isIgnorable in class View
Returns:
true if and only if the variable should be ignored.

getDomain

protected View.Domain getDomain(ucar.netcdf.Variable var)
                         throws TypeException,
                                IOException
Returns the domain of a netCDF variable.

Specified by:
getDomain in class View
Parameters:
var - A netCDF variable.
Returns:
The domain of the given variable.
Throws:
IllegalArgumentException - if the rank of the variable is zero.
TypeException - if a RealType needed to be created but couldn't.
IOException - if a netCDF read-error occurs.

getDomainSet

protected SampledSet getDomainSet(ucar.netcdf.Dimension[] dims)
                           throws IOException,
                                  VisADException

Returns the VisAD domain set corresponding to an array of netCDF dimension in netCDF order (outermost dimension first).

This implementation supports 1-dimensional coordinate variables, 1-dimensional longitude, and 2-dimensional latitude/longitude domains and assumes that each netCDF dimension is independent of all others. This implementation uses View.getDomainSet(Dimension), View.getDomainSet(Dimension), and getDomainType(Dimension[]).

Parameters:
dims - A netCDF domain. Must be in netCDF order (outer dimension first).
Returns:
The VisAD domain set corresponding to dims.
Throws:
VisADException - Couldn't create necessary VisAD object.
IOException - if a netCDF read-error occurs.

getDomainType

protected MathType getDomainType(ucar.netcdf.Dimension[] dims)
                          throws VisADException

Returns the VisAD MathType corresponding to an array of netCDF dimensions. If the array has zero length, then null is returned.

This implementation uses View.getRealType(Dimension).

Parameters:
dims - netCDF dimensions in netCDF order (outermost dimension first).
Returns:
The type of the domain corresponding to dims. RETURN_VALUE is null, a RealType, or a RealTupleType if dims.length is 0, 1, or greater than 1, respectively.
Throws:
VisADException - Couldn't create necessary VisAD object.