ucar.nc2.dt
Interface GridDatatype

All Known Implementing Classes:
GeoGrid

public interface GridDatatype

Interface for scientific datatype Grid.

Author:
caron

Method Summary
 Attribute findAttributeIgnoreCase(java.lang.String name)
          Convenience function; lookup Attribute by name.
 java.lang.String findAttValueIgnoreCase(java.lang.String attName, java.lang.String defaultValue)
          Convenience function; lookup Attribute value by name.
 java.util.List getAttributes()
          Get a List of Attribute specific to the Grid
 GridCoordSystem getCoordinateSystem()
          get the Grid's Coordinate System.
 DataType getDataType()
          get the data type
 java.lang.String getDescription()
          Get the description/long_name of the Grid
 Dimension getDimension(int i)
          get the ith dimension
 java.util.List getDimensions()
          Returns a List of Dimension containing the dimensions used by this grid.
 Dimension getEnsembleDimension()
          get the ensemble Dimension, if it exists
 int getEnsembleDimensionIndex()
          get the ensemble Dimension index in the geogrid (canonical order), or -1 if none
 java.lang.String getInfo()
          human readable information about this Grid.
 MAMath.MinMax getMinMaxSkipMissingData(Array data)
          Get the minimum and the maximum data value of the previously read Array, skipping missing values as defined by isMissingData(double val).
 java.lang.String getName()
          Get the name of the Grid
 ProjectionImpl getProjection()
          get the Projection, if it exists.
 int getRank()
          get the rank
 Dimension getRunTimeDimension()
          get the run time Dimension, if it exists
 int getRunTimeDimensionIndex()
          get the runtime Dimension index in the geogrid (canonical order), or -1 if none
 int[] getShape()
          get the shape (canonical ordering)
 Dimension getTimeDimension()
          get the time Dimension, if it exists
 int getTimeDimensionIndex()
          get the time Dimension index in the geogrid (canonical order), or -1 if none
 java.lang.String getUnitsString()
          Get the unit string
 VariableEnhanced getVariable()
          get the underlying Variable, if it exists.
 Dimension getXDimension()
          get the x Dimension, if it exists
 int getXDimensionIndex()
          get the x Dimension index in the geogrid (canonical order)
 Dimension getYDimension()
          get the y Dimension, if it exists
 int getYDimensionIndex()
          get the y Dimension index in the geogrid (canonical order)
 Dimension getZDimension()
          get the z Dimension, if it exists
 int getZDimensionIndex()
          get the z Dimension index in the geogrid (canonical order), or -1 if none
 boolean hasMissingData()
          true if there may be missing data, see VariableStandardized.hasMissing()
 boolean isMissingData(double vl)
          if val is missing data, see VariableStandardized.isMissingData()
 GridDatatype makeSubset(Range t_range, Range z_range, LatLonRect bbox, int z_stride, int y_stride, int x_stride)
          Create a new GeoGrid that is a logical subset of this GeoGrid.
 GridDatatype makeSubset(Range rt_range, Range e_range, Range t_range, Range z_range, Range y_range, Range x_range)
          Create a new GeoGrid that is a logical subset of this GeoGrid.
 Array readDataSlice(int t_index, int z_index, int y_index, int x_index)
          For backwards compatibility for grids with no runtime or ensemble dimensions.
 Array readDataSlice(int rt_index, int e_index, int t_index, int z_index, int y_index, int x_index)
          This reads an arbitrary data slice, returning the data in canonical order (rt-e-t-z-y-x).
 Array readVolumeData(int t_index)
          For backwards compatibility for grids with no runtime or ensemble dimensions.
 float[] setMissingToNaN(float[] data)
          Convert (in place) all values in the given array that are considered as "missing" to Float.NaN, according to isMissing(val).
 

Method Detail

getName

java.lang.String getName()
Get the name of the Grid


getDescription

java.lang.String getDescription()
Get the description/long_name of the Grid


getUnitsString

java.lang.String getUnitsString()
Get the unit string


getDataType

DataType getDataType()
get the data type


getRank

int getRank()
get the rank


getShape

int[] getShape()
get the shape (canonical ordering)


getAttributes

java.util.List getAttributes()
Get a List of Attribute specific to the Grid


findAttributeIgnoreCase

Attribute findAttributeIgnoreCase(java.lang.String name)
Convenience function; lookup Attribute by name.

Parameters:
name - the name of the attribute
Returns:
the attribute, or null if not found

findAttValueIgnoreCase

java.lang.String findAttValueIgnoreCase(java.lang.String attName,
                                        java.lang.String defaultValue)
Convenience function; lookup Attribute value by name. Must be String valued

Parameters:
attName - name of the attribute
defaultValue - if not found, use this as the default
Returns:
Attribute string value, or default if not found.

getDimensions

java.util.List getDimensions()
Returns a List of Dimension containing the dimensions used by this grid. The dimension are put into canonical order: (rt, e, t, z, y, x). Only the x and y are required. If the Horizontal axes are 2D, the x and y dimensions are arbitrarily chosen to be gcs.getXHorizAxis().getDimension(1), gcs.getXHorizAxis().getDimension(0), respectively.

Returns:
List with objects of type Dimension, in canonical order.

getDimension

Dimension getDimension(int i)
get the ith dimension


getTimeDimension

Dimension getTimeDimension()
get the time Dimension, if it exists


getZDimension

Dimension getZDimension()
get the z Dimension, if it exists


getYDimension

Dimension getYDimension()
get the y Dimension, if it exists


getXDimension

Dimension getXDimension()
get the x Dimension, if it exists


getEnsembleDimension

Dimension getEnsembleDimension()
get the ensemble Dimension, if it exists


getRunTimeDimension

Dimension getRunTimeDimension()
get the run time Dimension, if it exists


getTimeDimensionIndex

int getTimeDimensionIndex()
get the time Dimension index in the geogrid (canonical order), or -1 if none


getZDimensionIndex

int getZDimensionIndex()
get the z Dimension index in the geogrid (canonical order), or -1 if none


getYDimensionIndex

int getYDimensionIndex()
get the y Dimension index in the geogrid (canonical order)


getXDimensionIndex

int getXDimensionIndex()
get the x Dimension index in the geogrid (canonical order)


getEnsembleDimensionIndex

int getEnsembleDimensionIndex()
get the ensemble Dimension index in the geogrid (canonical order), or -1 if none


getRunTimeDimensionIndex

int getRunTimeDimensionIndex()
get the runtime Dimension index in the geogrid (canonical order), or -1 if none


getCoordinateSystem

GridCoordSystem getCoordinateSystem()
get the Grid's Coordinate System.


getProjection

ProjectionImpl getProjection()
get the Projection, if it exists.


hasMissingData

boolean hasMissingData()
true if there may be missing data, see VariableStandardized.hasMissing()


isMissingData

boolean isMissingData(double vl)
if val is missing data, see VariableStandardized.isMissingData()


getMinMaxSkipMissingData

MAMath.MinMax getMinMaxSkipMissingData(Array data)
Get the minimum and the maximum data value of the previously read Array, skipping missing values as defined by isMissingData(double val).

Parameters:
data - Array to get min/max values
Returns:
both min and max value.

setMissingToNaN

float[] setMissingToNaN(float[] data)
Convert (in place) all values in the given array that are considered as "missing" to Float.NaN, according to isMissing(val).

Parameters:
data - input array
Returns:
input array, with missing values converted to NaNs.

readDataSlice

Array readDataSlice(int rt_index,
                    int e_index,
                    int t_index,
                    int z_index,
                    int y_index,
                    int x_index)
                    throws java.io.IOException
This reads an arbitrary data slice, returning the data in canonical order (rt-e-t-z-y-x). If any dimension does not exist, ignore it.

Parameters:
rt_index - if < 0, get all of runtime dim; if valid index, fix slice to that value.
e_index - if < 0, get all of ensemble dim; if valid index, fix slice to that value.
t_index - if < 0, get all of time dim; if valid index, fix slice to that value.
z_index - if < 0, get all of z dim; if valid index, fix slice to that value.
y_index - if < 0, get all of y dim; if valid index, fix slice to that value.
x_index - if < 0, get all of x dim; if valid index, fix slice to that value.
Returns:
data[t,z,y,x], eliminating missing or fixed dimension.
Throws:
java.io.IOException

readDataSlice

Array readDataSlice(int t_index,
                    int z_index,
                    int y_index,
                    int x_index)
                    throws java.io.IOException
For backwards compatibility for grids with no runtime or ensemble dimensions.

Throws:
java.io.IOException

readVolumeData

Array readVolumeData(int t_index)
                     throws java.io.IOException
For backwards compatibility for grids with no runtime or ensemble dimensions.

Throws:
java.io.IOException

makeSubset

GridDatatype makeSubset(Range rt_range,
                        Range e_range,
                        Range t_range,
                        Range z_range,
                        Range y_range,
                        Range x_range)
                        throws InvalidRangeException
Create a new GeoGrid that is a logical subset of this GeoGrid.

Parameters:
rt_range - subset the runtime dimension, or null if you want all of it
e_range - subset the ensemble dimension, or null if you want all of it
t_range - subset the time dimension, or null if you want all of it
z_range - subset the vertical dimension, or null if you want all of it
y_range - subset the y dimension, or null if you want all of it
x_range - subset the x dimension, or null if you want all of it
Returns:
subsetted GeoGrid
Throws:
InvalidRangeException

makeSubset

GridDatatype makeSubset(Range t_range,
                        Range z_range,
                        LatLonRect bbox,
                        int z_stride,
                        int y_stride,
                        int x_stride)
                        throws InvalidRangeException
Create a new GeoGrid that is a logical subset of this GeoGrid. For backwards compatibility for grids with no runtime or ensemble dimensions.

Parameters:
t_range - subset the time dimension, or null if you want all of it
z_range - subset the vertical dimension, or null if you want all of it
bbox - a lat/lon bounding box, or null if you want all x,y
z_stride - use only if z_range is null, then take all z with this stride (1 means all)
y_stride - use this stride on the y coordinate (1 means all)
x_stride - use this stride on the x coordinate (1 means all)
Returns:
subsetted GeoGrid
Throws:
InvalidRangeException

getInfo

java.lang.String getInfo()
human readable information about this Grid.


getVariable

VariableEnhanced getVariable()
get the underlying Variable, if it exists.