Class GridCoverageAdapter

java.lang.Object
ucar.unidata.data.grid.GridCoverageAdapter

public class GridCoverageAdapter extends Object
Adapt a ucar.unidata.GeoGrid into VisAD Data object(s). GeoGridAdapter gets a Geogrid and has methods to create a a VisAD 2D or 3D FlatField, or sequence of same, from the GeoGrid for parameter names and time(s) desired.
Author:
Don Murray
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    cache file
  • Constructor Summary

    Constructors
    Constructor
    Description
    GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, String paramName)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, String paramName, ucar.nc2.NetcdfFile ncFile)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, String paramName, ucar.nc2.NetcdfFile ncFile, Object extraCacheKey)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, ucar.nc2.NetcdfFile ncFile)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get all the data from this GeoGrid.
    protected ucar.nc2.ft2.coverage.Coverage
    Get the geogrid that this adapter uses
    protected List
    Create the list of levels for this grid
    Get a time ordered sequence of 2D flat fields
    getSequence(int[] timeIndices)
    Get a time ordered sequence of 2D flat fields
    getSequence(int[] timeIndices, int[] memberIndices, Object loadId)
    Get a time ordered sequence of 2D flat fields
    getSequence(int[] timeIndices, Object loadId)
    Get a time ordered sequence of 2D flat fields
    int
    indexOf(Object o, List levels)
     
    static boolean
    isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
    Utility to check if we should ignore the given z axis
    static boolean
    isZUnitOk(Unit zUnit, ucar.unidata.geoloc.vertical.VerticalTransform vt)
    Utility to check if we can handle the vertical transform

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • cacheFile

      public String cacheFile
      cache file
  • Constructor Details

    • GridCoverageAdapter

      public GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params) throws VisADException
      Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
      Parameters:
      dataSource - source of this GeoGrid
      geoGrid - the GeoGrid in question
      params - subset parameter
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GridCoverageAdapter

      public GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, String paramName) throws VisADException
      Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
      Parameters:
      dataSource - source of this GeoGrid
      geoGrid - the GeoGrid in question
      params - the subset parameter
      paramName - name of the parameter
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GridCoverageAdapter

      public GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, ucar.nc2.NetcdfFile ncFile) throws VisADException
      Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
      Parameters:
      dataSource - source of this GeoGrid
      geoGrid - the GeoGrid in question
      params - the subset parameter
      ncFile - file that the GeoGrid data is coming from
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GridCoverageAdapter

      public GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, String paramName, ucar.nc2.NetcdfFile ncFile) throws VisADException
      Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
      Parameters:
      dataSource - source of this GeoGrid
      geoGrid - the GeoGrid in question
      params - the subset parameter
      paramName - name of the parameter
      ncFile - file that the GeoGrid data is coming from
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GridCoverageAdapter

      public GridCoverageAdapter(GridCoverageDataSource dataSource, ucar.nc2.ft2.coverage.Coverage geoGrid, ucar.nc2.ft2.coverage.SubsetParams params, String paramName, ucar.nc2.NetcdfFile ncFile, Object extraCacheKey) throws VisADException
      Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
      Parameters:
      dataSource - source of this GeoGrid
      geoGrid - the GeoGrid in question
      params - the subset parameter
      paramName - name of the parameter
      ncFile - file that the GeoGrid data is coming from
      extraCacheKey - Extra key to use when caching
      Throws:
      VisADException - unable to create one of the VisAD objects
  • Method Details

    • isZAxisOk

      public static boolean isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
      Utility to check if we should ignore the given z axis
      Parameters:
      zaxis - given z axis
      Returns:
      Is ok
    • isZUnitOk

      public static boolean isZUnitOk(Unit zUnit, ucar.unidata.geoloc.vertical.VerticalTransform vt)
      Utility to check if we can handle the vertical transform
      Parameters:
      zUnit - zUnit
      vt - vertical transform
      Returns:
      true if we can
    • getLevels

      protected List getLevels() throws VisADException
      Create the list of levels for this grid
      Returns:
      List of levels as Real-s
      Throws:
      VisADException - On badness
    • getGeoGrid

      protected ucar.nc2.ft2.coverage.Coverage getGeoGrid()
      Get the geogrid that this adapter uses
      Returns:
      the GeoGrid or null
    • getSequence

      public FieldImpl getSequence()
      Get a time ordered sequence of 2D flat fields
      Returns:
      data for all the times for a particular 2D field
    • getSequence

      public FieldImpl getSequence(int[] timeIndices)
      Get a time ordered sequence of 2D flat fields
      Parameters:
      timeIndices - indices of times in the data
      Returns:
      data for all the times for a particular 2D field
    • getSequence

      public FieldImpl getSequence(int[] timeIndices, Object loadId)
      Get a time ordered sequence of 2D flat fields
      Parameters:
      timeIndices - indices of times in the data
      loadId - loadId
      Returns:
      data for all the times for a particular 2D field
    • getSequence

      public FieldImpl getSequence(int[] timeIndices, int[] memberIndices, Object loadId)
      Get a time ordered sequence of 2D flat fields
      Parameters:
      timeIndices - indices of times in the data
      memberIndices - the member indices
      loadId - loadId
      Returns:
      data for all the times for a particular 2D field
    • getData

      public FieldImpl getData() throws VisADException
      Get all the data from this GeoGrid.
      Returns:
      VisAD representation of this GeoGrid
      Throws:
      VisADException - problem creating the grid
    • indexOf

      public int indexOf(Object o, List levels) throws VisADException
      Throws:
      VisADException