Package ucar.nc2.dt.point
Class OldUnidataStationObsDataset
- java.lang.Object
-
- ucar.nc2.dt.TypedDatasetImpl
-
- ucar.nc2.dt.point.PointObsDatasetImpl
-
- ucar.nc2.dt.point.StationObsDatasetImpl
-
- ucar.nc2.dt.point.OldUnidataStationObsDataset
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PointCollection,PointObsDataset,StationCollection,StationObsDataset,TypedDataset,TypedDatasetFactoryIF
public class OldUnidataStationObsDataset extends StationObsDatasetImpl implements TypedDatasetFactoryIF
Deprecated.use ucar.nc2.ft.pointThis handles datasets in the old metar2nc format. It identifies them by looking at the title, expecting "METAR definition", "SYNOPTIC definition", or "BUOY definition". It uses an NcML file to identify the names of the lat, lon, etc variables.Since there is no other way to find what the stations are, or to find what data belongs to what station, we read through the entire dataset at open. We construct the list of StationObsDatatype records, but without the data cached.
-
-
Field Summary
-
Fields inherited from class ucar.nc2.dt.point.StationObsDatasetImpl
stationHelper, stations
-
Fields inherited from class ucar.nc2.dt.point.PointObsDatasetImpl
formatter, timeUnit
-
Fields inherited from class ucar.nc2.dt.TypedDatasetImpl
boundingBox, dataVariables, desc, endDate, location, netcdfDataset, parseInfo, startDate, title
-
-
Constructor Summary
Constructors Constructor Description OldUnidataStationObsDataset()Deprecated.OldUnidataStationObsDataset(ucar.nc2.dataset.NetcdfDataset ds)Deprecated.OldUnidataStationObsDataset(ucar.nc2.dataset.NetcdfDataset ds, String ncmlURL)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ListgetData(ucar.nc2.util.CancelTask cancel)Deprecated.Get all data, allow user to cancel.ListgetData(ucar.unidata.geoloc.LatLonRect boundingBox, Date start, Date end, ucar.nc2.util.CancelTask cancel)Deprecated.Get all data within the specified bounding box and date range, allow user to cancel.ListgetData(ucar.unidata.geoloc.LatLonRect boundingBox, ucar.nc2.util.CancelTask cancel)Deprecated.Get all data within the specified bounding box, allow user to cancel.ListgetData(ucar.unidata.geoloc.Station s, ucar.nc2.util.CancelTask cancel)Deprecated.Get all data for this Station, allow user to cancel.intgetDataCount()Deprecated.Get estimate of number of data records (may not be exact).DataIteratorgetDataIterator(int bufferSize)Deprecated.Get an efficient iterator over all the data in the Collection.intgetStationDataCount(ucar.unidata.geoloc.Station s)Deprecated.How many Data objects are available for this Station?protected voidinit(String ncmlURL)Deprecated.booleanisMine(ucar.nc2.dataset.NetcdfDataset ds)Deprecated.Determine if this dataset belongs to youstatic booleanisValidFile(ucar.nc2.NetcdfFile ds)Deprecated.TypedDatasetopen(ucar.nc2.dataset.NetcdfDataset ncd, ucar.nc2.util.CancelTask task, StringBuilder errlog)Deprecated.Open a NetcdfDataset as a TypedDataset.protected voidsetBoundingBox()Deprecated.protected voidsetEndDate()Deprecated.protected voidsetStartDate()Deprecated.protected voidsetTimeUnits()Deprecated.-
Methods inherited from class ucar.nc2.dt.point.StationObsDatasetImpl
getData, getData, getData, getData, getData, getData, getData, getDataClass, getDataIterator, getDataIterator, getDetailInfo, getScientificDataType, getStation, getStations, getStations, getStations, getStations, sortByTime
-
Methods inherited from class ucar.nc2.dt.point.PointObsDatasetImpl
getData, getData, getData, getMetersConversionFactor, getTime, getTimeUnits
-
Methods inherited from class ucar.nc2.dt.TypedDatasetImpl
close, findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getDescription, getEndDate, getGlobalAttributes, getLocation, getLocationURI, getNetcdfFile, getStartDate, getTitle, removeDataVariable, setDescription, setLocationURI, 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.PointCollection
getData, getData, getData, getTimeUnits
-
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.TypedDatasetFactoryIF
getScientificDataType
-
-
-
-
Constructor Detail
-
OldUnidataStationObsDataset
public OldUnidataStationObsDataset()
Deprecated.
-
OldUnidataStationObsDataset
public OldUnidataStationObsDataset(ucar.nc2.dataset.NetcdfDataset ds) throws IOExceptionDeprecated.- Throws:
IOException
-
OldUnidataStationObsDataset
public OldUnidataStationObsDataset(ucar.nc2.dataset.NetcdfDataset ds, String ncmlURL) throws IOExceptionDeprecated.- Throws:
IOException
-
-
Method Detail
-
isValidFile
public static boolean isValidFile(ucar.nc2.NetcdfFile ds)
Deprecated.
-
isMine
public boolean isMine(ucar.nc2.dataset.NetcdfDataset ds)
Deprecated.Description copied from interface:TypedDatasetFactoryIFDetermine if this dataset belongs to you- Specified by:
isMinein interfaceTypedDatasetFactoryIF- Parameters:
ds- examine this NetcdfDataset to see if it belongs to this class.- Returns:
- true if this class knows how to create a TypedDataset out of this NetcdfDataset.
-
open
public TypedDataset open(ucar.nc2.dataset.NetcdfDataset ncd, ucar.nc2.util.CancelTask task, StringBuilder errlog) throws IOException
Deprecated.Description copied from interface:TypedDatasetFactoryIFOpen a NetcdfDataset as a TypedDataset.- Specified by:
openin interfaceTypedDatasetFactoryIF- Parameters:
ncd- already opened NetcdfDataset.task- use may cancelerrlog- place errors here- Returns:
- a subclass of TypedDataset
- Throws:
IOException- on error
-
init
protected void init(String ncmlURL) throws IOException
Deprecated.- Throws:
IOException
-
setTimeUnits
protected void setTimeUnits()
Deprecated.- Specified by:
setTimeUnitsin classPointObsDatasetImpl
-
setStartDate
protected void setStartDate()
Deprecated.- Specified by:
setStartDatein classTypedDatasetImpl
-
setEndDate
protected void setEndDate()
Deprecated.- Specified by:
setEndDatein classTypedDatasetImpl
-
setBoundingBox
protected void setBoundingBox()
Deprecated.- Specified by:
setBoundingBoxin classTypedDatasetImpl
-
getData
public List getData(ucar.nc2.util.CancelTask cancel) throws IOException
Deprecated.Description copied from interface:PointCollectionGet 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.- Specified by:
getDatain interfacePointCollection- Parameters:
cancel- allow user to cancel. Implementors should return ASAP.- Returns:
- List of type getDataClass()
- Throws:
IOException- on io error- See Also:
as a (possibly) more efficient alternative
-
getDataCount
public int getDataCount()
Deprecated.Description copied from interface:PointCollectionGet estimate of number of data records (may not be exact). Return -1 if not able to estimate.- Specified by:
getDataCountin interfacePointCollection- Returns:
- number of data records or -1
-
getData
public List getData(ucar.unidata.geoloc.LatLonRect boundingBox, ucar.nc2.util.CancelTask cancel) throws IOException
Deprecated.Description copied from interface:PointCollectionGet all data within the specified bounding box, allow user to cancel.- Specified by:
getDatain interfacePointCollection- Overrides:
getDatain classStationObsDatasetImpl- Parameters:
boundingBox- restrict data to this bounding noxcancel- allow user to cancel. Implementors should return ASAP.- Returns:
- List of type getDataClass()
- Throws:
IOException- on io error- See Also:
as a (possibly) more efficient alternative
-
getData
public List getData(ucar.unidata.geoloc.LatLonRect boundingBox, Date start, Date end, ucar.nc2.util.CancelTask cancel) throws IOException
Deprecated.Description copied from interface:PointCollectionGet all data within the specified bounding box and date range, allow user to cancel.- Specified by:
getDatain interfacePointCollection- Overrides:
getDatain classStationObsDatasetImpl- Parameters:
boundingBox- restrict data to this bounding noxstart- restrict data to after this timeend- restrict data to before this timecancel- allow user to cancel. Implementors should return ASAP.- Returns:
- List of type getDataClass()
- Throws:
IOException- on io error- See Also:
as a (possibly) more efficient alternative
-
getStationDataCount
public int getStationDataCount(ucar.unidata.geoloc.Station s)
Deprecated.Description copied from interface:StationCollectionHow many Data objects are available for this Station?- Specified by:
getStationDataCountin interfaceStationCollection- Overrides:
getStationDataCountin classStationObsDatasetImpl- Parameters:
s- station- Returns:
- count or -1 if unknown.
-
getData
public List getData(ucar.unidata.geoloc.Station s, ucar.nc2.util.CancelTask cancel) throws IOException
Deprecated.Description copied from interface:StationCollectionGet all data for this Station, allow user to cancel.- Specified by:
getDatain interfaceStationCollection- Parameters:
s- for this Stationcancel- allow user to cancel. Implementors should return ASAP.- Returns:
- List of getDataClass()
- Throws:
IOException- on io error
-
getDataIterator
public DataIterator getDataIterator(int bufferSize) throws IOException
Deprecated.Description copied from interface:PointCollectionGet 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 }- Specified by:
getDataIteratorin interfacePointCollection- 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:
IOException- on io error
-
-