Package noaa.coastwatch.io
Class OpendapGrid
java.lang.Object
noaa.coastwatch.util.MetadataContainer
noaa.coastwatch.util.DataVariable
noaa.coastwatch.util.Grid
noaa.coastwatch.io.OpendapGrid
- All Implemented Interfaces:
Cloneable
,ValueSource
The
OpendapGrid
is an intelligent OPeNDAP client
that delivers data by listening for DataVariable.setAccessHint(int[], int[], int[])
calls and
only downloads the data which is specified within that call.- Since:
- 3.2.1
- Author:
- Peter Hollemans
-
Nested Class Summary
Nested classes/interfaces inherited from class noaa.coastwatch.util.DataVariable
DataVariable.AccessType
-
Field Summary
Fields inherited from class noaa.coastwatch.util.DataVariable
data, dims, isUnsigned, lookup, unsignedType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetData()
Gets the variable data array.getData
(int[] start, int[] count) Gets a subset of grid data values.double
getValue
(int index) Reads a scaled data value.double
getValue
(int row, int col) Reads a scaled data value with no navigation.double
interpolate
(DataLocation loc) Reads an interpolated data value.void
setAccessHint
(int[] start, int[] end, int[] stride) Sets a hint to the variable that subsequent data access will only read/write values within the specified data extents.void
setValue
(int index, double val) Writes a scaled data value.void
setValue
(int row, int col, double val) Writes a scaled data value with no navigation.void
setValue
(DataLocation loc, double val) Writes a scaled data value with navigation.Methods inherited from class noaa.coastwatch.util.Grid
arraycopy, checkSubset, getNavigation, getSubset, getTilingScheme, getValue, main, navigate, setData, setNavigation
Methods inherited from class noaa.coastwatch.util.DataVariable
convertUnits, dispose, format, format, format, getClassBits, getDataClass, getDecimals, getDimensions, getFormat, getLongName, getMissing, getName, getOptimalStride, getRank, getScaling, getStatistics, getStatistics, getStatistics, getStatistics, getUnits, getUnsigned, getValue, getValues, setAccessType, setData, setFormat, setLongName, setLookup, setMissing, setName, setUnits, setUnsigned, setValue, toString
Methods inherited from class noaa.coastwatch.util.MetadataContainer
clone, getMetadataMap
-
Constructor Details
-
OpendapGrid
Creates a new grid.- Parameters:
grid
- the prototype grid upon which to base this one.url
- the OPeNDAP dataset URL to use for data.- Throws:
IOException
-
-
Method Details
-
setAccessHint
public void setAccessHint(int[] start, int[] end, int[] stride) Description copied from class:DataVariable
Sets a hint to the variable that subsequent data access will only read/write values within the specified data extents. This method performs no action in the abstract class, but may be used by subclasses that wish to setup internal structures prior to some sort of intensive data access. For example, if data rendering is to occur, it might be useful to read in only the data that will be rendered and make it availalble.- Overrides:
setAccessHint
in classDataVariable
- Parameters:
start
- the starting data coordinates.end
- the ending data coordinates.stride
- the data stride along each dimension.
-
setValue
public void setValue(int row, int col, double val) Description copied from class:Grid
Writes a scaled data value with no navigation. The data value is scaled according to the scaling factor and offset and written to the data array. No navigation transform is applied to correct the data location. -
setValue
Description copied from class:Grid
Writes a scaled data value with navigation. The data value is scaled according to the scaling factor and offset and written to the data array. The navigation transform is applied to correct the data location prior to writing the data value.- Overrides:
setValue
in classGrid
- Parameters:
loc
- the data location. If the location does not navigate to a valid data coordinate, no value is written.val
- the data value as a double. If the data value isDouble.NaN
and the missing value is non-null, the missing value is written to the array.- See Also:
-
setValue
public void setValue(int index, double val) Description copied from class:DataVariable
Writes a scaled data value. The data value is scaled according to the scaling factor and offset and written to the data array.- Overrides:
setValue
in classDataVariable
- Parameters:
index
- the index into the data array.val
- the data value as a double. If the data value isDouble.NaN
and the missing value is non-null, the missing value is written to the array.- See Also:
-
interpolate
Description copied from class:DataVariable
Reads an interpolated data value.- Overrides:
interpolate
in classGrid
- Parameters:
loc
- the data value location.- Returns:
- the scaled data value as a
double
. TheDouble.NaN
value is used if the data value is missing. - See Also:
-
getData
Description copied from class:DataVariable
Gets the variable data array. The returned data is read-only -- the result of attempting to set values in the data is undefined.- Overrides:
getData
in classDataVariable
-
getData
Description copied from class:Grid
Gets a subset of grid data values. This method is similar toGrid.getData(int[], int[])
, but retrieves only a subset of data values in the raw, unscaled form. -
getValue
public double getValue(int row, int col) Description copied from class:Grid
Reads a scaled data value with no navigation. The data value is read from the data array and scaled according to the scaling factor and offset. No navigation transform is applied to correct the data location. -
getValue
public double getValue(int index) Description copied from class:DataVariable
Reads a scaled data value. The data value is read from the data array and scaled according to the scaling factor and offset.- Overrides:
getValue
in classDataVariable
- Parameters:
index
- the index into the data array.- Returns:
- the scaled data value as a
double
. TheDouble.NaN
value is used if the data value is missing. - See Also:
-