ucar.nc2.dataset.transform
Class AbstractCoordTransBuilder

java.lang.Object
  extended by ucar.nc2.dataset.transform.AbstractCoordTransBuilder
All Implemented Interfaces:
CoordTransBuilderIF
Direct Known Subclasses:
AlbersEqualArea, FlatEarth, LambertAzimuthal, LambertConformalConic, McIDASArea, Mercator, Orthographic, PolarStereographic, Stereographic, TransverseMercator, UTM, VAtmHybridHeight, VAtmHybridSigmaPressure, VAtmSigma, VerticalPerspective, VExplicitField, VOceanS, VOceanSigma, WRFEtaTransformBuilder

public abstract class AbstractCoordTransBuilder
extends java.lang.Object
implements CoordTransBuilderIF

Abstract superclass for implementations of CoordTransBuilderIF.

Version:
$Revision:51 $ $Date:2006-07-12 17:13:13Z $
Author:
caron

Field Summary
protected  java.lang.StringBuffer errBuffer
           
 
Constructor Summary
AbstractCoordTransBuilder()
           
 
Method Summary
protected  boolean addParameter(CoordinateTransform rs, java.lang.String paramName, NetcdfFile ds, java.lang.String varName)
          Add a Parameter to a CoordinateTransform.
protected  java.lang.String getFormula(NetcdfDataset ds, Variable ctv)
           
protected  java.lang.String getUnits(NetcdfDataset ds)
           
 VerticalTransform makeMathTransform(NetcdfDataset ds, Dimension timeDim, VerticalCT vCT)
          Make a VerticalTransform.
protected  double readAttributeDouble(Variable v, java.lang.String attname)
          Read a variable attribute as a double.
protected  double[] readAttributeDouble2(Attribute att)
          Read an attribute as double[2].
 void setErrorBuffer(java.lang.StringBuffer errBuffer)
          Pass in a StringBuffer where error messages can be appended.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.dataset.CoordTransBuilderIF
getTransformName, getTransformType, makeCoordinateTransform
 

Field Detail

errBuffer

protected java.lang.StringBuffer errBuffer
Constructor Detail

AbstractCoordTransBuilder

public AbstractCoordTransBuilder()
Method Detail

setErrorBuffer

public void setErrorBuffer(java.lang.StringBuffer errBuffer)
Description copied from interface: CoordTransBuilderIF
Pass in a StringBuffer where error messages can be appended.

Specified by:
setErrorBuffer in interface CoordTransBuilderIF

makeMathTransform

public VerticalTransform makeMathTransform(NetcdfDataset ds,
                                           Dimension timeDim,
                                           VerticalCT vCT)
Description copied from interface: CoordTransBuilderIF
Make a VerticalTransform. Only implement if you are a TransformType.Vertical. We need to defer making the transform until we've identified the time coordinate dimension.

Specified by:
makeMathTransform in interface CoordTransBuilderIF
Parameters:
ds - the dataset
timeDim - the time dimension
vCT - the vertical coordinate transform
Returns:
ucar.unidata.geoloc.vertical.VerticalTransform math transform

readAttributeDouble

protected double readAttributeDouble(Variable v,
                                     java.lang.String attname)
Read a variable attribute as a double.

Parameters:
v - the variable
attname - name of variable
Returns:
attribute value as a double

readAttributeDouble2

protected double[] readAttributeDouble2(Attribute att)
Read an attribute as double[2]. If only one value, make second same as first.

Parameters:
att - the attribute. May be numeric or String.
Returns:
attribute value as a double[2]

addParameter

protected boolean addParameter(CoordinateTransform rs,
                               java.lang.String paramName,
                               NetcdfFile ds,
                               java.lang.String varName)
Add a Parameter to a CoordinateTransform. Make sure that variable exist. If readData is true, read the data and use it as the value of the parameter, otherwise use the variable name as the value of the parameter.

Parameters:
rs - the CoordinateTransform
paramName - the parameter name
ds - dataset
varName - variable name
Returns:
true if success, false is failed

getFormula

protected java.lang.String getFormula(NetcdfDataset ds,
                                      Variable ctv)

getUnits

protected java.lang.String getUnits(NetcdfDataset ds)