ucar.nc2.dt.grid
Class GridDataset

java.lang.Object
  extended by ucar.nc2.dt.grid.GridDataset
All Implemented Interfaces:
GridDataset, TypedDataset

public class GridDataset
extends java.lang.Object
implements GridDataset

Make a NetcdfDataset into a collection of GeoGrids with Georeferencing coordinate systems.

A variable will be made into a GeoGrid if it has a Georeferencing coordinate system, using GridCoordSys.isGridCoordSys(), and it has no extra dimensions, ie GridCoordSys.isComplete( var) is true. If it has multiple Georeferencing coordinate systems, any one that is a product set will be given preference. Example:

    GridDataset gridDs = GridDataset.factory (uriString);
    List grids = gridDs.getGrids();
    for (int i=0; i<grids.size(); i++) {
      GeoGrid grid = (Geogrid) grids.get(i);
    }
   

Version:
$Revision: 48 $ $Date: 2006-07-12 16:15:40Z $
Author:
caron

Nested Class Summary
 class GridDataset.Gridset
          This is a set of GeoGrids with the same GeoCoordSys.
 
Constructor Summary
GridDataset(NetcdfDataset ds)
          Create a GridDataset from a NetcdfDataset.
 
Method Summary
 void close()
          Close all resources associated with this dataset.
static GridDataset factory(java.lang.String netcdfFileURI)
          Deprecated. : use GridDataset.open().
 Attribute findGlobalAttributeIgnoreCase(java.lang.String name)
          Return the global attribute with the given name, ingnoring case.
 GeoGrid findGridByName(java.lang.String name)
          find the named GeoGrid.
 GridDatatype findGridDatatype(java.lang.String name)
          find the named GridDatatype.
 LatLonRect getBoundingBox()
          The boundingBox for the entire dataset.
 VariableSimpleIF getDataVariable(java.lang.String shortName)
          Get the named data Variable.
 java.util.List getDataVariables()
          The data Variables available in this dataset.
 java.lang.String getDescription()
          Text information about this dataset.
 java.lang.String getDetailInfo()
          Get Details about the dataset.
 java.util.Date getEndDate()
          End date for the entire dataset.
 java.util.List getGlobalAttributes()
          List of global attributes.
 java.util.List getGrids()
          get the list of GeoGrid objects contained in this dataset.
 java.util.List getGridsets()
          Return GridDatatype objects grouped by GridCoordSys.
 java.lang.String getInfo()
          Show Grids and coordinate systems.
 java.lang.String getLocationURI()
          The URI location of the dataset
 java.lang.String getName()
          the name of the dataset
 NetcdfDataset getNetcdfDataset()
          the underlying NetcdfDataset
 NetcdfFile getNetcdfFile()
          Return underlying NetcdfFile, or null if none.
 java.lang.StringBuffer getParseInfo()
           
 java.util.Date getStartDate()
          Start date for the entire dataset.
 java.lang.String getTitle()
          Title of the dataset.
static void main(java.lang.String[] arg)
          testing
static GridDataset open(java.lang.String netcdfFileURI)
          Open a netcdf dataset, parse Conventions, find all the geoGrids, return a GridDataset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridDataset

public GridDataset(NetcdfDataset ds)
Create a GridDataset from a NetcdfDataset.

Parameters:
ds - underlying NetcdfDataset.
Method Detail

open

public static GridDataset open(java.lang.String netcdfFileURI)
                        throws java.io.IOException
Open a netcdf dataset, parse Conventions, find all the geoGrids, return a GridDataset.

Parameters:
netcdfFileURI - netcdf dataset to open. May have a dods:, http: or file: prefix, or just a local filename. If it ends with ".xml", its assumed to be a NetcdfDataset Definition XML file
Returns:
GridDataset
Throws:
java.io.IOException
See Also:
NetcdfFile.open(java.lang.String)

factory

public static GridDataset factory(java.lang.String netcdfFileURI)
                           throws java.io.IOException
Deprecated. : use GridDataset.open().

Open a netcdf dataset, parse Conventions, find all the geoGrids, return a GridDataset.

Throws:
java.io.IOException

getTitle

public java.lang.String getTitle()
Description copied from interface: TypedDataset
Title of the dataset.

Specified by:
getTitle in interface TypedDataset

getDescription

public java.lang.String getDescription()
Description copied from interface: TypedDataset
Text information about this dataset.

Specified by:
getDescription in interface TypedDataset

getLocationURI

public java.lang.String getLocationURI()
Description copied from interface: TypedDataset
The URI location of the dataset

Specified by:
getLocationURI in interface TypedDataset

getStartDate

public java.util.Date getStartDate()
Description copied from interface: TypedDataset
Start date for the entire dataset.

Specified by:
getStartDate in interface TypedDataset

getEndDate

public java.util.Date getEndDate()
Description copied from interface: TypedDataset
End date for the entire dataset.

Specified by:
getEndDate in interface TypedDataset

getBoundingBox

public LatLonRect getBoundingBox()
Description copied from interface: TypedDataset
The boundingBox for the entire dataset.

Specified by:
getBoundingBox in interface TypedDataset

getGlobalAttributes

public java.util.List getGlobalAttributes()
Description copied from interface: TypedDataset
List of global attributes.

Specified by:
getGlobalAttributes in interface TypedDataset
Returns:
List of type ucar.nc2.Attribute

findGlobalAttributeIgnoreCase

public Attribute findGlobalAttributeIgnoreCase(java.lang.String name)
Description copied from interface: TypedDataset
Return the global attribute with the given name, ingnoring case.

Specified by:
findGlobalAttributeIgnoreCase in interface TypedDataset

getDataVariables

public java.util.List getDataVariables()
Description copied from interface: TypedDataset
The data Variables available in this dataset. Should just be data variable others might be searching for, not metadata or coordinate system variables, etc. The shape of this VariableSimpleIF does not necessarily match the

Specified by:
getDataVariables in interface TypedDataset
Returns:
List of type VariableSimpleIF

getDataVariable

public VariableSimpleIF getDataVariable(java.lang.String shortName)
Description copied from interface: TypedDataset
Get the named data Variable.

Specified by:
getDataVariable in interface TypedDataset
Parameters:
shortName - of data Variable.
Returns:
VariableSimpleIF or null.

getNetcdfFile

public NetcdfFile getNetcdfFile()
Description copied from interface: TypedDataset
Return underlying NetcdfFile, or null if none.

Specified by:
getNetcdfFile in interface TypedDataset

close

public void close()
           throws java.io.IOException
Close all resources associated with this dataset.

Specified by:
close in interface TypedDataset
Throws:
java.io.IOException

getName

public java.lang.String getName()
the name of the dataset


getNetcdfDataset

public NetcdfDataset getNetcdfDataset()
the underlying NetcdfDataset


getGrids

public java.util.List getGrids()
get the list of GeoGrid objects contained in this dataset.

Specified by:
getGrids in interface GridDataset

findGridDatatype

public GridDatatype findGridDatatype(java.lang.String name)
Description copied from interface: GridDataset
find the named GridDatatype.

Specified by:
findGridDatatype in interface GridDataset

getGridsets

public java.util.List getGridsets()
Return GridDatatype objects grouped by GridCoordSys. All GridDatatype in a Gridset have the same GridCoordSystem.

Specified by:
getGridsets in interface GridDataset
Returns:
List of type ucar.nc2.dt.GridDataset.Gridset

findGridByName

public GeoGrid findGridByName(java.lang.String name)
find the named GeoGrid.


getInfo

public java.lang.String getInfo()
Show Grids and coordinate systems.


getParseInfo

public java.lang.StringBuffer getParseInfo()

getDetailInfo

public java.lang.String getDetailInfo()
Get Details about the dataset.

Specified by:
getDetailInfo in interface TypedDataset

main

public static void main(java.lang.String[] arg)
testing