Class GridDataInstance

java.lang.Object
ucar.unidata.data.DataInstance
ucar.unidata.data.grid.GridDataInstance

public class GridDataInstance extends DataInstance
A wrapper around grid data.
Version:
$Revision: 1.72 $ $Date: 2006/12/05 18:52:36 $
Author:
Jeff McWhirter
  • Constructor Details

  • Method Details

    • reInitialize

      public void reInitialize() throws VisADException, RemoteException
      Reinitialize this GridDataInstance
      Overrides:
      reInitialize in class DataInstance
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • init

      protected void init() throws VisADException, RemoteException
      Initialize this object. Get the data and populate all the parameters
      Overrides:
      init in class DataInstance
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • getNavigation

      public MapProjection getNavigation()
      Get the geolocation information for this grid
      Returns:
      geolocation as a MapProjection.
    • 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

      public SampledSet 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

      public static Unit getZUnit(FieldImpl field) throws VisADException, RemoteException
      Get the vertical unit for a given grid
      Parameters:
      field - 3D grid
      Returns:
      Unit of vertical coordinate
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • getRange

      public Range getRange(int idx)
      Return the idx'th range value
      Parameters:
      idx - range index
      Returns:
      the Range of values for that index
    • getRanges

      public Range[] getRanges()
      Get all the data ranges for this grid
      Returns:
      array of Ranges
    • getRealType

      public RealType getRealType(int idx)
      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

      public MathType getRangeType()
      The MathType of the parameter(s)
      Returns:
      the Tuple of parameters
    • getRealTypeName

      public String getRealTypeName(int idx)
      Get the name of the RealType of the parameter at idx
      Parameters:
      idx - index of parameter
      Returns:
      name of the RealType.
    • getFieldImpl

      public FieldImpl 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

      public FieldImpl 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

      public FieldImpl getGrid(boolean copy)
      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

      public Unit getRawUnit(int idx)
      Get the default unit for the parameter at idx
      Parameters:
      idx - index of parameter
      Returns:
      default unit
    • getDomainSet3D

      public Gridded3DSet 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

      public CoordinateSystem 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

      public ThreeDSize 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

      public FlatField 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

      public Unit getZUnit()
      Get the unit of the data's Z coordinate
      Returns:
      Unit zUnit the data's z coordinate unit.
    • getZType

      public RealType getZType()
      Get the RealType of the data's Z coordinate
      Returns:
      RealType the RealType of the Z (vertical) coordinate
    • getZUnitName

      public String getZUnitName()
      Get the name of the data's Z coordinate Unit
      Returns:
      String zUnit from z coordinate RealType unit.
    • toString

      public String toString()
      String representation of this GridDataInstance
      Overrides:
      toString in class Object
      Returns:
      output string
    • getLevels

      public Real[] getLevels()
      Get the array of levels associated with this grid
      Returns:
      array of levels
    • getDateTimes

      public DateTime[] getDateTimes()
      Get the array of times for this data
      Returns:
      array of times
    • sliceAtLevel

      public FieldImpl sliceAtLevel(Real level) throws VisADException
      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

      public FieldImpl sliceAlongLatLonLine(LatLonPoint start, LatLonPoint end) throws VisADException
      Slice the grid at along a lat/lon line Interface to GridUtil.sliceAlongLatLonLine().
      Parameters:
      start - starting position for line
      end - 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 line
      end - ending position for line
      samplingMode - 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 sampling
      start - starting position for line
      end - ending position for line
      Returns:
      slice along the line
      Throws:
      VisADException - problem doing slice
      See Also:
    • slice

      public FieldImpl slice(SampledSet slice) throws VisADException
      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

      public Gridded1DSet 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)