|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.dt.grid.GeoGrid
public class GeoGrid
A georeferencing "gridded" VariableEnhanced, that has a GridCoordSys. In VisAD data model, it is a sampled Field. The dimension are put into canonical order: (rt, e, t, z, y, x).
Implementation note: 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.
Constructor Summary | |
---|---|
GeoGrid(GridDataset dataset,
VariableDS dsvar,
GridCoordSys gcs)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(GridDatatype g)
|
boolean |
equals(Object oo)
Instances which have same name and coordinate system are equal. |
Attribute |
findAttributeIgnoreCase(String name)
Convenience function; lookup Attribute by name. |
String |
findAttValueIgnoreCase(String attName,
String defaultValue)
Convenience function; lookup Attribute value by name. |
List<Attribute> |
getAttributes()
Get a List of Attribute specific to the Grid |
GridCoordSystem |
getCoordinateSystem()
get the GridCoordSys for this GeoGrid. |
Array |
getDataSlice(int t,
int z,
int y,
int x)
Deprecated. use readDataSlice |
DataType |
getDataType()
get the data type |
String |
getDescription()
get the standardized description |
Dimension |
getDimension(int i)
get the ith dimension |
List<Dimension> |
getDimensions()
Returns an ArrayList containing the dimensions used by this geoGrid. |
Dimension |
getEnsembleDimension()
get the ensemble Dimension, if it exists |
int |
getEnsembleDimensionIndex()
get the ensemble Dimension index in the geogrid (canonical order) |
String |
getFullName()
Get the full, unescaped name of the Grid |
String |
getInfo()
nicely formatted information |
List<NamedObject> |
getLevels()
|
MAMath.MinMax |
getMinMaxSkipMissingData(Array a)
Get the minimum and the maximum data value of the previously read Array, skipping missing values as defined by isMissingData(double val). |
String |
getName()
Get the object's name |
ProjectionImpl |
getProjection()
get the Projection. |
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) |
int[] |
getShape()
get the shape |
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 |
List<NamedObject> |
getTimes()
|
String |
getUnitsString()
get the unit as a string |
String |
getUnitString()
Deprecated. use getUnitsString() |
VariableDS |
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 |
int |
hashCode()
Override Object.hashCode() to be consistent with equals. |
boolean |
hasMissingData()
true if there may be missing data, see VariableDS.hasMissing() |
boolean |
isMissingData(double val)
if val is missing data, see VariableDS.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,
int z,
int y,
int x)
This reads an arbitrary data slice, returning the data in canonical order (t-z-y-x). |
Array |
readDataSlice(int rt,
int e,
int t,
int z,
int y,
int x)
This reads an arbitrary data slice, returning the data in canonical order (rt-e-t-z-y-x). |
Array |
readVolumeData(int t)
Reads in the data "volume" at the given time index. |
Array |
readYXData(int t,
int z)
Reads a Y-X "horizontal slice" at the given time and vertical index. |
Array |
readZYData(int t,
int x)
Reads a Z-Y "vertical slice" at the given time and x index. |
float[] |
setMissingToNaN(float[] values)
Convert (in place) all values in the given array that are considered as "missing" to Float.NaN, according to isMissingData(val). |
GeoGrid |
subset(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. |
GeoGrid |
subset(Range t_range,
Range z_range,
Range y_range,
Range x_range)
Create a new GeoGrid that is a logical subset of this GeoGrid. |
String |
toString()
string representation |
void |
writeFile(String filename)
experimental - do not use |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeoGrid(GridDataset dataset, VariableDS dsvar, GridCoordSys gcs)
dataset
- belongs to this datasetdsvar
- wraps this Variablegcs
- has this grid coordinate systemMethod Detail |
---|
public List<Dimension> getDimensions()
getDimensions
in interface GridDatatype
public Dimension getDimension(int i)
getDimension
in interface GridDatatype
i
- : which dimension
public Dimension getTimeDimension()
getTimeDimension
in interface GridDatatype
public Dimension getZDimension()
getZDimension
in interface GridDatatype
public Dimension getYDimension()
getYDimension
in interface GridDatatype
public Dimension getXDimension()
getXDimension
in interface GridDatatype
public Dimension getEnsembleDimension()
getEnsembleDimension
in interface GridDatatype
public Dimension getRunTimeDimension()
getRunTimeDimension
in interface GridDatatype
public int getTimeDimensionIndex()
getTimeDimensionIndex
in interface GridDatatype
public int getZDimensionIndex()
getZDimensionIndex
in interface GridDatatype
public int getYDimensionIndex()
getYDimensionIndex
in interface GridDatatype
public int getXDimensionIndex()
getXDimensionIndex
in interface GridDatatype
public int getEnsembleDimensionIndex()
getEnsembleDimensionIndex
in interface GridDatatype
public int getRunTimeDimensionIndex()
getRunTimeDimensionIndex
in interface GridDatatype
public Attribute findAttributeIgnoreCase(String name)
findAttributeIgnoreCase
in interface GridDatatype
name
- the name of the attribute
public String findAttValueIgnoreCase(String attName, String defaultValue)
findAttValueIgnoreCase
in interface GridDatatype
attName
- name of the attributedefaultValue
- if not found, use this as the default
public int getRank()
getRank
in interface GridDatatype
public int[] getShape()
getShape
in interface GridDatatype
public DataType getDataType()
getDataType
in interface GridDatatype
public List<Attribute> getAttributes()
GridDatatype
getAttributes
in interface GridDatatype
public VariableDS getVariable()
GridDatatype
getVariable
in interface GridDatatype
public String getFullName()
GridDatatype
getFullName
in interface GridDatatype
public String getName()
NamedObject
getName
in interface GridDatatype
getName
in interface NamedObject
public GridCoordSystem getCoordinateSystem()
getCoordinateSystem
in interface GridDatatype
public ProjectionImpl getProjection()
getProjection
in interface GridDatatype
public List<NamedObject> getLevels()
public List<NamedObject> getTimes()
public String getDescription()
getDescription
in interface GridDatatype
getDescription
in interface NamedObject
public String getUnitsString()
getUnitsString
in interface GridDatatype
public String getUnitString()
public boolean hasMissingData()
hasMissingData
in interface GridDatatype
public boolean isMissingData(double val)
isMissingData
in interface GridDatatype
val
- test this value
public float[] setMissingToNaN(float[] values)
setMissingToNaN
in interface GridDatatype
values
- input array
public MAMath.MinMax getMinMaxSkipMissingData(Array a)
getMinMaxSkipMissingData
in interface GridDatatype
a
- Array to get min/max values
public Array readVolumeData(int t) throws IOException
readVolumeData
in interface GridDatatype
t
- time index; ignored if no time axis.
IOException
- on io errorpublic Array readYXData(int t, int z) throws IOException
t
- time index; ignored if no time axis.z
- vertical index; ignored if no z axis.
IOException
- on read errorpublic Array readZYData(int t, int x) throws IOException
t
- time index; ignored if no time axis.x
- x index; ignored if no x axis.
IOException
- on read errorpublic Array getDataSlice(int t, int z, int y, int x) throws IOException
IOException
- on read errorpublic Array readDataSlice(int t, int z, int y, int x) throws IOException
readDataSlice
in interface GridDatatype
t
- if < 0, get all of time dim; if valid index, fix slice to that value.z
- if < 0, get all of z dim; if valid index, fix slice to that value.y
- if < 0, get all of y dim; if valid index, fix slice to that value.x
- if < 0, get all of x dim; if valid index, fix slice to that value.
IOException
- on io errorpublic Array readDataSlice(int rt, int e, int t, int z, int y, int x) throws IOException
readDataSlice
in interface GridDatatype
rt
- if < 0, get all of runtime dim; if valid index, fix slice to that value.e
- if < 0, get all of ensemble dim; if valid index, fix slice to that value.t
- if < 0, get all of time dim; if valid index, fix slice to that value.z
- if < 0, get all of z dim; if valid index, fix slice to that value.y
- if < 0, get all of y dim; if valid index, fix slice to that value.x
- if < 0, get all of x dim; if valid index, fix slice to that value.
IOException
- on io errorpublic GeoGrid subset(Range t_range, Range z_range, LatLonRect bbox, int z_stride, int y_stride, int x_stride) throws InvalidRangeException
t_range
- subset the time dimension, or null if you want all of itz_range
- subset the vertical dimension, or null if you want all of itbbox
- a lat/lon bounding box, or null if you want all x,yz_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)
InvalidRangeException
- if bbox does not intersect GeoGridpublic GridDatatype makeSubset(Range t_range, Range z_range, LatLonRect bbox, int z_stride, int y_stride, int x_stride) throws InvalidRangeException
GridDatatype
makeSubset
in interface GridDatatype
t_range
- subset the time dimension, or null if you want all of itz_range
- subset the vertical dimension, or null if you want all of itbbox
- a lat/lon bounding box, or null if you want all x,yz_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)
InvalidRangeException
- if ranges are invlaidpublic GeoGrid subset(Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException
t_range
- subset the time dimension, or null if you want all of itz_range
- subset the vertical dimension, or null if you want all of ity_range
- subset the y dimension, or null if you want all of itx_range
- subset the x dimension, or null if you want all of it
InvalidRangeException
- if any of the ranges are invalidpublic GridDatatype makeSubset(Range rt_range, Range e_range, Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException
GridDatatype
makeSubset
in interface GridDatatype
rt_range
- subset the runtime dimension, or null if you want all of ite_range
- subset the ensemble dimension, or null if you want all of itt_range
- subset the time dimension, or null if you want all of itz_range
- subset the vertical dimension, or null if you want all of ity_range
- subset the y dimension, or null if you want all of itx_range
- subset the x dimension, or null if you want all of it
InvalidRangeException
- if ranges are invlaidpublic void writeFile(String filename) throws IOException
filename
- write to this file
IOException
- on i/o errorpublic boolean equals(Object oo)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String getInfo()
getInfo
in interface GridDatatype
public int compareTo(GridDatatype g)
compareTo
in interface Comparable<GridDatatype>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |