ucar.unidata.view.sounding
Class LayerMeanCell

java.lang.Object
  extended by ucar.unidata.view.sounding.ComputeCell
      extended by ucar.unidata.view.sounding.LayerMeanCell

public final class LayerMeanCell
extends ComputeCell

Computes the mean value of an atmospheric profile parameter over a layer.

Version:
$Revision: 1.7 $ $Date: 2005/05/13 18:33:31 $
Author:
Steven R. Emmerson

Constructor Summary
LayerMeanCell(DataReference proRef, DataReference lowerRef, DataReference upperRef, Real noData)
          Constructs from a reference to the atmospheric profile, references to the lower and upper limits of the layer, and a missing-data value.
 
Method Summary
protected  Data compute(Data[] datums)
          Computes the layer mean value.
 DataReference getMeanPresRef()
          Returns the mean pressure within the just-computed layer.
 
Methods inherited from class ucar.unidata.view.sounding.ComputeCell
clean, disableRef, enableAllInputRefs, getInputRefs, getOutputRef, noDataField, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayerMeanCell

public LayerMeanCell(DataReference proRef,
                     DataReference lowerRef,
                     DataReference upperRef,
                     Real noData)
              throws VisADException,
                     RemoteException
Constructs from a reference to the atmospheric profile, references to the lower and upper limits of the layer, and a missing-data value.

Parameters:
proRef - The atmospheric profile reference.
lowerRef - The lower layer limit.
upperRef - The upper layer limit.
noData - The missing data value.
Throws:
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.
Method Detail

compute

protected Data compute(Data[] datums)
                throws TypeException,
                       VisADException,
                       RemoteException
Computes the layer mean value.

Specified by:
compute in class ComputeCell
Parameters:
datums - The input data. datums[0] is the profile; datums[1] is the lower layer limit; and datums[2] is the upper layer limit.
Returns:
The mean value of the profile parameter.
Throws:
ClassCastException - if an input data reference has the wrong type of data object.
TypeException - if a VisAD data object has the wrong type.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

getMeanPresRef

public DataReference getMeanPresRef()
Returns the mean pressure within the just-computed layer.

Returns:
The mean pressure of the just-computed layer.