visad
Class ErrorEstimate

java.lang.Object
  extended by visad.ErrorEstimate
All Implemented Interfaces:
Serializable, Comparable

public class ErrorEstimate
extends Object
implements Serializable, Comparable

ErrorEstimate is the immutable VisAD class for statistics about a value or array of values.

See Also:
Serialized Form

Constructor Summary
ErrorEstimate(double[] value, double error, Unit u)
          construct an ErrorEstimate for an array of values with an error
ErrorEstimate(double[] value, Unit u, int op, ErrorEstimate a, ErrorEstimate b, int error_mode)
          construct Error for an array of values that is the result of a binary operator; a and b are the ErrorEstimate-s for the operands
ErrorEstimate(double[] value, Unit u, int op, ErrorEstimate a, int error_mode)
          construct Error for an array of values that is the result of a unary operator; a is the ErrorEstimate for the operand
ErrorEstimate(double error, double mean, long number, Unit u)
          construct an error distribution of number values with given mean and error (variance), in Unit unit

Note that the mean and error parameters are reversed in this method
ErrorEstimate(double mean, double error, Unit u)
          construct an error distribution of 1 value with given mean and error (variance), in Unit unit
ErrorEstimate(double value, Unit u, int op, ErrorEstimate a, ErrorEstimate b, int error_mode)
          construct an ErrorEstimate for a value that is the result of a binary operator; a and b are the ErrorEstimate-s for the operands
ErrorEstimate(double value, Unit u, int op, ErrorEstimate a, int error_mode)
          construct an ErrorEstimate for a value that is the result of a unary operator; a is the ErrorEstimate for the operand
ErrorEstimate(ErrorEstimate field_error, ErrorEstimate sample_error, double val, int inc)
          construct an ErrorEstimate from a Field ErrorEstimate, a sample ErrorEstimate, the sample value, and an increment for NumberNotMissing; used by FlatField.setSample
ErrorEstimate(float[] value, double error, Unit u)
          construct an ErrorEstimate for an array of values with an error
ErrorEstimate(float[] value, Unit u, int op, ErrorEstimate a, ErrorEstimate b, int error_mode)
          construct Error for an array of values that is the result of a binary operator; a and b are the ErrorEstimate-s for the operands
ErrorEstimate(float[] value, Unit u, int op, ErrorEstimate a, int error_mode)
          construct Error for an array of values that is the result of a unary operator; a is the ErrorEstimate for the operand
 
Method Summary
 int compareTo(Object obj)
          Compares this error estimate to another.
static ErrorEstimate[] copyErrorsArray(ErrorEstimate[] errors)
          copy a ErrorEstimate[] array; this is a helper for Set, FlatField, etc
 double getErrorValue()
          Get the variance of this error distribution
 double getMean()
          Get the mean value for this error distribution
 long getNumberNotMissing()
          Get the number of values in this error distribution
 Unit getUnit()
          Get the Unit for this error distribution.
 boolean isMissing()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorEstimate

public ErrorEstimate(double error,
                     double mean,
                     long number,
                     Unit u)
construct an error distribution of number values with given mean and error (variance), in Unit unit

Note that the mean and error parameters are reversed in this method


ErrorEstimate

public ErrorEstimate(double mean,
                     double error,
                     Unit u)
construct an error distribution of 1 value with given mean and error (variance), in Unit unit


ErrorEstimate

public ErrorEstimate(ErrorEstimate field_error,
                     ErrorEstimate sample_error,
                     double val,
                     int inc)
              throws VisADException
construct an ErrorEstimate from a Field ErrorEstimate, a sample ErrorEstimate, the sample value, and an increment for NumberNotMissing; used by FlatField.setSample

Throws:
VisADException

ErrorEstimate

public ErrorEstimate(double value,
                     Unit u,
                     int op,
                     ErrorEstimate a,
                     ErrorEstimate b,
                     int error_mode)
              throws VisADException
construct an ErrorEstimate for a value that is the result of a binary operator; a and b are the ErrorEstimate-s for the operands

Throws:
VisADException

ErrorEstimate

public ErrorEstimate(double value,
                     Unit u,
                     int op,
                     ErrorEstimate a,
                     int error_mode)
              throws VisADException
construct an ErrorEstimate for a value that is the result of a unary operator; a is the ErrorEstimate for the operand

Throws:
VisADException

ErrorEstimate

public ErrorEstimate(double[] value,
                     double error,
                     Unit u)
construct an ErrorEstimate for an array of values with an error


ErrorEstimate

public ErrorEstimate(float[] value,
                     double error,
                     Unit u)
construct an ErrorEstimate for an array of values with an error


ErrorEstimate

public ErrorEstimate(double[] value,
                     Unit u,
                     int op,
                     ErrorEstimate a,
                     ErrorEstimate b,
                     int error_mode)
              throws VisADException
construct Error for an array of values that is the result of a binary operator; a and b are the ErrorEstimate-s for the operands

Throws:
VisADException

ErrorEstimate

public ErrorEstimate(float[] value,
                     Unit u,
                     int op,
                     ErrorEstimate a,
                     ErrorEstimate b,
                     int error_mode)
              throws VisADException
construct Error for an array of values that is the result of a binary operator; a and b are the ErrorEstimate-s for the operands

Throws:
VisADException

ErrorEstimate

public ErrorEstimate(double[] value,
                     Unit u,
                     int op,
                     ErrorEstimate a,
                     int error_mode)
              throws VisADException
construct Error for an array of values that is the result of a unary operator; a is the ErrorEstimate for the operand

Throws:
VisADException

ErrorEstimate

public ErrorEstimate(float[] value,
                     Unit u,
                     int op,
                     ErrorEstimate a,
                     int error_mode)
              throws VisADException
construct Error for an array of values that is the result of a unary operator; a is the ErrorEstimate for the operand

Throws:
VisADException
Method Detail

copyErrorsArray

public static ErrorEstimate[] copyErrorsArray(ErrorEstimate[] errors)
copy a ErrorEstimate[] array; this is a helper for Set, FlatField, etc


isMissing

public boolean isMissing()

getMean

public double getMean()
Get the mean value for this error distribution


getErrorValue

public double getErrorValue()
Get the variance of this error distribution


getNumberNotMissing

public long getNumberNotMissing()
Get the number of values in this error distribution


getUnit

public Unit getUnit()
Get the Unit for this error distribution.


toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object obj)
Compares this error estimate to another.

Specified by:
compareTo in interface Comparable
Parameters:
obj - The other error estimate. May be null .
Returns:
A negative integer, zero, or a positive integer depending on whether this ErrorEstimate is considered less than, equal to, or greater than the other ErrorEstimate, respectively. If obj == null, then a positive value is returned. An ErrorEstimate with no unit is considered less than an ErrorEstimate with a unit.