ucar.nc2.thredds
Class DqcStationObsDataset
java.lang.Object
ucar.nc2.dt.TypedDatasetImpl
ucar.nc2.dt.point.PointObsDatasetImpl
ucar.nc2.dt.point.StationObsDatasetImpl
ucar.nc2.thredds.DqcStationObsDataset
- All Implemented Interfaces:
- PointCollection, PointObsDataset, StationCollection, StationObsDataset, TypedDataset
public class DqcStationObsDataset
- extends StationObsDatasetImpl
This implements a StationObsDataset with a DQC.
- Author:
- John Caron
| Methods inherited from class ucar.nc2.dt.point.StationObsDatasetImpl |
getData, getData, getData, getData, getData, getData, getData, getData, getData, getDataClass, getDataIterator, getDataIterator, getDetailInfo, getScientificDataType, getStation, getStationDataCount, getStations, getStations, getStations, getStations, sortByTime |
| Methods inherited from class ucar.nc2.dt.TypedDatasetImpl |
close, findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getEndDate, getGlobalAttributes, getNetcdfFile, getStartDate, removeDataVariable, setDescription, setLocationURI, setTitle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
factory
public static DqcStationObsDataset factory(InvDataset ds,
java.lang.String dqc_location,
java.lang.StringBuilder errlog)
throws java.io.IOException
- Throws:
java.io.IOException
factory
public static DqcStationObsDataset factory(java.lang.String desc,
java.lang.String dqc_location,
java.lang.StringBuilder errlog)
throws java.io.IOException
- Throws:
java.io.IOException
setTimeUnits
protected void setTimeUnits()
- Specified by:
setTimeUnits in class PointObsDatasetImpl
setStartDate
protected void setStartDate()
- Specified by:
setStartDate in class TypedDatasetImpl
setEndDate
protected void setEndDate()
- Specified by:
setEndDate in class TypedDatasetImpl
setBoundingBox
protected void setBoundingBox()
- Specified by:
setBoundingBox in class TypedDatasetImpl
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle in interface TypedDataset- Overrides:
getTitle in class TypedDatasetImpl
- Returns:
- Title of the dataset.
getLocationURI
public java.lang.String getLocationURI()
- Specified by:
getLocationURI in interface TypedDataset- Overrides:
getLocationURI in class TypedDatasetImpl
- Returns:
- The URI location of the dataset
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription in interface TypedDataset- Overrides:
getDescription in class TypedDatasetImpl
- Returns:
- Text information about this dataset.
getData
public java.util.List getData(Station s,
CancelTask cancel)
throws java.io.IOException
- Description copied from interface:
StationCollection
- Get all data for this Station, allow user to cancel.
- Parameters:
s - for this Stationcancel - allow user to cancel. Implementors should return ASAP.
- Returns:
- List of getDataClass()
- Throws:
java.io.IOException - on io error
getData
public java.util.List getData(CancelTask cancel)
throws java.io.IOException
- Description copied from interface:
PointCollection
- Get all data, allow user to cancel. 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.
- Parameters:
cancel - allow user to cancel. Implementors should return ASAP.
- Returns:
- List of type getDataClass()
- Throws:
java.io.IOException - on io error- See Also:
as a (possibly) more efficient alternative
getDataCount
public int getDataCount()
- Description copied from interface:
PointCollection
- Get estimate of number of data records (may not be exact).
Return -1 if not able to estimate.
- Returns:
- number of data records or -1
getDataIterator
public DataIterator getDataIterator(int bufferSize)
throws java.io.IOException
- Description copied from interface:
PointCollection
- Get an efficient iterator over all the data in the Collection. You must fully process the
data, or copy it out of the StructureData, as you iterate over it. DO NOT KEEP ANY REFERENCES to the
dataType object or the StructureData object.
This is the efficient way to get all the data, it can be 100 times faster than getData().
This will return an iterator over type getDataClass(), and the actual data has already been read
into memory, that is, dataType.getData() will not incur any I/O.
This is accomplished by buffering bufferSize amount of data at once.
We dont need a cancelTask, just stop the iteration if the user want to cancel.
Example for point observations:
Iterator iter = pointObsDataset.getDataIterator();
while (iter.hasNext()) {
PointObsDatatype pobs = (PointObsDatatype) iter.next();
StructureData sdata = pobs.getData();
// process fully
}
- Parameters:
bufferSize - if > 0, the internal buffer size, else use the default. Typically 100k - 1M for best results.
- Returns:
- iterator over type getDataClass(), no guarenteed order.
- Throws:
java.io.IOException - on io error
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException