Class Stx
- java.lang.Object
-
- org.esa.snap.core.datamodel.Stx
-
public class Stx extends Object
Provides statistic information for a raster data node at a given image resolution level. Instances of theStxclass are created using theStxFactory.Important note: This class has been revised in BEAM 4.10. All behaviour has been moved to
StxFactoryleaving behind this class as a pure data container. Statistics are now furthermore derived upon geo-physically interpreted image data (before it operated on the raw, unscaled data). Thus, it is not required to scale the returned statistical properties, e.g. we used to writeband.scale(stx.getMean). This is not required anymore.- Since:
- BEAM 4.2, full revision in 4.10
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_BIN_COUNTstatic ScalingLOG10_SCALING
-
Constructor Summary
Constructors Constructor Description Stx(double minimum, double maximum, double mean, double standardDeviation, double coeffOfVariation, double enl, boolean logHistogram, boolean intHistogram, javax.media.jai.Histogram histogram, int resolutionLevel)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetCoefficientOfVariation()doublegetEquivalentNumberOfLooks()javax.media.jai.HistogramgetHistogram()Gets the histogram computed from image samples.intgetHistogramBinCount()doublegetHistogramBinMaximum(int binIndex)Gets the (exclusive) maximum value of the histogram bin given by the bin index.doublegetHistogramBinMinimum(int binIndex)Gets the (inclusive) minimum value of the histogram bin given by the bin index.int[]getHistogramBins()doublegetHistogramBinWidth()Gets the width of any histogram bin.doublegetHistogramBinWidth(int binIndex)Gets the width of the histogram bin given by the bin index.ScalinggetHistogramScaling()doublegetMaximum()doublegetMean()doublegetMedian()doublegetMinimum()intgetResolutionLevel()longgetSampleCount()doublegetStandardDeviation()booleanisIntHistogram()booleanisLogHistogram()
-
-
-
Field Detail
-
DEFAULT_BIN_COUNT
public static final int DEFAULT_BIN_COUNT
- See Also:
- Constant Field Values
-
LOG10_SCALING
public static final Scaling LOG10_SCALING
-
-
Constructor Detail
-
Stx
public Stx(double minimum, double maximum, double mean, double standardDeviation, double coeffOfVariation, double enl, boolean logHistogram, boolean intHistogram, javax.media.jai.Histogram histogram, int resolutionLevel)Constructor. Avoid using it directly. instead, use theStxFactorysince the constructor may change in the future.- Parameters:
minimum- the minimum value, if it isDouble.NaNthe minimum is taken from thehistogrammaximum- the maximum value, if it isDouble.NaNthe maximum is taken from thehistogrammean- the mean value, if it isDouble.NaNthe mean is taken from thehistogramstandardDeviation- the value of the standard deviation, if it isDouble.NaNit is taken from thehistogramcoeffOfVariation- the Coefficient of Variationenl- Equivalent number of lookslogHistogram-trueif the histogram has been computed on logarithms, seegetHistogram()intHistogram-trueif the histogram has been computed from integer samples, seegetHistogram()histogram- the histogramresolutionLevel- the resolution level thisStxis for
-
-
Method Detail
-
getMinimum
public double getMinimum()
- Returns:
- The minimum value.
-
getMaximum
public double getMaximum()
- Returns:
- The maximum value.
-
getMean
public double getMean()
- Returns:
- The mean value.
-
getMedian
public double getMedian()
- Returns:
- The median value (estimation based on Gaussian distribution).
-
getStandardDeviation
public double getStandardDeviation()
- Returns:
- The standard deviation value.
-
getCoefficientOfVariation
public double getCoefficientOfVariation()
-
getEquivalentNumberOfLooks
public double getEquivalentNumberOfLooks()
-
getHistogram
public javax.media.jai.Histogram getHistogram()
Gets the histogram computed from image samples.The returned histogram may have been computed on the logarithms of image samples. In this case
isLogHistogram()returns true and it is expected that the histogram has been computed from logarithms (base 10) of image samples. Therefore, any statistical property retrieved from the returned histogram object such as low value, high value, bin low value, mean, moment, entropy, etc. must be raised to the power of 10. Scaling is best done using thegetHistogramScaling()object.The returned histogram may furthermore be computed from integer image data. In this case
isIntHistogram()returns true and the high value of the histogram is by one higher than the value returned bygetMinimum().The
numBandsproperty of the histogram will always be 1.- Returns:
- The histogram.
- See Also:
isIntHistogram(),isLogHistogram(),getHistogramScaling()
-
isIntHistogram
public boolean isIntHistogram()
- Returns:
trueif the histogram is computed from integer samples.- See Also:
getHistogram()
-
isLogHistogram
public boolean isLogHistogram()
- Returns:
trueif the histogram is computed from log-samples.- See Also:
getHistogram(),getHistogramScaling()
-
getHistogramBinMinimum
public double getHistogramBinMinimum(int binIndex)
Gets the (inclusive) minimum value of the histogram bin given by the bin index.The value returned is in units of the image samples,
histogram scalingis already applied- Parameters:
binIndex- The bin index.- Returns:
- The (inclusive) minimum value of the bin given by the bin index.
-
getHistogramBinMaximum
public double getHistogramBinMaximum(int binIndex)
Gets the (exclusive) maximum value of the histogram bin given by the bin index.The value returned is in units of the image samples,
histogram scalingis already applied- Parameters:
binIndex- The bin index.- Returns:
- The (exclusive) maximum value of the bin given by the bin index.
-
getHistogramBinWidth
public double getHistogramBinWidth()
Gets the width of any histogram bin.The method's return value is undefined if
isLogHistogram()returnstrue. In this case you will have to usegetHistogramBinWidth(int).- Returns:
- The width of any histogram bin.
-
getHistogramBinWidth
public double getHistogramBinWidth(int binIndex)
Gets the width of the histogram bin given by the bin index.The value returned is in units of the image samples,
histogram scalingis already applied- Parameters:
binIndex- The bin index.- Returns:
- The width of the bin given by the bin index.
-
getHistogramBins
public int[] getHistogramBins()
- Returns:
- The histogram bins (sample counts).
-
getHistogramBinCount
public int getHistogramBinCount()
- Returns:
- The number of bins.
-
getHistogramScaling
public Scaling getHistogramScaling()
- Returns:
- The image sample scaling used for deriving the histogram.
-
getSampleCount
public long getSampleCount()
- Returns:
- The total number of samples seen.
-
getResolutionLevel
public int getResolutionLevel()
- Returns:
- The image resolution level.
-
-