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

public abstract class AbstractCoordTransBuilder
extends Object
implements CoordTransBuilderIF

Abstract superclass for implementations of CoordTransBuilderIF.

Author:
caron

Field Summary
protected  Formatter errBuffer
           
 
Constructor Summary
AbstractCoordTransBuilder()
           
 
Method Summary
protected  boolean addParameter(CoordinateTransform rs, String paramName, NetcdfFile ds, String varNameEscaped)
          Add a Parameter to a CoordinateTransform.
static double getFalseEastingScaleFactor(NetcdfDataset ds, Variable ctv)
           
protected  String getFormula(NetcdfDataset ds, Variable ctv)
           
 VerticalTransform makeMathTransform(NetcdfDataset ds, Dimension timeDim, VerticalCT vCT)
          Make a VerticalTransform.
 String[] parseFormula(String formula_terms, String termString)
           
protected  double readAttributeDouble(Variable v, String attname, double defValue)
          Read a variable attribute as a double.
protected  double[] readAttributeDouble2(Attribute att)
          Read an attribute as double[2].
 void setErrorBuffer(Formatter errBuffer)
          Pass in a Formatter 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 Formatter errBuffer
Constructor Detail

AbstractCoordTransBuilder

public AbstractCoordTransBuilder()
Method Detail

setErrorBuffer

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

Specified by:
setErrorBuffer in interface CoordTransBuilderIF
Parameters:
errBuffer - use this Formatter 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,
                                     String attname,
                                     double defValue)
Read a variable attribute as a double.

Parameters:
v - the variable
attname - name of variable
defValue - default value if attribute is not found
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,
                               String paramName,
                               NetcdfFile ds,
                               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 String getFormula(NetcdfDataset ds,
                            Variable ctv)

parseFormula

public String[] parseFormula(String formula_terms,
                             String termString)

getFalseEastingScaleFactor

public static double getFalseEastingScaleFactor(NetcdfDataset ds,
                                                Variable ctv)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.