ucar.nc2.dt.point
Class PointObsDatasetImpl

java.lang.Object
  extended by ucar.nc2.dt.TypedDatasetImpl
      extended by ucar.nc2.dt.point.PointObsDatasetImpl
All Implemented Interfaces:
PointCollection, PointObsDataset, TypedDataset
Direct Known Subclasses:
DapperDataset, MadisPointObsDataset, OldUnidataPointObsDataset, StationObsDatasetImpl, UnidataPointObsDataset

public abstract class PointObsDatasetImpl
extends TypedDatasetImpl
implements PointObsDataset

Superclass for implementations of PointObsDataset.

Author:
caron

Field Summary
protected  DateFormatter formatter
           
protected  DateUnit timeUnit
           
 
Fields inherited from class ucar.nc2.dt.TypedDatasetImpl
boundingBox, dataVariables, desc, endDate, location, ncfile, parseInfo, startDate, title
 
Constructor Summary
PointObsDatasetImpl()
           
PointObsDatasetImpl(NetcdfDataset ncfile)
           
PointObsDatasetImpl(String title, String description, String location)
           
 
Method Summary
 List getData()
          Get all data.
 List getData(LatLonRect boundingBox)
          Get all data within the specified bounding box.
 List getData(LatLonRect boundingBox, Date start, Date end)
          Get all data within the specified bounding box and date range.
 Class getDataClass()
          The getData() methods return objects of this Class
 String getDetailInfo()
           
protected static double getMetersConversionFactor(String unitsString)
          Get conversion factor for this unit into meters.
 FeatureType getScientificDataType()
           
protected  double getTime(Variable timeVar, StructureData sdata)
           
 DateUnit getTimeUnits()
          Get the units of Calendar time.
protected abstract  void setTimeUnits()
           
 
Methods inherited from class ucar.nc2.dt.TypedDatasetImpl
close, findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getDescription, getEndDate, getGlobalAttributes, getLocation, getLocationURI, getNetcdfFile, getStartDate, getTitle, removeDataVariable, setBoundingBox, setDescription, setEndDate, setLocationURI, setStartDate, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.dt.TypedDataset
close, findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getDescription, getEndDate, getGlobalAttributes, getLocationURI, getNetcdfFile, getStartDate, getTitle
 
Methods inherited from interface ucar.nc2.dt.PointCollection
getData, getData, getData, getDataCount, getDataIterator
 

Field Detail

timeUnit

protected DateUnit timeUnit

formatter

protected DateFormatter formatter
Constructor Detail

PointObsDatasetImpl

public PointObsDatasetImpl()

PointObsDatasetImpl

public PointObsDatasetImpl(String title,
                           String description,
                           String location)

PointObsDatasetImpl

public PointObsDatasetImpl(NetcdfDataset ncfile)
Method Detail

getMetersConversionFactor

protected static double getMetersConversionFactor(String unitsString)
                                           throws Exception
Get conversion factor for this unit into meters.

Parameters:
unitsString - unit you want to convert
Returns:
conversion factor : value in meters = factor * (value in units)
Throws:
Exception - if not valid unit, or not convertible to meters

setTimeUnits

protected abstract void setTimeUnits()

getDetailInfo

public String getDetailInfo()
Specified by:
getDetailInfo in interface TypedDataset
Overrides:
getDetailInfo in class TypedDatasetImpl
Returns:
debug / underlying implementation details

getScientificDataType

public FeatureType getScientificDataType()

getDataClass

public Class getDataClass()
Description copied from interface: PointCollection
The getData() methods return objects of this Class

Specified by:
getDataClass in interface PointCollection
Returns:
Class of the data

getTimeUnits

public DateUnit getTimeUnits()
Description copied from interface: PointCollection
Get the units of Calendar time. To get a Date, from a time value, call DateUnit.makeDate(double value). To get units as a String, call DateUnit.getUnitsString().

Specified by:
getTimeUnits in interface PointCollection
Returns:
the units of Calendar time.

getData

public List getData()
             throws IOException
Description copied from interface: PointCollection
Get all data. Return null if too expensive to implement. Call getDataCount() to get estimate of size. This will return a list of getDataClass(), but the actual data may or may not already be read in to memory. In any case, you call dataType.getData() to get the data.

Specified by:
getData in interface PointCollection
Returns:
List of type getDataClass()
Throws:
IOException - on io error
See Also:
as a (possibly) more efficient alternative

getData

public List getData(LatLonRect boundingBox)
             throws IOException
Description copied from interface: PointCollection
Get all data within the specified bounding box.

Specified by:
getData in interface PointCollection
Parameters:
boundingBox - restrict data to this bounding nox
Returns:
List of type getDataClass()
Throws:
IOException - on io error
See Also:
as a (possibly) more efficient alternative

getData

public List getData(LatLonRect boundingBox,
                    Date start,
                    Date end)
             throws IOException
Description copied from interface: PointCollection
Get all data within the specified bounding box and date range.

Specified by:
getData in interface PointCollection
Parameters:
boundingBox - restrict data to this bounding nox
start - restrict data to after this time
end - restrict data to before this time
Returns:
List of type getDataClass()
Throws:
IOException - on io error
See Also:
as a (possibly) more efficient alternative

getTime

protected double getTime(Variable timeVar,
                         StructureData sdata)
                  throws ParseException
Throws:
ParseException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.