Class GeoGridAdapter

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

public class GeoGridAdapter 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
    GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, String paramName)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, String paramName, ucar.nc2.NetcdfFile ncFile)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, String paramName, ucar.nc2.NetcdfFile ncFile, Object extraCacheKey)
    Construct a GeoGridAdapter that will take a GeoGrid and return VisAD Data objects from it.
    GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, 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.dt.grid.GeoGrid
    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
    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

    • GeoGridAdapter

      public GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid) 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
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GeoGridAdapter

      public GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, 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
      paramName - name of the parameter
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GeoGridAdapter

      public GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, 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
      ncFile - file that the GeoGrid data is coming from
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GeoGridAdapter

      public GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, 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
      paramName - name of the parameter
      ncFile - file that the GeoGrid data is coming from
      Throws:
      VisADException - unable to create one of the VisAD objects
    • GeoGridAdapter

      public GeoGridAdapter(GeoGridDataSource dataSource, ucar.nc2.dt.grid.GeoGrid geoGrid, 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
      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

    • 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.dt.grid.GeoGrid 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
    • 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