Package noaa.coastwatch.util
Class VariableEstimator
java.lang.Object
noaa.coastwatch.util.VariableEstimator
- All Implemented Interfaces:
Encodable
,ValueSource
The
VariableEstimator
class provides an
approximation of smoothly changing variable data using
quadratic polynomials. Currently only 1D and 2D data
variables are supported. The estimator uses an EarthPartition
object and derives the polynomials
individually on each partition. If the polynomials cannot be
derived for a given partition (due to small partition size or
missing data values), a Double.NaN
value is
returned by getValue(noaa.coastwatch.util.DataLocation)
for any location in the affected
partition.- Since:
- 3.1.0
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionVariableEstimator
(Object obj) Constructs a variable estimator from the specified encoding.VariableEstimator
(Object obj, VariableEstimator est) Constructs a variable estimator from the specified encoding and the same earth transform and partitioning as the specified variable estimator.VariableEstimator
(DataVariable var, Filter filter, EarthTransform trans, double maxSize, int[] maxDims) Constructs a variable estimator for the specified variable, filter, and earth transform.VariableEstimator
(DataVariable var, Filter filter, VariableEstimator est) Constructs a variable estimator for the specified variable and filter using the same earth transform and partitioning as the specified variable estimator.VariableEstimator
(DataVariable var, EarthTransform trans, double maxSize, int[] maxDims) Constructs a variable estimator for the specified variable and earth transform.VariableEstimator
(DataVariable var, VariableEstimator est) Constructs a variable estimator for the specified variable using the same earth transform and partitioning as the specified variable estimator. -
Method Summary
Modifier and TypeMethodDescriptionGets an encoded representation of this variable estimator.double
getValue
(DataLocation loc) Gets an estimated variable value.void
useEncoding
(Object obj) Constructs an estimator from the specified encoding.
-
Constructor Details
-
VariableEstimator
Constructs a variable estimator for the specified variable using the same earth transform and partitioning as the specified variable estimator.- Parameters:
var
- the data variable for estimation.est
- the variable estimator to use for earth partitioning information.
-
VariableEstimator
Constructs a variable estimator for the specified variable and filter using the same earth transform and partitioning as the specified variable estimator.- Parameters:
var
- the data variable for estimation.filter
- the data filtering function. The filter is called with the data value array for each partition prior to creating the estimator object.est
- the variable estimator to use for earth partitioning information.
-
VariableEstimator
public VariableEstimator(DataVariable var, EarthTransform trans, double maxSize, int[] maxDims) throws UnsupportedOperationException Constructs a variable estimator for the specified variable and earth transform.- Parameters:
var
- the data variable for estimation.trans
- the earth transform to use for partitioning.maxSize
- the maximum polynomial partition size in kilometers.maxDims
- the maximum partition size in any dimension in terms of data locations.- Throws:
UnsupportedOperationException
- if the variable rank is not supported.- See Also:
-
VariableEstimator
public VariableEstimator(DataVariable var, Filter filter, EarthTransform trans, double maxSize, int[] maxDims) throws UnsupportedOperationException Constructs a variable estimator for the specified variable, filter, and earth transform.- Parameters:
var
- the data variable for estimation.filter
- the data filtering function. The filter is called with the data value array for each partition prior to creating the estimator object.trans
- the earth transform to use for partitioning.maxSize
- the maximum polynomial partition size in kilometers.maxDims
- the maximum partition size in any dimension in terms of data locations.- Throws:
UnsupportedOperationException
- if the variable rank is not supported.- See Also:
-
VariableEstimator
Constructs a variable estimator from the specified encoding. The encoding must be a valid encoding of the estimator as created bygetEncoding
.- Parameters:
obj
- the object encoding.- See Also:
-
VariableEstimator
Constructs a variable estimator from the specified encoding and the same earth transform and partitioning as the specified variable estimator.- Parameters:
obj
- the variable estimator encoding.est
- the variable estimator to use for earth partitioning information.
-
-
Method Details
-
getValue
Gets an estimated variable value. The value is calculated using the polynomial approximation function.- Specified by:
getValue
in interfaceValueSource
- Parameters:
loc
- the data value location.- Returns:
- the estimated value, or Double.NaN if no value could be estimated.
-
getEncoding
Gets an encoded representation of this variable estimator. The encoding may later be used to recreate the estimator without using the original variable data.- Specified by:
getEncoding
in interfaceEncodable
- Returns:
- the object encoding. The encoding object is an
Object[3]
array containing:- a
BitSet
object used for encoding partition structure information - a
List
ofdouble[]
coordinates specifying partition boundaries as min and max (2 arrays per partition) - a
List
ofdouble[]
arrays specifying partition estimator coefficients
- a
- See Also:
-
useEncoding
Constructs an estimator from the specified encoding. The encoding must be a valid encoding of an estimator as created bygetEncoding
.- Specified by:
useEncoding
in interfaceEncodable
- Parameters:
obj
- the object encoding.- See Also:
-