public class VariableDS extends Variable implements VariableEnhanced, EnhanceScaleMissing
NetcdfDatasetVariable.Cache| Modifier and Type | Field and Description |
|---|---|
protected DataType |
orgDataType |
protected java.lang.String |
orgName |
protected Variable |
orgVar |
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, hashCode, isMetadata, isVariableLength, ncfile, permitCaching, proxyReader, shape, shapeAsSection, sizeToCache, spiObjectannotations, dodsname, group, immutable, parentstruct, shortName, sort| Modifier | Constructor and Description |
|---|---|
|
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.
|
protected |
VariableDS(VariableDS vds,
boolean isCopy)
Copy constructor, for subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
protected Array |
_read() |
protected Array |
_read(Section section) |
void |
addCoordinateSystem(CoordinateSystem p0)
Add a CoordinateSystem to the dataset.
|
void |
clearCoordinateSystems()
Remove coordinate system info.
|
protected Array |
convertEnums(Array values) |
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
|
protected Variable |
copy() |
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 |
getDatasetLocation() |
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.
|
long |
readToStream(Section section,
java.io.OutputStream out) |
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 |
setCaching(boolean caching)
Set whether to cache or not.
|
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
|
java.lang.String |
setName(java.lang.String newName)
Set the short name, converting to valid CDM object name if needed.
|
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.
|
addAll, addAttribute, compareTo, createNewCache, equals, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDAPName, getDAPName, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getElementSize, getEnumTypedef, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNetcdfFile, getParentGroup, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getShapeNotScalar, getSize, getSizeToCache, getSPobject, hasCachedData, hashCode, hashCodeShow, invalidateCache, isCaching, isCoordinateVariable, isImmutable, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, reduce, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setImmutable, setIsScalar, setParentGroup, setProxyReader, setSizeToCache, setSPobject, setUnsigned, setValues, setValues, slice, toString, writeCDL, writeCDLannotate, getAnnotation, getAnnotations, getDODSName, getFullName, getFullNameEscaped, getGroup, getImmutable, getName, getParentStructure, getShortName, getSort, isMemberOfStructure, localhash, setDODSName, setImmutable, setParentStructure, setShortName, setSort, unwrapclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getEnumTypedef, getFullName, getFullNameEscaped, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShapeAsSection, getShortName, getSize, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, sectiongetNameprotected Variable orgVar
protected DataType orgDataType
protected java.lang.String orgName
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 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.protected VariableDS(VariableDS vds, boolean isCopy)
vds - copy from here.isCopy - called from copy()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)
EnhancementsaddCoordinateSystem in interface Enhancementsp0 - add this Coordinate Systempublic void removeCoordinateSystem(CoordinateSystem p0)
EnhancementsremoveCoordinateSystem in interface Enhancementsp0 - remove this coordinate systempublic java.util.List<CoordinateSystem> getCoordinateSystems()
EnhancementsgetCoordinateSystems in interface Enhancementspublic java.lang.String getDescription()
VariablegetDescription in interface EnhancementsgetDescription in interface VariableIFgetDescription in interface VariableSimpleIFgetDescription in class Variablepublic java.lang.String getUnitsString()
VariablegetUnitsString in interface EnhancementsgetUnitsString in interface VariableIFgetUnitsString in interface VariableSimpleIFgetUnitsString in class Variablepublic void setUnitsString(java.lang.String units)
VariableEnhancedsetUnitsString in interface VariableEnhancedunits - unit stringpublic Array convertScaleOffsetMissing(Array data)
EnhanceScaleMissingconvertScaleOffsetMissing in interface EnhanceScaleMissingdata - convert thispublic double getValidMax()
EnhanceScaleMissinggetValidMax in interface EnhanceScaleMissingpublic double getValidMin()
EnhanceScaleMissinggetValidMin in interface EnhanceScaleMissingpublic boolean hasFillValue()
EnhanceScaleMissinghasFillValue in interface EnhanceScaleMissingpublic boolean hasInvalidData()
EnhanceScaleMissinghasInvalidData in interface EnhanceScaleMissingpublic boolean hasMissing()
EnhanceScaleMissinghasMissing in interface IsMissingEvaluatorhasMissing in interface EnhanceScaleMissingpublic boolean hasMissingValue()
EnhanceScaleMissinghasMissingValue in interface EnhanceScaleMissingpublic boolean hasScaleOffset()
EnhanceScaleMissinghasScaleOffset in interface EnhanceScaleMissingpublic boolean isFillValue(double p0)
EnhanceScaleMissingisFillValue in interface EnhanceScaleMissingpublic boolean isInvalidData(double p0)
EnhanceScaleMissingisInvalidData in interface EnhanceScaleMissingpublic boolean isMissing(double val)
EnhanceScaleMissingisMissing in interface IsMissingEvaluatorisMissing in interface EnhanceScaleMissingval - unpacked valuepublic boolean isMissingFast(double val)
EnhanceScaleMissingisMissingFast in interface EnhanceScaleMissingval - unpacked valuepublic boolean isMissingValue(double p0)
EnhanceScaleMissingisMissingValue in interface EnhanceScaleMissingpublic void setFillValueIsMissing(boolean p0)
EnhanceScaleMissingsetFillValueIsMissing in interface EnhanceScaleMissingpublic void setInvalidDataIsMissing(boolean p0)
EnhanceScaleMissingsetInvalidDataIsMissing in interface EnhanceScaleMissingpublic void setMissingDataIsMissing(boolean p0)
EnhanceScaleMissingsetMissingDataIsMissing in interface EnhanceScaleMissingpublic void setUseNaNs(boolean useNaNs)
EnhanceScaleMissingsetUseNaNs in interface EnhanceScaleMissingpublic boolean getUseNaNs()
EnhanceScaleMissinggetUseNaNs in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(byte value)
EnhanceScaleMissingconvertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(short value)
EnhanceScaleMissingconvertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(int value)
EnhanceScaleMissingconvertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(long value)
EnhanceScaleMissingconvertScaleOffsetMissing in interface EnhanceScaleMissingpublic double convertScaleOffsetMissing(double value)
EnhanceScaleMissingconvertScaleOffsetMissing 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)
VariablelookupEnumString in class Variableval - the integer value of this enumpublic java.lang.String setName(java.lang.String newName)
Variablepublic java.lang.String toStringDebug()
VariabletoStringDebug in interface VariableIFtoStringDebug in class Variablepublic java.lang.String getDatasetLocation()
getDatasetLocation in class Variablepublic boolean hasCachedDataRecurse()
public void setCaching(boolean caching)
VariablesetCaching in class Variablecaching - set if caching.protected Array _read() throws java.io.IOException
public Array reallyRead(Variable client, CancelTask cancelTask) throws java.io.IOException
VariablereallyRead in interface ProxyReaderreallyRead in class Variableclient - the client VariablecancelTask - user may canceljava.io.IOException - on errorprotected Array _read(Section section) throws java.io.IOException, InvalidRangeException
_read in class Variablejava.io.IOExceptionInvalidRangeExceptionpublic Array reallyRead(Variable client, Section section, CancelTask cancelTask) throws java.io.IOException, InvalidRangeException
VariablereallyRead in interface ProxyReaderreallyRead in class Variableclient - the client Variablesection - the section of data to read.cancelTask - user may canceljava.io.IOException - on errorInvalidRangeException - if section has incorrect rank or illegal shape.public long readToStream(Section section, java.io.OutputStream out) throws java.io.IOException, InvalidRangeException
readToStream in class Variablejava.io.IOExceptionInvalidRangeExceptionpublic Array getMissingDataArray(int[] shape)
shape - of this shapepublic void showScaleMissingProxy(java.util.Formatter f)
f - put info here