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.open (uriString);
 List grids = gridDs.getGrids();
 for (int i=0; i<grids.size(); i++) {
 GeoGrid grid = (Geogrid) grids.get(i);
 }
 

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)
           
 GeoGrid findGridByName(java.lang.String name)
          find the named GeoGrid.
 GridDatatype findGridDatatype(java.lang.String name)
          find the named GridDatatype.
 LatLonRect getBoundingBox()
           
 VariableSimpleIF getDataVariable(java.lang.String shortName)
          Get the named data Variable.
 java.util.List<VariableSimpleIF> getDataVariables()
          The data Variables available in this dataset.
 java.lang.String getDescription()
           
 java.lang.String getDetailInfo()
          Get Details about the dataset.
 java.util.Date getEndDate()
           
 java.util.List<Attribute> getGlobalAttributes()
          List of global attributes.
 java.util.List<GridDatatype> getGrids()
          get the list of GridDatatype objects contained in this dataset.
 java.util.List<GridDataset.Gridset> getGridsets()
          Return GridDatatype objects grouped by GridCoordSys.
 java.lang.String getInfo()
          Show Grids and coordinate systems.
 java.lang.String getLocationURI()
           
 java.lang.String getName()
           
 NetcdfDataset getNetcdfDataset()
           
 NetcdfFile getNetcdfFile()
           
 java.lang.StringBuilder getParseInfo()
           
 java.util.Date getStartDate()
           
 java.lang.String getTitle()
           
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
clone, equals, finalize, 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 - on read error
See Also:
NetcdfFile.open(java.lang.String)

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface TypedDataset
Returns:
Title of the dataset.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface TypedDataset
Returns:
Text information about this dataset.

getLocationURI

public java.lang.String getLocationURI()
Specified by:
getLocationURI in interface TypedDataset
Returns:
The URI location of the dataset

getStartDate

public java.util.Date getStartDate()
Specified by:
getStartDate in interface TypedDataset
Returns:
Start date for the entire dataset.

getEndDate

public java.util.Date getEndDate()
Specified by:
getEndDate in interface TypedDataset
Returns:
End date for the entire dataset.

getBoundingBox

public LatLonRect getBoundingBox()
Specified by:
getBoundingBox in interface TypedDataset
Returns:
the boundingBox for the entire dataset.

getGlobalAttributes

public java.util.List<Attribute> 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)
Specified by:
findGlobalAttributeIgnoreCase in interface TypedDataset
Parameters:
name - attribute name
Returns:
the global attribute with the given name, ingnoring case.

getDataVariables

public java.util.List<VariableSimpleIF> 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()
Specified by:
getNetcdfFile in interface TypedDataset
Returns:
underlying NetcdfFile, or null if none.

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 - on I/O error

getName

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

getNetcdfDataset

public NetcdfDataset getNetcdfDataset()
Returns:
the underlying NetcdfDataset

getGrids

public java.util.List<GridDatatype> getGrids()
Description copied from interface: GridDataset
get the list of GridDatatype objects contained in this dataset.

Specified by:
getGrids in interface GridDataset
Returns:
the list of GeoGrid objects contained in this dataset.

findGridDatatype

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

Specified by:
findGridDatatype in interface GridDataset
Parameters:
name - look for this name
Returns:
the named GridDatatype, or null if not found

getGridsets

public java.util.List<GridDataset.Gridset> 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.

Parameters:
name - find this GeoGrid by name
Returns:
the named GeoGrid, or null if not found

getInfo

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

Returns:
info about this GridDataset

getParseInfo

public java.lang.StringBuilder getParseInfo()

getDetailInfo

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

Specified by:
getDetailInfo in interface TypedDataset
Returns:
debug / underlying implementation details

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

main

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