|
||||||||||
| 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 |
|---|
defaultCoordsSizeToCache, defaultSizeToCache |
| Constructor Summary | |
|---|---|
VariableDS(Group group,
Structure parent,
java.lang.String shortName,
Variable orgVar)
Make a new VariableDS, delegate data reading to the original variable, but otherwise dont take any info from it. |
|
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. |
java.util.EnumSet<NetcdfDataset.Enhance> |
getEnhanceMode()
Get the enhancement mode |
Array |
getMissingDataArray(int[] shape)
Return Array with missing data |
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. |
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 |
hasCachedDataRecurse()
|
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. |
Array |
reallyRead(Variable client,
CancelTask cancelTask)
public by accident, do not call directly. |
Array |
reallyRead(Variable client,
Section section,
CancelTask cancelTask)
public by accident, do not call directly. |
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 |
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 |
void |
showScaleMissingProxy(java.util.Formatter f)
public for debugging |
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 null
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.
public 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.| Method Detail |
|---|
public void clearCoordinateSystems()
clearCoordinateSystems in interface VariableEnhancedpublic void enhance(java.util.Set<NetcdfDataset.Enhance> mode)
enhance in interface VariableEnhancedpublic java.util.EnumSet<NetcdfDataset.Enhance> getEnhanceMode()
public void addCoordinateSystem(CoordinateSystem p0)
Enhancements
addCoordinateSystem in interface Enhancementsp0 - add this Coordinate Systempublic void removeCoordinateSystem(CoordinateSystem p0)
Enhancements
removeCoordinateSystem in interface Enhancementsp0 - remove this coordinate systempublic java.util.List<CoordinateSystem> getCoordinateSystems()
Enhancements
getCoordinateSystems in interface Enhancementspublic java.lang.String getDescription()
Variable
getDescription in interface EnhancementsgetDescription in interface VariableIFgetDescription in interface VariableSimpleIFgetDescription in class Variablepublic java.lang.String getUnitsString()
Variable
getUnitsString in interface EnhancementsgetUnitsString in interface VariableIFgetUnitsString in interface VariableSimpleIFgetUnitsString in class Variablepublic void setUnitsString(java.lang.String units)
VariableEnhanced
setUnitsString in interface VariableEnhancedunits - unit stringpublic Array convertScaleOffsetMissing(Array data)
EnhanceScaleMissing
convertScaleOffsetMissing in interface EnhanceScaleMissingdata - convert this
public double getValidMax()
EnhanceScaleMissing
getValidMax in interface EnhanceScaleMissingpublic double getValidMin()
EnhanceScaleMissing
getValidMin in interface EnhanceScaleMissingpublic boolean hasFillValue()
EnhanceScaleMissing
hasFillValue in interface EnhanceScaleMissingpublic boolean hasInvalidData()
EnhanceScaleMissing
hasInvalidData in interface EnhanceScaleMissingpublic boolean hasMissing()
EnhanceScaleMissing
hasMissing in interface EnhanceScaleMissingpublic boolean hasMissingValue()
EnhanceScaleMissing
hasMissingValue in interface EnhanceScaleMissingpublic boolean hasScaleOffset()
EnhanceScaleMissing
hasScaleOffset in interface EnhanceScaleMissingpublic boolean isFillValue(double p0)
EnhanceScaleMissing
isFillValue in interface EnhanceScaleMissingpublic boolean isInvalidData(double p0)
EnhanceScaleMissing
isInvalidData in interface EnhanceScaleMissingpublic boolean isMissing(double val)
EnhanceScaleMissing
isMissing in interface EnhanceScaleMissingval - unpacked value
public boolean isMissingFast(double val)
EnhanceScaleMissing
isMissingFast in interface EnhanceScaleMissingval - unpacked value
public boolean isMissingValue(double p0)
EnhanceScaleMissing
isMissingValue in interface EnhanceScaleMissingpublic void setFillValueIsMissing(boolean p0)
EnhanceScaleMissing
setFillValueIsMissing in interface EnhanceScaleMissingpublic void setInvalidDataIsMissing(boolean p0)
EnhanceScaleMissing
setInvalidDataIsMissing in interface EnhanceScaleMissingpublic void setMissingDataIsMissing(boolean p0)
EnhanceScaleMissing
setMissingDataIsMissing in interface EnhanceScaleMissingpublic void setUseNaNs(boolean useNaNs)
EnhanceScaleMissing
setUseNaNs in interface EnhanceScaleMissingpublic boolean getUseNaNs()
EnhanceScaleMissing
getUseNaNs in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(byte value)
EnhanceScaleMissing
convertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(short value)
EnhanceScaleMissing
convertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(int value)
EnhanceScaleMissing
convertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(long value)
EnhanceScaleMissing
convertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(double value)
EnhanceScaleMissing
convertScaleOffsetMissing in interface EnhanceScaleMissingpublic Variable getOriginalVariable()
getOriginalVariable in interface VariableEnhancedpublic void setOriginalVariable(Variable orgVar)
setOriginalVariable in interface VariableEnhancedorgVar - original Variable, must not be a Structurepublic DataType getOriginalDataType()
public java.lang.String getOriginalName()
getOriginalName in interface VariableEnhancedpublic java.lang.String lookupEnumString(int val)
Variable
lookupEnumString in class Variableval - the integer value of this enum
public void setName(java.lang.String newName)
Variable
setName in class VariablenewName - set to this valuepublic java.lang.String toStringDebug()
Variable
toStringDebug in interface VariableIFtoStringDebug in class Variablepublic boolean hasCachedDataRecurse()
public Array reallyRead(Variable client,
CancelTask cancelTask)
throws java.io.IOException
Variable
reallyRead in interface ProxyReaderreallyRead in class Variableclient - the client VariablecancelTask - user may cancel
java.io.IOException - on error
public Array reallyRead(Variable client,
Section section,
CancelTask cancelTask)
throws java.io.IOException,
InvalidRangeException
Variable
reallyRead in interface ProxyReaderreallyRead in class Variableclient - the client Variablesection - the section of data to read.cancelTask - user may cancel
java.io.IOException - on error
InvalidRangeException - if section has incorrect rank or illegal shape.public Array getMissingDataArray(int[] shape)
shape - of this shape
public void showScaleMissingProxy(java.util.Formatter f)
f - put info here
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||