|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.nc2.dt.grid.GridDataset
public class 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);
}
| Nested Class Summary | |
|---|---|
class |
GridDataset.Gridset
This is a set of GeoGrids with the same GeoCoordSys. |
| Field Summary | |
|---|---|
protected FileCache |
fileCache
|
| Constructor Summary | |
|---|---|
GridDataset(NetcdfDataset ds)
Create a GridDataset from a NetcdfDataset. |
|
GridDataset(NetcdfDataset ds,
java.util.Formatter parseInfo)
Create a GridDataset from a NetcdfDataset. |
|
| Method Summary | |
|---|---|
void |
calcBounds()
Caclulate date range and bounding box, even if the data has to be scanned. |
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, ignoring 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<VariableSimpleIF> |
getDataVariables()
The data Variables available in this dataset. |
DateRange |
getDateRange()
Date range for the entire dataset. |
java.lang.String |
getDescription()
Text information about this dataset. |
java.lang.String |
getDetailInfo()
Get Details about the dataset. |
void |
getDetailInfo(java.util.Formatter sf)
Show debug / underlying implementation details |
java.util.Date |
getEndDate()
Ending date for the entire dataset. |
FeatureType |
getFeatureType()
Contains collections of this FeatureType. |
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 |
getImplementationName()
Show who is implementing |
void |
getInfo(java.lang.StringBuilder buf)
Show Grids and coordinate systems. |
java.lang.String |
getLocation()
The URI location of the dataset |
java.lang.String |
getLocationURI()
|
java.lang.String |
getName()
|
NetcdfDataset |
getNetcdfDataset()
|
NetcdfFile |
getNetcdfFile()
Return underlying NetcdfFile, or null if none. |
java.util.Date |
getStartDate()
Starting 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 location)
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems and turn into a GridDataset. |
void |
setFileCache(FileCache fileCache)
FileCacheable must store the FileCache and call it on close(): |
boolean |
sync()
Sync() is called when the FileCacheable is found in the cache, before returning the object to the application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected FileCache fileCache
| Constructor Detail |
|---|
public GridDataset(NetcdfDataset ds)
throws java.io.IOException
ds - underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.
java.io.IOException - on read error
public GridDataset(NetcdfDataset ds,
java.util.Formatter parseInfo)
throws java.io.IOException
ds - underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.parseInfo - put parse info here, may be null
java.io.IOException - on read error| Method Detail |
|---|
public static GridDataset open(java.lang.String location)
throws java.io.IOException
location - netcdf dataset to open, using NetcdfDataset.acquireDataset().
java.io.IOException - on read errorNetcdfDataset.acquireDataset(java.lang.String, ucar.nc2.util.CancelTask)public java.lang.String getTitle()
FeatureDataset
getTitle in interface TypedDatasetgetTitle in interface FeatureDatasetpublic java.lang.String getDescription()
FeatureDataset
getDescription in interface TypedDatasetgetDescription in interface FeatureDatasetpublic java.lang.String getLocation()
FeatureDataset
getLocation in interface FeatureDatasetgetLocation in interface FileCacheablepublic java.lang.String getLocationURI()
getLocationURI in interface TypedDatasetpublic java.util.Date getStartDate()
FeatureDataset
getStartDate in interface TypedDatasetgetStartDate in interface FeatureDatasetpublic java.util.Date getEndDate()
FeatureDataset
getEndDate in interface TypedDatasetgetEndDate in interface FeatureDatasetpublic LatLonRect getBoundingBox()
FeatureDataset
getBoundingBox in interface TypedDatasetgetBoundingBox in interface FeatureDataset
public void calcBounds()
throws java.io.IOException
FeatureDataset
calcBounds in interface FeatureDatasetjava.io.IOException - or read error.public java.util.List<Attribute> getGlobalAttributes()
TypedDataset
getGlobalAttributes in interface TypedDatasetgetGlobalAttributes in interface FeatureDatasetpublic Attribute findGlobalAttributeIgnoreCase(java.lang.String name)
FeatureDataset
findGlobalAttributeIgnoreCase in interface TypedDatasetfindGlobalAttributeIgnoreCase in interface FeatureDatasetname - attribute name
public java.util.List<VariableSimpleIF> getDataVariables()
TypedDataset
getDataVariables in interface TypedDatasetgetDataVariables in interface FeatureDatasetpublic VariableSimpleIF getDataVariable(java.lang.String shortName)
TypedDataset
getDataVariable in interface TypedDatasetgetDataVariable in interface FeatureDatasetshortName - of data Variable.
public NetcdfFile getNetcdfFile()
FeatureDataset
getNetcdfFile in interface TypedDatasetgetNetcdfFile in interface FeatureDatasetpublic java.lang.String getName()
public NetcdfDataset getNetcdfDataset()
public java.util.List<GridDatatype> getGrids()
GridDataset
getGrids in interface GridDatasetpublic GridDatatype findGridDatatype(java.lang.String name)
GridDataset
findGridDatatype in interface GridDatasetname - look for this name
public java.util.List<GridDataset.Gridset> getGridsets()
getGridsets in interface GridDatasetpublic GeoGrid findGridByName(java.lang.String name)
name - find this GeoGrid by name
public void getInfo(java.lang.StringBuilder buf)
buf - put info herepublic java.lang.String getDetailInfo()
getDetailInfo in interface TypedDatasetpublic FeatureType getFeatureType()
FeatureDataset
getFeatureType in interface FeatureDatasetpublic DateRange getDateRange()
FeatureDataset
getDateRange in interface FeatureDatasetpublic void getDetailInfo(java.util.Formatter sf)
FeatureDataset
getDetailInfo in interface FeatureDatasetsf - append info herepublic java.lang.String getImplementationName()
FeatureDataset
getImplementationName in interface FeatureDataset
public void close()
throws java.io.IOException
TypedDataset
close in interface TypedDatasetclose in interface FeatureDatasetclose in interface FileCacheablejava.io.IOException
public boolean sync()
throws java.io.IOException
FileCacheable
sync in interface FileCacheablejava.io.IOException - on i/o error.public void setFileCache(FileCache fileCache)
FileCacheable
public synchronized void close() throws java.io.IOException {
if (isClosed) return;
if (cache != null) {
cache.release(this);
} else {
reallyClose();
}
isClosed = true;
setFileCache in interface FileCacheablefileCache - must store this, use it on close as above.
public static GridDataset factory(java.lang.String netcdfFileURI)
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] arg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||