public interface EnhanceScaleMissingUnsigned extends IsMissingEvaluator
_Unsigned
scale_factor
and add_offset
valid_min
, valid_max
, valid_range
, missing_value
,
or _FillValue
unsigned data type
or an
_Unsigned
attribute with value true
.widened
, which effectively reinterprets signed data as unsigned
data.next larger type
.largest of
:
scale_factor
attribute typeadd_offset
attribute typegetScaledOffsetType()
will be unsigned as well.
applyScaleOffset(Array)
call.Modifier and Type | Method and Description |
---|---|
Array |
applyScaleOffset(Array data)
Apply scale and offset to each element of
in and return the result as a new Array, but only if
hasScaleOffset() . |
double |
applyScaleOffset(Number value)
Apply scale and offset to the specified value if
hasScaleOffset() . |
Array |
convert(Array in,
boolean convertUnsigned,
boolean applyScaleOffset,
boolean convertMissing)
Perform the specified conversions on each element of
in and return the result as a new Array. |
Array |
convertMissing(Array in)
|
Number |
convertMissing(Number value)
|
Array |
convertUnsigned(Array in)
Performs an
unsigned conversion of each element of in and returns the
result as a new Array. |
Number |
convertUnsigned(Number value)
Convert
value to the next largest integral data type by an unsigned conversion . |
double |
getFillValue()
return value of _FillValue attribute
|
double[] |
getMissingValues()
return values of missing_value attributes
|
double |
getOffset()
The number to be added to the data after it is read.
|
DataType |
getScaledOffsetType()
Return the data type for values that have undergone scale/offset conversion.
|
double |
getScaleFactor()
The data are to be multiplied by this value after the data are read.
|
DataType.Signedness |
getSignedness()
Returns the signedness of the decorated variable.
|
DataType |
getUnsignedConversionType()
Return the data type for values that have undergone unsigned conversion.
|
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 |
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 offset
|
boolean |
hasValidData()
true if Variable has valid_range, valid_min or valid_max attributes
|
boolean |
isFillValue(double val)
return true if val equals the _FillValue
|
boolean |
isInvalidData(double val)
return true if val is outside the valid range
|
boolean |
isMissing(double val)
Returns
true if the argument is a missing value. |
boolean |
isMissingValue(double val)
return true if val equals a missing_value (low-level)
|
void |
setFillValueIsMissing(boolean b)
Deprecated.
Do not use.
|
void |
setInvalidDataIsMissing(boolean b)
Deprecated.
Do not use.
|
void |
setMissingDataIsMissing(boolean b)
Deprecated.
Do not use.
|
boolean hasScaleOffset()
double getScaleFactor()
1.0
, i.e. no
scaling. It will remain that value if the variable defines no CDM.SCALE_FACTOR
attribute.double getOffset()
CDM.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.boolean hasMissing()
hasMissing
in interface IsMissingEvaluator
boolean isMissing(double val)
true
if the argument is a missing value.
Note that Float.NaN
and Double.NaN
are considered missing data.isMissing
in interface IsMissingEvaluator
val
- an unpacked value.true
if the argument is a missing value.boolean hasValidData()
double getValidMin()
double getValidMax()
boolean isInvalidData(double val)
boolean hasFillValue()
double getFillValue()
boolean isFillValue(double val)
boolean hasMissingValue()
double[] getMissingValues()
boolean isMissingValue(double val)
@Deprecated void setFillValueIsMissing(boolean b)
@Deprecated void setInvalidDataIsMissing(boolean b)
@Deprecated void setMissingDataIsMissing(boolean b)
@Nullable DataType getScaledOffsetType()
null
if the
decorated variable lacks scale_factor
or add_offset
attributes. You can check with
hasScaleOffset()
.@Nonnull DataType getUnsignedConversionType()
null
, 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.DataType.Signedness getSignedness()
Number convertUnsigned(Number value)
value
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
.value
- an integral number to convert.value
.Array convertUnsigned(Array in)
unsigned conversion
of each element of in
and returns the
result as a new Array. The data type of the returned array will be getUnsignedConversionType()
.in
- an Array containing integral Numbers to convert.in
.double applyScaleOffset(Number value)
hasScaleOffset()
. Otherwise, just return value
.Array applyScaleOffset(Array data)
in
and return the result as a new Array, but only if
hasScaleOffset()
. Otherwise, just return value
. Otherwise, just return data
.data
- convert thisArray convertMissing(Array in)
in
- an array containing floating-point numbers to convert.in
.Array convert(Array in, boolean convertUnsigned, boolean applyScaleOffset, boolean convertMissing)
in
and return the result as a new Array.
Note that this method is more efficient than calling convertUnsigned(Array)
, followed by
applyScaleOffset(Array)
, followed by convertMissing(Array)
, as only one copy of in
is
made.in
- 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
.