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, McIDASAreaTransformBuilder, Mercator, Orthographic, PolarStereographic, RotatedLatLon, RotatedPole, Stereographic, TransverseMercator, UTM, VAtmHybridHeight, VAtmHybridSigmaPressure, VAtmLnPressure, VAtmSigma, VerticalPerspective, VExplicitField, VOceanS, VOceanSigma, WRFEtaTransformBuilder

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

Abstract superclass for implementations of CoordTransBuilderIF.

Author:
caron

Field Summary
protected  java.lang.StringBuilder errBuffer
           
 
Constructor Summary
AbstractCoordTransBuilder()
           
 
Method Summary
protected  boolean addParameter(CoordinateTransform rs, java.lang.String paramName, NetcdfFile ds, java.lang.String varNameEscaped)
          Add a Parameter to a CoordinateTransform.
static double getFalseEastingScaleFactor(NetcdfDataset ds, Variable ctv)
           
protected  java.lang.String getFormula(NetcdfDataset ds, Variable ctv)
           
 VerticalTransform makeMathTransform(NetcdfDataset ds, Dimension timeDim, VerticalCT vCT)
          Make a VerticalTransform.
 java.lang.String[] parseFormula(java.lang.String formula_terms, java.lang.String termString)
           
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.StringBuilder errBuffer)
          Pass in a StringBuilder 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.StringBuilder errBuffer
Constructor Detail

AbstractCoordTransBuilder

public AbstractCoordTransBuilder()
Method Detail

setErrorBuffer

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

Specified by:
setErrorBuffer in interface CoordTransBuilderIF
Parameters:
errBuffer - use this StringBuilder to record parse and error info

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, else NaN if not found

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 varNameEscaped)
Add a Parameter to a CoordinateTransform. Make sure that the variable exists. 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
varNameEscaped - escaped variable name
Returns:
true if success, false is failed

getFormula

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

parseFormula

public java.lang.String[] parseFormula(java.lang.String formula_terms,
                                       java.lang.String termString)

getFalseEastingScaleFactor

public static double getFalseEastingScaleFactor(NetcdfDataset ds,
                                                Variable ctv)