Package ucar.unidata.data.grid
Class GridDataInstance
java.lang.Object
ucar.unidata.data.DataInstance
ucar.unidata.data.grid.GridDataInstance
A wrapper around grid data.
- Version:
- $Revision: 1.72 $ $Date: 2006/12/05 18:52:36 $
- Author:
- Jeff McWhirter
-
Field Summary
Fields inherited from class ucar.unidata.data.DataInstance
dataChoice, dataSelection, haveBeenInitialized, inError, myRequestProperties
-
Constructor Summary
ConstructorsConstructorDescriptionGridDataInstance
(DataChoice dataChoice, DataSelection dataSelection, Hashtable requestProperties) Create a GridDataInstance.GridDataInstance
(DataChoice dataChoice, DataSelection dataSelection, Hashtable requestProperties, Data theData) Create a GridDataInstance. -
Method Summary
Modifier and TypeMethodDescriptionfloat[][]
Get the array of 3D coordinate values from the spatial set, this returns the actual array, so don't change the values!DateTime[]
Get the array of times for this dataGet the 3D domainGet the ensemble setAccess to the FieldImpl made.Get a representative grid from one timestep.getGrid()
Access to the FieldImpl made.getGrid
(boolean copy) Access to the FieldImpl made.Real[]
Get the array of levels associated with this gridGet the geolocation information for this gridint
Get number of ensemblesint
Get the number of RealType (parameters) in this gridgetRange
(int idx) Return the idx'th range valueRange[]
Get all the data ranges for this gridThe MathType of the parameter(s)getRawUnit
(int idx) Get the default unit for the parameter at idxgetRealType
(int idx) The real type of the fieldgetRealTypeName
(int idx) Get the name of the RealType of the parameter at idxgetSize()
Get the sizes of the 3D domainint
getSizeX()
Get the number of X components in the domainint
getSizeY()
Get the number of Y components in the domainint
getSizeZ()
Get the number of Z components in the domainGet the spatial domain associated with this grid.Get the coordinate system for the 3D domain.getZType()
Get the RealType of the data's Z coordinategetZUnit()
Get the unit of the data's Z coordinatestatic Unit
Get the vertical unit for a given gridGet the name of the data's Z coordinate Unitprotected void
init()
Initialize this object.boolean
is3D()
Check if this is a 3D grid or notboolean
Is the grid an ensemble?boolean
Get whether this is a time sequence or notvoid
Reinitialize this GridDataInstanceslice
(SampledSet slice) Slice (resample) the grid along the slice Interface to GridUtil.slice().sliceAlongLatLonLine
(List<LatLonPoint> points, int samplingMode) Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().sliceAlongLatLonLine
(LatLonPoint start, LatLonPoint end) Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().sliceAlongLatLonLine
(LatLonPoint start, LatLonPoint end, int samplingMode) Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().sliceAtLevel
(Real level) Slice the grid at a particular level.toString()
String representation of this GridDataInstanceMethods inherited from class ucar.unidata.data.DataInstance
checkInit, dataOk, getData, getData, getData, getDataChoice, getDataSelection, getNextId, getParamName, needsInitialization, setData, setDataSelection, setTheData
-
Constructor Details
-
GridDataInstance
public GridDataInstance(DataChoice dataChoice, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException Create a GridDataInstance.- Parameters:
dataChoice
- choice describing the datadataSelection
- sub selection propertiesrequestProperties
- special control request properties- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
GridDataInstance
public GridDataInstance(DataChoice dataChoice, DataSelection dataSelection, Hashtable requestProperties, Data theData) throws VisADException, RemoteException Create a GridDataInstance.- Parameters:
dataChoice
- choice describing the datadataSelection
- sub selection propertiesrequestProperties
- special control request propertiestheData
- Any initial data. Usually is null.- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
-
Method Details
-
reInitialize
Reinitialize this GridDataInstance- Overrides:
reInitialize
in classDataInstance
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
init
Initialize this object. Get the data and populate all the parameters- Overrides:
init
in classDataInstance
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
isTimeSequence
public boolean isTimeSequence()Get whether this is a time sequence or not- Returns:
- true if a time sequence
-
is3D
public boolean is3D()Check if this is a 3D grid or not- Returns:
- true if a 3D grid
-
getSpatialDomain
Get the spatial domain associated with this grid. It is assumed that the spatial domain is the same for each timestep.- Returns:
- spatial domain
-
getZUnit
Get the vertical unit for a given grid- Parameters:
field
- 3D grid- Returns:
- Unit of vertical coordinate
- Throws:
RemoteException
- Java RMI errorVisADException
- VisAD Error
-
getRange
Return the idx'th range value- Parameters:
idx
- range index- Returns:
- the Range of values for that index
-
getRanges
Get all the data ranges for this grid- Returns:
- array of Ranges
-
getRealType
The real type of the field- Parameters:
idx
- index of parameter- Returns:
- RealType for parameter
-
getNumRealTypes
public int getNumRealTypes()Get the number of RealType (parameters) in this grid- Returns:
- number of parameters
-
getRangeType
The MathType of the parameter(s)- Returns:
- the Tuple of parameters
-
getRealTypeName
Get the name of the RealType of the parameter at idx- Parameters:
idx
- index of parameter- Returns:
- name of the RealType.
-
getFieldImpl
Access to the FieldImpl made. Contains a sequence of times: (time -> (domain -> range)). Does not make a copy.- Returns:
- the data in a FieldImpl deprecated Use getGrid() instead
-
getGrid
Access to the FieldImpl made. Contains a sequence of times: (time -> (domain -> range)). Does not copy data- Returns:
- the data in a FieldImpl
-
getGrid
Access to the FieldImpl made. Contains a sequence of times: (time -> (domain -> range))- Parameters:
copy
- make a copy if true- Returns:
- the data in a FieldImpl
-
getRawUnit
Get the default unit for the parameter at idx- Parameters:
idx
- index of parameter- Returns:
- default unit
-
getDomainSet3D
Get the 3D domain- Returns:
- 3D domain or null if not a 3D grid
-
getCoords3D
public float[][] getCoords3D()Get the array of 3D coordinate values from the spatial set, this returns the actual array, so don't change the values!- Returns:
- array of coordinates or null if not a 3D grid. This returns the actual array, so don't change the values!
-
getThreeDCoordTrans
Get the coordinate system for the 3D domain. The reference of the coordinate transform should be lat/lon/alt- Returns:
- coordinate system with reference of lat/lon/alt or null if 2D data
-
getSize
Get the sizes of the 3D domain- Returns:
- the sizes
-
getSizeX
public int getSizeX()Get the number of X components in the domain- Returns:
- number of X components
-
getSizeY
public int getSizeY()Get the number of Y components in the domain- Returns:
- number of Y components
-
getSizeZ
public int getSizeZ()Get the number of Z components in the domain- Returns:
- number of Z components
-
getFlatField
Get a representative grid from one timestep. May be entire grid if not a sequence.- Returns:
- one timestep grid (with no time dimension)
-
getZUnit
Get the unit of the data's Z coordinate- Returns:
- Unit zUnit the data's z coordinate unit.
-
getZType
Get the RealType of the data's Z coordinate- Returns:
- RealType the RealType of the Z (vertical) coordinate
-
getZUnitName
Get the name of the data's Z coordinate Unit- Returns:
- String zUnit from z coordinate RealType unit.
-
toString
String representation of this GridDataInstance -
getLevels
Get the array of levels associated with this grid- Returns:
- array of levels
-
getDateTimes
Get the array of times for this data- Returns:
- array of times
-
sliceAtLevel
Slice the grid at a particular level. Interface to GridUtil.sliceAtLevel().- Parameters:
level
- level to slice at- Returns:
- 2D grid of data at the level
- Throws:
VisADException
- problems doing slice- See Also:
-
sliceAlongLatLonLine
Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().- Parameters:
start
- starting position for lineend
- ending position for line- Returns:
- slice along the line
- Throws:
VisADException
- problem doing slice- See Also:
-
sliceAlongLatLonLine
public FieldImpl sliceAlongLatLonLine(LatLonPoint start, LatLonPoint end, int samplingMode) throws VisADException Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().- Parameters:
start
- starting position for lineend
- ending position for linesamplingMode
- type of sampling- Returns:
- slice along the line
- Throws:
VisADException
- problem doing slice- See Also:
-
sliceAlongLatLonLine
public FieldImpl sliceAlongLatLonLine(List<LatLonPoint> points, int samplingMode) throws VisADException Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().- Parameters:
samplingMode
- type of samplingstart
- starting position for lineend
- ending position for line- Returns:
- slice along the line
- Throws:
VisADException
- problem doing slice- See Also:
-
slice
Slice (resample) the grid along the slice Interface to GridUtil.slice().- Parameters:
slice
- resampling domain- Returns:
- slice of data from grid along the domain
- Throws:
VisADException
- problem with slice
-
isEnsemble
public boolean isEnsemble()Is the grid an ensemble?- Returns:
- true if an ensemble
-
getEnsembleSet
Get the ensemble set- Returns:
- the set or null if not an ensemble
-
getNumEnsembles
public int getNumEnsembles()Get number of ensembles- Returns:
- number of ensemble members (or 0)
-