|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.Variable
ucar.nc2.dataset.VariableDS
public class VariableDS
An wrapper around a Variable, creating an "enhanced" Variable. The original Variable is used for the I/O. There are several distinct uses:
NetcdfDataset
Field Summary |
---|
Fields inherited from class ucar.nc2.Variable |
---|
defaultSizeToCache |
Constructor Summary | |
---|---|
VariableDS(Group group,
Structure parent,
java.lang.String shortName,
Variable orgVar)
Wrap the given Variable, making it into a VariableDS. |
|
VariableDS(Group g,
Variable orgVar,
boolean enhance)
Wrap the given Variable, making it into a VariableDS. |
|
VariableDS(NetcdfDataset ds,
Group group,
Structure parentStructure,
java.lang.String shortName,
DataType dataType,
java.lang.String dims,
java.lang.String units,
java.lang.String desc)
Constructor when there's no underlying variable. |
Method Summary | |
---|---|
void |
addCoordinateSystem(CoordinateSystem p0)
Add a CoordinateSystem to the dataset. |
void |
clearCoordinateSystems()
Remove coordinate system info. |
Array |
convertScaleOffsetMissing(Array data)
Convert data if hasScaleOffset, using scale and offset. |
double |
convertScaleOffsetMissing(byte value)
Convert this byte value to a double, using scale/offset/missing value if applicable |
double |
convertScaleOffsetMissing(double value)
Convert this double value using scale/offset/missing value if applicable |
double |
convertScaleOffsetMissing(int value)
Convert this int value to a double, using scale/offset/missing value if applicable |
double |
convertScaleOffsetMissing(long value)
Convert this long value to a double, using scale/offset/missing value if applicable |
double |
convertScaleOffsetMissing(short value)
Convert this short value to a double, using scale/offset/missing value if applicable |
void |
enhance(java.util.Set<NetcdfDataset.Enhance> mode)
DO NOT USE DIRECTLY. |
java.util.List<CoordinateSystem> |
getCoordinateSystems()
Get the list of Coordinate Systems for this Variable. |
java.lang.String |
getDescription()
Get the description of the Variable. |
DataType |
getOriginalDataType()
When this wraps another Variable, get the original Variable's DataType. |
java.lang.String |
getOriginalName()
When this wraps another Variable, get the original Variable's name. |
Variable |
getOriginalVariable()
A VariableDS usually wraps another Variable. |
ProxyReader |
getProxyReader()
Get the proxy reader, or null. |
java.lang.String |
getUnitsString()
Get the Unit String for the Variable. |
boolean |
getUseNaNs()
get whether to use NaNs for missing float/double values (for efficiency) |
double |
getValidMax()
return the maximum value in the valid range |
double |
getValidMin()
return the minimum value in the valid range |
boolean |
hasFillValue()
true if Variable has _FillValue attribute |
boolean |
hasInvalidData()
true if Variable has valid_range, valid_min or valid_max attributes |
boolean |
hasMissing()
true if Variable has missing data values |
boolean |
hasMissingValue()
true if Variable has missing_value attribute |
boolean |
hasScaleOffset()
true if Variable data will be converted using scale and offet |
boolean |
isFillValue(double p0)
return true if val equals the _FillValue |
boolean |
isInvalidData(double p0)
return true if val is outside the valid range |
boolean |
isMissing(double val)
true if val is a missing data value. |
boolean |
isMissingFast(double val)
true if val is a missing data value. |
boolean |
isMissingValue(double p0)
return true if val equals a missing_value |
java.lang.String |
lookupEnumString(int val)
Lookup the enum string for this value. |
void |
removeCoordinateSystem(CoordinateSystem p0)
Remove a CoordinateSystem from the dataset. |
void |
setFillValueIsMissing(boolean p0)
set if _FillValue is considered isMissing(); better set in constructor if possible |
void |
setInvalidDataIsMissing(boolean p0)
set if valid_range is considered isMissing(); better set in constructor if possible |
void |
setMissingDataIsMissing(boolean p0)
set if missing_data is considered isMissing(); better set in constructor if possible |
void |
setName(java.lang.String newName)
Set the short name |
void |
setOriginalVariable(Variable orgVar)
Set the Variable to wrap. |
void |
setProxyReader(ProxyReader proxyReader)
Set the proxy reader. |
void |
setUnitsString(java.lang.String units)
Set the Unit String for this Variable. |
void |
setUseNaNs(boolean useNaNs)
set whether to use NaNs for missing float/double values, for efficiency |
java.lang.String |
toStringDebug()
String representation of Variable and its attributes. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public VariableDS(NetcdfDataset ds, Group group, Structure parentStructure, java.lang.String shortName, DataType dataType, java.lang.String dims, java.lang.String units, java.lang.String desc)
ds
- the containing datasetgroup
- the containing groupparentStructure
- the containing Structure (may be null)shortName
- the (short) namedataType
- the data typedims
- list of dimension names, these must already exist in the Group; empty String = scalarunits
- String value of units, may be nulldesc
- String value of description, may be nullpublic VariableDS(Group g, Variable orgVar, boolean enhance)
g
- logical container, if null use orgVar's grouporgVar
- the original Variable to wrap. The original Variable is not modified.
Must not be a Structure, use StructureDS instead.enhance
- if true, use NetcdfDataset.defaultEnhanceMode to define what enhancements are made.
Note that this can change DataType and data values.
You can also call enhance() later. If orgVar is VariableDS, then enhance is inherited from there,
and this parameter is ignored.public VariableDS(Group group, Structure parent, java.lang.String shortName, Variable orgVar)
group
- the containing group; may not be nullparent
- parent Structure, may be nullshortName
- variable shortName, must be unique within the GrouporgVar
- the original Variable to wrap. The original Variable is not modified.
Must not be a Structure, use StructureDS instead.Method Detail |
---|
public void clearCoordinateSystems()
clearCoordinateSystems
in interface VariableEnhanced
public void enhance(java.util.Set<NetcdfDataset.Enhance> mode)
enhance
in interface VariableEnhanced
public void addCoordinateSystem(CoordinateSystem p0)
Enhancements
addCoordinateSystem
in interface Enhancements
p0
- add this Coordinate Systempublic void removeCoordinateSystem(CoordinateSystem p0)
Enhancements
removeCoordinateSystem
in interface Enhancements
p0
- remove this coordinate systempublic java.util.List<CoordinateSystem> getCoordinateSystems()
Enhancements
getCoordinateSystems
in interface Enhancements
public java.lang.String getDescription()
Variable
getDescription
in interface Enhancements
getDescription
in interface VariableIF
getDescription
in interface VariableSimpleIF
getDescription
in class Variable
public java.lang.String getUnitsString()
Variable
getUnitsString
in interface Enhancements
getUnitsString
in interface VariableIF
getUnitsString
in interface VariableSimpleIF
getUnitsString
in class Variable
public void setUnitsString(java.lang.String units)
VariableEnhanced
setUnitsString
in interface VariableEnhanced
units
- unit stringpublic Array convertScaleOffsetMissing(Array data)
EnhanceScaleMissing
convertScaleOffsetMissing
in interface EnhanceScaleMissing
data
- convert this
public double getValidMax()
EnhanceScaleMissing
getValidMax
in interface EnhanceScaleMissing
public double getValidMin()
EnhanceScaleMissing
getValidMin
in interface EnhanceScaleMissing
public boolean hasFillValue()
EnhanceScaleMissing
hasFillValue
in interface EnhanceScaleMissing
public boolean hasInvalidData()
EnhanceScaleMissing
hasInvalidData
in interface EnhanceScaleMissing
public boolean hasMissing()
EnhanceScaleMissing
hasMissing
in interface EnhanceScaleMissing
public boolean hasMissingValue()
EnhanceScaleMissing
hasMissingValue
in interface EnhanceScaleMissing
public boolean hasScaleOffset()
EnhanceScaleMissing
hasScaleOffset
in interface EnhanceScaleMissing
public boolean isFillValue(double p0)
EnhanceScaleMissing
isFillValue
in interface EnhanceScaleMissing
public boolean isInvalidData(double p0)
EnhanceScaleMissing
isInvalidData
in interface EnhanceScaleMissing
public boolean isMissing(double val)
EnhanceScaleMissing
isMissing
in interface EnhanceScaleMissing
public boolean isMissingFast(double val)
EnhanceScaleMissing
isMissingFast
in interface EnhanceScaleMissing
public boolean isMissingValue(double p0)
EnhanceScaleMissing
isMissingValue
in interface EnhanceScaleMissing
public void setFillValueIsMissing(boolean p0)
EnhanceScaleMissing
setFillValueIsMissing
in interface EnhanceScaleMissing
public void setInvalidDataIsMissing(boolean p0)
EnhanceScaleMissing
setInvalidDataIsMissing
in interface EnhanceScaleMissing
public void setMissingDataIsMissing(boolean p0)
EnhanceScaleMissing
setMissingDataIsMissing
in interface EnhanceScaleMissing
public void setUseNaNs(boolean useNaNs)
EnhanceScaleMissing
setUseNaNs
in interface EnhanceScaleMissing
public boolean getUseNaNs()
EnhanceScaleMissing
getUseNaNs
in interface EnhanceScaleMissing
public double convertScaleOffsetMissing(byte value)
EnhanceScaleMissing
convertScaleOffsetMissing
in interface EnhanceScaleMissing
public double convertScaleOffsetMissing(short value)
EnhanceScaleMissing
convertScaleOffsetMissing
in interface EnhanceScaleMissing
public double convertScaleOffsetMissing(int value)
EnhanceScaleMissing
convertScaleOffsetMissing
in interface EnhanceScaleMissing
public double convertScaleOffsetMissing(long value)
EnhanceScaleMissing
convertScaleOffsetMissing
in interface EnhanceScaleMissing
public double convertScaleOffsetMissing(double value)
EnhanceScaleMissing
convertScaleOffsetMissing
in interface EnhanceScaleMissing
public Variable getOriginalVariable()
getOriginalVariable
in interface VariableEnhanced
public void setOriginalVariable(Variable orgVar)
setOriginalVariable
in interface VariableEnhanced
orgVar
- original Variable, must not be a Structurepublic DataType getOriginalDataType()
public java.lang.String getOriginalName()
getOriginalName
in interface VariableEnhanced
public java.lang.String lookupEnumString(int val)
Variable
lookupEnumString
in class Variable
val
- the integer value of this enum
public void setName(java.lang.String newName)
Variable
setName
in class Variable
newName
- set to this valuepublic void setProxyReader(ProxyReader proxyReader)
setProxyReader
in interface VariableEnhanced
proxyReader
- set to thispublic ProxyReader getProxyReader()
getProxyReader
in interface VariableEnhanced
public java.lang.String toStringDebug()
Variable
toStringDebug
in interface VariableIF
toStringDebug
in class Variable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |