| java.lang.Object org.geotools.image.io.netcdf.VariableMetadata
VariableMetadata | final class VariableMetadata (Code) | | Parses the offset, scale factor, minimum, maximum and fill values from a variable. This class
duplicate UCAR's
EnhanceScaleMissingImpl functionality, but we have to do that because:
- I have not been able to find any method giving me directly the offset and scale factor.
We can use some trick with
VariableEnhanced.convertScaleOffsetMissing , but
they are subject to rounding errors and there is no efficient way I can see to take
missing values in account.
- The
VariableEnhanced methods are available only if the variable is enhanced.
Our variable is not, because we want raw (packed) data.
- We want minimum, maximum and fill values in packed units (as opposed to the geophysics
values provided by the UCAR's API), because we check for missing values before to
convert them.
version: $Id: VariableMetadata.java 27583 2007-10-23 11:29:26Z desruisseaux $ author: Martin Desruisseaux |
Field Summary | |
final public double | minimummaximum The minimal and maximal valid values in geophysics units, or infinity if none. | final public double[] | missingValues The fill and missing values in packed units, or
null if none.
Note that this is different from UCAR, who converts to geophysics values. | final public double | scaleoffset The scale and and offset values, or
Double.NaN NaN if none. |
Constructor Summary | |
public | VariableMetadata(VariableEnhanced variable) Extracts metadata from the specified variable using UCAR's API. | public | VariableMetadata(Variable variable, boolean forceRangePacking) Extracts metadata from the specified variable using our own method. |
Method Summary | |
public void | copyTo(Band band) Copies the value in this variable metadata into the specified band. | static int | getRawDataType(VariableIF variable) Returns the data type which most closely represents the "raw" internal data
of the variable. |
minimummaximum | final public double minimummaximum(Code) | | The minimal and maximal valid values in geophysics units, or infinity if none.
They are converted from the packed values if needed, as UCAR does.
|
missingValues | final public double[] missingValues(Code) | | The fill and missing values in packed units, or
null if none.
Note that this is different from UCAR, who converts to geophysics values. We keep packed
values in order to avoir rounding error. This array contains both the fill value and the
missing values, without duplicated values.
|
scaleoffset | final public double scaleoffset(Code) | | The scale and and offset values, or
Double.NaN NaN if none.
|
VariableMetadata | public VariableMetadata(VariableEnhanced variable)(Code) | | Extracts metadata from the specified variable using UCAR's API. This approach suffers
from rounding errors and is unable to get the missing values. Use this constructor
only for comparing our own results with the results from the UCAR's API.
|
VariableMetadata | public VariableMetadata(Variable variable, boolean forceRangePacking)(Code) | | Extracts metadata from the specified variable using our own method.
Parameters: variable - The variable to extract metadata from. Parameters: forceRangePacking - true if the valid range is encoded in geophysics units(which is a violation of CF convention), or false in order to autodetectusing the UCAR heuristic rule. |
copyTo | public void copyTo(Band band)(Code) | | Copies the value in this variable metadata into the specified band.
|
getRawDataType | static int getRawDataType(VariableIF variable)(Code) | | Returns the data type which most closely represents the "raw" internal data
of the variable. This is the value returned by the default implementation of
NetcdfImageReader.getRawDataType .
Parameters: variable - The variable. The data type, or DataBuffer.TYPE_UNDEFINED if unknown. See Also: NetcdfImageReader.getRawDataType |
|
|