public class VariableDS extends Variable implements EnhanceScaleMissingUnsigned, VariableEnhanced
| Modifier and Type | Class and Description |
|---|---|
static class |
VariableDS.Builder<T extends VariableDS.Builder<T>> |
Variable.Cache| Modifier and Type | Field and Description |
|---|---|
protected ArrayType |
orgDataType |
protected String |
orgName |
protected Variable |
orgVar |
attributes, cache, dataType, dimensions, elementSize, hashCode, isVariableLength, ncfile, permitCaching, proxyReader, shape, spiObject| Modifier | Constructor and Description |
|---|---|
protected |
VariableDS(VariableDS.Builder<?> builder,
Group parentGroup) |
| Modifier and Type | Method and Description |
|---|---|
protected Array |
_read()
Deprecated.
|
protected Array |
_read(Section section)
Deprecated.
|
protected VariableDS.Builder<?> |
addLocalFieldsToBuilder(VariableDS.Builder<? extends VariableDS.Builder<?>> builder) |
Array |
applyScaleOffset(Array data)
Deprecated.
do not use
|
double |
applyScaleOffset(Number value)
Deprecated.
do not use
|
static VariableDS.Builder<?> |
builder()
Get Builder for this class that allows subclassing.
|
Array |
convert(Array in,
boolean convertUnsigned,
boolean applyScaleOffset,
boolean convertMissing)
Deprecated.
do not use
|
Array<?> |
convertArray(Array<?> data)
Convert the data using the VariableDS enhancements.
|
Array |
convertMissing(Array in)
Deprecated.
do not use
|
Number |
convertMissing(Number value)
Deprecated.
do not use
|
boolean |
convertNeeded()
Does data need to be converted?
|
Array |
convertUnsigned(Array in)
Deprecated.
do not use
|
Number |
convertUnsigned(Number value)
Deprecated.
do not use
|
static VariableDS |
fromVar(Group group,
Variable orgVar,
boolean enhance)
Create a VariableDS from orgVar, with default enhancements if requested.
|
com.google.common.collect.ImmutableList<CoordinateSystem> |
getCoordinateSystems()
Get the list of Coordinate Systems for this Variable, larger number of axes first.
|
String |
getDatasetLocation()
The location of the dataset this belongs to.
|
String |
getDescription()
Get the description of the Variable.
|
Set<NetcdfDataset.Enhance> |
getEnhanceMode()
Returns the enhancements applied to this variable.
|
double |
getFillValue()
Deprecated.
do not use
|
Array |
getMissingDataArray(int[] shape)
Deprecated.
use Arrays.getMissingDataArray()
|
double[] |
getMissingValues()
Deprecated.
do not use
|
NetcdfFile |
getNetcdfFile()
Get the NetcdfFile that this variable is contained in.
|
double |
getOffset()
Deprecated.
do not use
|
ArrayType |
getOriginalArrayType()
When this wraps another Variable, get the original Variable's ArrayType.
|
DataType |
getOriginalDataType()
Deprecated.
use getOriginalArrayType()
|
String |
getOriginalName()
When this wraps another Variable, get the original Variable's name.
|
Variable |
getOriginalVariable()
A VariableDS usually wraps another Variable.
|
DataType |
getScaledOffsetType()
Deprecated.
do not use
|
double |
getScaleFactor()
Deprecated.
do not use
|
DataType.Signedness |
getSignedness()
Deprecated.
do not use
|
String |
getUnitsString()
Get the Unit String for the Variable.
|
DataType |
getUnsignedConversionType()
Deprecated.
do not use
|
double |
getValidMax()
Deprecated.
do not use
|
double |
getValidMin()
Deprecated.
do not use
|
boolean |
hasFillValue()
Deprecated.
do not use
|
boolean |
hasMissing()
Deprecated.
do not use
|
boolean |
hasMissingValue()
Deprecated.
do not use
|
boolean |
hasScaleOffset()
Deprecated.
do not use
|
boolean |
hasValidData()
true if Variable has valid_range, valid_min or valid_max attributes
|
boolean |
isFillValue(double val)
Deprecated.
do not use
|
boolean |
isInvalidData(double val)
Deprecated.
do not use
|
boolean |
isMissing(double val)
Deprecated.
do not use
|
boolean |
isMissingValue(double val)
Deprecated.
do not use
|
String |
lookupEnumString(int val)
Lookup the enum string for this value.
|
Array<?> |
proxyReadArray(Variable client,
CancelTask cancelTask)
public by accident, do not call directly.
|
Array<?> |
proxyReadArray(Variable client,
Section section,
CancelTask cancelTask)
public by accident, do not call directly.
|
Array<?> |
readArray()
Read all the data for this Variable and return a memory resident Array.
|
Array<?> |
readArray(Section section)
Read a section of the data for this Variable from the netcdf file and return a memory resident Array.
|
long |
readToStream(Section section,
OutputStream out)
Deprecated.
|
Array |
reallyRead(Variable client,
CancelTask cancelTask)
Deprecated.
|
Array |
reallyRead(Variable client,
Section section,
CancelTask cancelTask)
Deprecated.
|
void |
setCaching(boolean caching)
Set whether to cache or not.
|
void |
showScaleMissingProxy(Formatter f)
Deprecated.
use Arrays.getMissingDataArray()
|
VariableDS.Builder<?> |
toBuilder()
Turn into a mutable Builder.
|
String |
toString() |
String |
toStringDebug()
Debugging info
|
_readScalarData, addLocalFieldsToBuilder, attributes, compareTo, equals, extraInfo, findAttribute, findAttributeString, findDimensionIndex, getArrayType, getDataType, getDimension, getDimensions, getDimensionSet, getDimensionsString, getElementSize, getEnumTypedef, getFileTypeId, getFullName, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getSection, getShape, getShape, getShapeAsSection, getShortName, getSize, getSizeToCache, getSPobject, hasCachedData, hashCode, invalidateCache, isCaching, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, reduce, resetShape, section, section, setCachedData, slice, writeCDLclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetFullName, getParentGroup, getShortNameprotected final ArrayType orgDataType
protected VariableDS(VariableDS.Builder<?> builder, Group parentGroup)
public static VariableDS fromVar(Group group, Variable orgVar, boolean enhance)
group - Reparent to this Group.orgVar - Wrap this Variable.enhance - opriona default enhancements.public NetcdfFile getNetcdfFile()
VariablegetNetcdfFile in class Variablepublic boolean convertNeeded()
public Array<?> convertArray(Array<?> data)
public Set<NetcdfDataset.Enhance> getEnhanceMode()
@Nullable public Variable getOriginalVariable()
getOriginalVariable in interface VariableEnhancedpublic DataType getOriginalDataType()
public ArrayType getOriginalArrayType()
@Nullable public String getOriginalName()
getOriginalName in interface VariableEnhancedpublic String lookupEnumString(int val)
VariablelookupEnumString in class Variableval - the integer value of this enumpublic String toStringDebug()
VariabletoStringDebug in class Variablepublic String getDatasetLocation()
VariablegetDatasetLocation in class Variablepublic void setCaching(boolean caching)
VariablesetCaching in class Variable@Deprecated protected Array _read() throws IOException
_read in class VariableIOExceptionpublic Array<?> readArray() throws IOException
VariablereadArray in class VariableIOException@Deprecated public Array reallyRead(Variable client, CancelTask cancelTask) throws IOException
VariablereallyRead in interface ProxyReaderreallyRead in class Variableclient - the client VariablecancelTask - user may cancelIOExceptionpublic Array<?> proxyReadArray(Variable client, CancelTask cancelTask) throws IOException
VariableproxyReadArray in interface ProxyReaderproxyReadArray in class VariableIOException@Deprecated protected Array _read(Section section) throws IOException, InvalidRangeException
_read in class VariableIOExceptionInvalidRangeException@Deprecated public Array reallyRead(Variable client, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException
VariablereallyRead in interface ProxyReaderreallyRead in class Variableclient - the client Variablesection - the section of data to read.cancelTask - user may cancelInvalidRangeException - if section has incorrect rank or illegal shape.IOExceptionpublic Array<?> readArray(Section section) throws IOException, InvalidRangeException
VariablereadArray in class Variablesection - The section of data to read.
Must be null or same rank as variable.
If list is null, assume all data.
Each Range corresponds to a Dimension. If the Range object is null, it means use the entire dimension.IOExceptionInvalidRangeExceptionpublic Array<?> proxyReadArray(Variable client, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException
VariableproxyReadArray in interface ProxyReaderproxyReadArray in class VariableIOExceptionInvalidRangeException@Deprecated public long readToStream(Section section, OutputStream out) throws IOException, InvalidRangeException
readToStream in class VariableIOExceptionInvalidRangeException@Deprecated public Array getMissingDataArray(int[] shape)
shape - of this shape@Deprecated public void showScaleMissingProxy(Formatter f)
f - put info herepublic String getDescription()
VariablegetDescription in interface VariableEnhancedgetDescription in interface VariableSimpleIFgetDescription in class Variablepublic String getUnitsString()
VariablegetUnitsString in interface VariableEnhancedgetUnitsString in interface VariableSimpleIFgetUnitsString in class Variablepublic com.google.common.collect.ImmutableList<CoordinateSystem> getCoordinateSystems()
VariableEnhancedgetCoordinateSystems in interface VariableEnhanced@Deprecated public boolean hasScaleOffset()
EnhanceScaleMissingUnsignedhasScaleOffset in interface EnhanceScaleMissingUnsigned@Deprecated public double getScaleFactor()
EnhanceScaleMissingUnsigned1.0, i.e. no
scaling. It will remain that value if the variable defines no CDM.SCALE_FACTOR
attribute.getScaleFactor in interface EnhanceScaleMissingUnsigned@Deprecated public double getOffset()
EnhanceScaleMissingUnsignedCDM.SCALE_FACTOR and
CDM.ADD_OFFSET attributes are present, the data are first scaled before the offset is
added. By default it is 0.0, i.e. no offset. It will remain that value if the variable defines no
CDM.SCALE_FACTOR attribute.getOffset in interface EnhanceScaleMissingUnsigned@Deprecated public boolean hasMissing()
EnhanceScaleMissingUnsignedhasMissing in interface IsMissingEvaluatorhasMissing in interface EnhanceScaleMissingUnsigned@Deprecated public boolean isMissing(double val)
EnhanceScaleMissingUnsignedtrue if the argument is a missing value.
Note that Float.NaN and Double.NaN are considered missing data.isMissing in interface IsMissingEvaluatorisMissing in interface EnhanceScaleMissingUnsignedval - an unpacked value.true if the argument is a missing value.public boolean hasValidData()
EnhanceScaleMissingUnsignedhasValidData in interface EnhanceScaleMissingUnsigned@Deprecated public double getValidMin()
EnhanceScaleMissingUnsignedgetValidMin in interface EnhanceScaleMissingUnsigned@Deprecated public double getValidMax()
EnhanceScaleMissingUnsignedgetValidMax in interface EnhanceScaleMissingUnsigned@Deprecated public boolean isInvalidData(double val)
EnhanceScaleMissingUnsignedisInvalidData in interface EnhanceScaleMissingUnsigned@Deprecated public boolean hasFillValue()
EnhanceScaleMissingUnsignedhasFillValue in interface EnhanceScaleMissingUnsigned@Deprecated public double getFillValue()
EnhanceScaleMissingUnsignedgetFillValue in interface EnhanceScaleMissingUnsigned@Deprecated public boolean isFillValue(double val)
EnhanceScaleMissingUnsignedisFillValue in interface EnhanceScaleMissingUnsigned@Deprecated public boolean hasMissingValue()
EnhanceScaleMissingUnsignedhasMissingValue in interface EnhanceScaleMissingUnsigned@Deprecated public double[] getMissingValues()
EnhanceScaleMissingUnsignedgetMissingValues in interface EnhanceScaleMissingUnsigned@Deprecated public boolean isMissingValue(double val)
EnhanceScaleMissingUnsignedisMissingValue in interface EnhanceScaleMissingUnsigned@Deprecated @Nullable public DataType getScaledOffsetType()
EnhanceScaleMissingUnsignednull if the
decorated variable lacks scale_factor or add_offset attributes. You can check with
EnhanceScaleMissingUnsigned.hasScaleOffset().getScaledOffsetType in interface EnhanceScaleMissingUnsigned@Deprecated public DataType getUnsignedConversionType()
EnhanceScaleMissingUnsignednull, even
when no unsigned conversion is necessary (because the underlying variable isn't unsigned). In such cases, this
data type will be the same as that of the underlying variable.getUnsignedConversionType in interface EnhanceScaleMissingUnsigned@Deprecated public DataType.Signedness getSignedness()
EnhanceScaleMissingUnsignedgetSignedness in interface EnhanceScaleMissingUnsigned@Deprecated public double applyScaleOffset(Number value)
EnhanceScaleMissingUnsignedEnhanceScaleMissingUnsigned.hasScaleOffset(). Otherwise, just return value.applyScaleOffset in interface EnhanceScaleMissingUnsigned@Deprecated public Array applyScaleOffset(Array data)
EnhanceScaleMissingUnsignedin and return the result as a new Array, but only if
EnhanceScaleMissingUnsigned.hasScaleOffset(). Otherwise, just return value. Otherwise, just return data.applyScaleOffset in interface EnhanceScaleMissingUnsigneddata - convert this@Deprecated public Number convertUnsigned(Number value)
EnhanceScaleMissingUnsignedvalue to the next largest integral data type by an unsigned conversion. The conversion only happens if the decorated variable is unsigned
and value is a negative integer. Otherwise, simply return value.convertUnsigned in interface EnhanceScaleMissingUnsignedvalue - an integral number to convert.value.@Deprecated public Array convertUnsigned(Array in)
EnhanceScaleMissingUnsignedunsigned conversion of each element of in and returns the
result as a new Array. The data type of the returned array will be EnhanceScaleMissingUnsigned.getUnsignedConversionType().convertUnsigned in interface EnhanceScaleMissingUnsignedin - an Array containing integral Numbers to convert.in.@Deprecated public Number convertMissing(Number value)
EnhanceScaleMissingUnsignedconvertMissing in interface EnhanceScaleMissingUnsigned@Deprecated public Array convertMissing(Array in)
EnhanceScaleMissingUnsignedconvertMissing in interface EnhanceScaleMissingUnsignedin - an array containing floating-point numbers to convert.in.@Deprecated public Array convert(Array in, boolean convertUnsigned, boolean applyScaleOffset, boolean convertMissing)
EnhanceScaleMissingUnsignedin and return the result as a new Array.
Note that this method is more efficient than calling EnhanceScaleMissingUnsigned.convertUnsigned(Array), followed by
EnhanceScaleMissingUnsigned.applyScaleOffset(Array), followed by EnhanceScaleMissingUnsigned.convertMissing(Array), as only one copy of in is
made.convert in interface EnhanceScaleMissingUnsignedin - a numeric array.convertUnsigned - true if we should convert unsigned.applyScaleOffset - true if we should apply scale/offset.convertMissing - true if we should convert missing.public VariableDS.Builder<?> toBuilder()
Variableprotected VariableDS.Builder<?> addLocalFieldsToBuilder(VariableDS.Builder<? extends VariableDS.Builder<?>> builder)
public static VariableDS.Builder<?> builder()