public class OpendapGrid extends Grid
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.data, dims, isUnsigned, lookup, unsignedType
Constructor and Description |
---|
OpendapGrid(Grid grid,
java.lang.String url)
Creates a new grid.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getData()
Gets the variable data array.
|
java.lang.Object |
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(DataLocation loc,
double val)
Writes a scaled data value with navigation.
|
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.
|
arraycopy, checkSubset, getNavigation, getSubset, getTilingScheme, getValue, main, navigate, setData, setNavigation
convertUnits, dispose, format, format, format, getClassBits, getDataClass, getDecimals, getDimensions, getFormat, getLongName, getMissing, getName, getOptimalStride, getRank, getScaling, getStatistics, getStatistics, getStatistics, getStatistics, getUnits, getUnsigned, getValue, getValues, setData, setFormat, setLongName, setLookup, setMissing, setName, setUnits, setUnsigned, setValue, toString
clone, getMetadataMap
public OpendapGrid(Grid grid, java.lang.String url) throws java.io.IOException
grid
- the prototype grid upon which to base this one.url
- the OPeNDAP dataset URL to use for data.java.io.IOException
public void setAccessHint(int[] start, int[] end, int[] stride)
DataVariable
setAccessHint
in class DataVariable
start
- the starting data coordinates.end
- the ending data coordinates.stride
- the data stride along each dimension.public void setValue(int row, int col, double val)
Grid
setValue
in class Grid
row
- the data location row.col
- the data location column.val
- the data value as a double. If the data value is
Double.NaN
and the missing value is non-null, the
missing value is written to the array.Grid.setValue(DataLocation,double)
public void setValue(DataLocation loc, double val)
Grid
setValue
in class Grid
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 is
Double.NaN
and the missing value is non-null, the
missing value is written to the array.Grid.setValue(int,int,double)
public void setValue(int index, double val)
DataVariable
setValue
in class DataVariable
index
- the index into the data array.val
- the data value as a double. If the data value is
Double.NaN
and the missing value is non-null, the
missing value is written to the array.DataVariable.setValue(DataLocation,double)
public double interpolate(DataLocation loc)
DataVariable
interpolate
in class Grid
loc
- the data value location.double
. The
Double.NaN
value is used if the data value is
missing.DataVariable.getValue(int)
,
DataVariable.getValue(DataLocation)
public java.lang.Object getData()
DataVariable
getData
in class DataVariable
public java.lang.Object getData(int[] start, int[] count)
Grid
Grid.getData(int[], int[])
, but retrieves only a subset of data
values in the raw, unscaled form.getData
in class Grid
start
- the subset starting [row, column].count
- the subset dimension [rows, columns].DataVariable.getData()
public double getValue(int row, int col)
Grid
getValue
in class Grid
row
- the data location row.col
- the data location column.double
. The
Double.NaN
value is used if the data value is
missing or data coordinate is not valid.Grid.getValue(DataLocation)
public double getValue(int index)
DataVariable
getValue
in class DataVariable
index
- the index into the data array.double
. The
Double.NaN
value is used if the data value is
missing.DataVariable.getValue(DataLocation)