ucar.nc2.thredds
Class TDSRadarDatasetCollection

java.lang.Object
  extended by ucar.nc2.dt.TypedDatasetImpl
      extended by ucar.nc2.dt.radial.StationRadarCollectionImpl
          extended by ucar.nc2.thredds.TDSRadarDatasetCollection
All Implemented Interfaces:
StationRadarCollection, TypedDataset

public class TDSRadarDatasetCollection
extends StationRadarCollectionImpl

Client side for getting data from the TDS radar server.

Author:
yuan

Nested Class Summary
 class TDSRadarDatasetCollection.DatasetURIInfo
          Class DatasetURIInfo _more_
 class TDSRadarDatasetCollection.InvDatasetInfo
          Class to hold an InvDataset and a Date
 class TDSRadarDatasetCollection.TDSRadarDatasetInfo
          Class to hold some information about TDS Radar Datasets
 
Field Summary
protected static org.jdom.Namespace defNS
          _more_
protected  HashMap<String,Station> stationHMap
          map of station name to station
 
Fields inherited from class ucar.nc2.dt.radial.StationRadarCollectionImpl
absTimesList, relTimesList, stations, timeUnit
 
Fields inherited from class ucar.nc2.dt.TypedDatasetImpl
boundingBox, dataVariables, desc, endDate, location, ncfile, parseInfo, startDate, title
 
Method Summary
 boolean checkStationProduct(Product product)
          check the exist of a product in this dataset collection
 boolean checkStationProduct(String sName, Product product)
          check the exist of a product in this dataset collection
static TDSRadarDatasetCollection factory(InvDataset ds, String dsc_location, StringBuffer errlog)
          tds radar dataset collection factory
static TDSRadarDatasetCollection factory(String desc, String dsc_location, StringBuffer errlog)
          tds radar dataset collection factory
 List getData(String sName, DateSelection dateInfo)
          Getting data for a single radar station, with time range.
 List getData(String sName, DateSelection dateSelect, CancelTask cancel)
          Getting data for a single radar station, with time range.
 DataIterator getDataIterator(int bufferSize)
          Getting data Iterator for a single radar station.
 List getDataURIs(String sName, DateSelection dateInfo)
          Getting data URIs for a single radar station, with time range.
 List<URI> getDataURIs(String sName, DateSelection dateSelect, CancelTask cancel)
          getting data uri list
 String getDescription()
          get dataset collection description
 String getLocation()
          get dataset collection URI
 RadialDatasetSweep getRadarDataset(String stnName, Date absTime)
          Getting dataset for a single radar station.
 RadialDatasetSweep getRadarDataset(String stnName, String productID, Date absTime)
          Getting dataset for a single radar station.
 URI getRadarDatasetURI(String stnName, Date absTime)
          Getting URI for a single radar station.
 URI getRadarDatasetURI(String stnName, String productID, Date absTime)
          _more_
 List<Product> getRadarProducts()
          get products of dataset collection
 LatLonRect getRadarsBoundingBox()
          get bounding box of dataset collection
 Station getRadarStation(String sName)
          get one radar station.
 List getRadarStationDatasets(String stnName, Date start, Date end)
          Getting data Iterator for a single radar station.
 List<Station> getRadarStations()
          get all radar station.
 List<Date> getRadarStationTimes(String stnName, Date start, Date end)
          Getting data URI list for a single radar station.
 List<Date> getRadarStationTimes(String stnName, String productID, Date start, Date end)
          Getting data URI list for a single radar station.
 List getRadarStationURIs(String stnName, Date start, Date end)
          Getting data for a single radar station.
 List<String> getRadarTimeSpan()
          get start and end time of dataset collection
 int getStationProductCount(String sName)
          get the number of products
 List<Station> getStations()
          get all radar station.
 List<Station> getStations(CancelTask cancel)
          get all radar station within box.
 List<Station> getStations(LatLonRect boundingBox)
          get all radar station within box.
 List<Station> getStations(LatLonRect boundingBox, CancelTask cancel)
          get all radar station within box.
 String getTitle()
          get title of dataset collection
static void main(String[] args)
          Test the program
 org.jdom.Element readElements(org.jdom.Element elem, String eleName)
          get named element from parent element
 HashMap<String,Station> readRadarStations(String stsXML_location)
          retrieve all radar stations in this dataset collection
 LatLonRect readSelectRegion(org.jdom.Element elem, org.jdom.Namespace ns)
          get region from parent element
 List<String> readSelectTime(org.jdom.Element elem, org.jdom.Namespace ns)
          get start and end elemnt form parent element
 List<Product> readSelectVariable(org.jdom.Element elem, org.jdom.Namespace ns)
          get variable list from parent element
static long roundTo(long roundTo, long seconds)
          Getting data for a single radar station, with time range and interval.
protected  void setBoundingBox()
          _more_
protected  void setEndDate()
          _more_
protected  void setStartDate()
          _more_
protected  void setTimeUnits()
          _more_
 
Methods inherited from class ucar.nc2.dt.radial.StationRadarCollectionImpl
getBoundingBox, getStation
 
Methods inherited from class ucar.nc2.dt.TypedDatasetImpl
close, findGlobalAttributeIgnoreCase, getDataVariable, getDataVariables, getDetailInfo, getEndDate, getGlobalAttributes, getLocationURI, getNetcdfFile, getStartDate, removeDataVariable, setDescription, setLocationURI, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stationHMap

protected HashMap<String,Station> stationHMap
map of station name to station


defNS

protected static final org.jdom.Namespace defNS
_more_

Method Detail

factory

public static TDSRadarDatasetCollection factory(InvDataset ds,
                                                String dsc_location,
                                                StringBuffer errlog)
                                         throws IOException,
                                                URISyntaxException
tds radar dataset collection factory

Parameters:
ds - _more_
dsc_location - _more_
errlog - _more_
Returns:
any foctory
Throws:
IOException - _more_
URISyntaxException - _more_

factory

public static TDSRadarDatasetCollection factory(String desc,
                                                String dsc_location,
                                                StringBuffer errlog)
                                         throws IOException
tds radar dataset collection factory

Parameters:
desc - _more_
dsc_location - _more_
errlog - _more_
Returns:
dataset collection
Throws:
IOException - _more_

readRadarStations

public HashMap<String,Station> readRadarStations(String stsXML_location)
                                          throws IOException
retrieve all radar stations in this dataset collection

Parameters:
stsXML_location - _more_
Returns:
station hashmap
Throws:
IOException - _more_

readElements

public org.jdom.Element readElements(org.jdom.Element elem,
                                     String eleName)
get named element from parent element

Parameters:
elem - _more_
eleName - _more_
Returns:
_more_

readSelectRegion

public LatLonRect readSelectRegion(org.jdom.Element elem,
                                   org.jdom.Namespace ns)
get region from parent element

Parameters:
elem - _more_
ns - _more_
Returns:
_more_

readSelectTime

public List<String> readSelectTime(org.jdom.Element elem,
                                   org.jdom.Namespace ns)
get start and end elemnt form parent element

Parameters:
elem - _more_
ns - _more_
Returns:
list of times

readSelectVariable

public List<Product> readSelectVariable(org.jdom.Element elem,
                                        org.jdom.Namespace ns)
get variable list from parent element

Parameters:
elem - _more_
ns - _more_
Returns:
list of varibles

setTimeUnits

protected void setTimeUnits()
_more_


setStartDate

protected void setStartDate()
_more_

Specified by:
setStartDate in class TypedDatasetImpl

setEndDate

protected void setEndDate()
_more_

Specified by:
setEndDate in class TypedDatasetImpl

setBoundingBox

protected void setBoundingBox()
_more_

Specified by:
setBoundingBox in class TypedDatasetImpl

getTitle

public String getTitle()
get title of dataset collection

Specified by:
getTitle in interface TypedDataset
Overrides:
getTitle in class TypedDatasetImpl
Returns:
_more_

getLocation

public String getLocation()
get dataset collection URI

Overrides:
getLocation in class TypedDatasetImpl
Returns:
_more_

getDescription

public String getDescription()
get dataset collection description

Specified by:
getDescription in interface TypedDataset
Overrides:
getDescription in class TypedDatasetImpl
Returns:
_more_

getRadarsBoundingBox

public LatLonRect getRadarsBoundingBox()
get bounding box of dataset collection

Returns:
_more_

getRadarTimeSpan

public List<String> getRadarTimeSpan()
get start and end time of dataset collection

Returns:
_more_

getRadarProducts

public List<Product> getRadarProducts()
get products of dataset collection

Returns:
_more_

checkStationProduct

public boolean checkStationProduct(String sName,
                                   Product product)
check the exist of a product in this dataset collection

Specified by:
checkStationProduct in interface StationRadarCollection
Overrides:
checkStationProduct in class StationRadarCollectionImpl
Parameters:
sName - _more_
product - _more_
Returns:
_more_

checkStationProduct

public boolean checkStationProduct(Product product)
check the exist of a product in this dataset collection

Parameters:
product - _more_
Returns:
_more_

getStationProductCount

public int getStationProductCount(String sName)
get the number of products

Parameters:
sName - _more_
Returns:
_more_

getStations

public List<Station> getStations()
                          throws IOException
get all radar station.

Specified by:
getStations in interface StationRadarCollection
Overrides:
getStations in class StationRadarCollectionImpl
Returns:
List of type Station objects
Throws:
IOException - java io exception

getRadarStations

public List<Station> getRadarStations()
get all radar station.

Returns:
List of type Station objects

getRadarStation

public Station getRadarStation(String sName)
get one radar station.

Parameters:
sName - _more_
Returns:
Station object

getStations

public List<Station> getStations(CancelTask cancel)
                          throws IOException
get all radar station within box.

Overrides:
getStations in class StationRadarCollectionImpl
Parameters:
cancel - cancel task
Returns:
List of type Station objects
Throws:
IOException - java io exception

getStations

public List<Station> getStations(LatLonRect boundingBox)
                          throws IOException
get all radar station within box.

Overrides:
getStations in class StationRadarCollectionImpl
Parameters:
boundingBox - the bounding box
Returns:
List of type Station objects
Throws:
IOException - java io exception

getStations

public List<Station> getStations(LatLonRect boundingBox,
                                 CancelTask cancel)
                          throws IOException
get all radar station within box.

Specified by:
getStations in interface StationRadarCollection
Overrides:
getStations in class StationRadarCollectionImpl
Parameters:
boundingBox - the bounding box
cancel - the cancel task
Returns:
List Station objects
Throws:
IOException - java io exception

getRadarDataset

public RadialDatasetSweep getRadarDataset(String stnName,
                                          Date absTime)
                                   throws IOException
Getting dataset for a single radar station.

Parameters:
stnName - radar station name
absTime - is absolute time
Returns:
RadialDatasetSweep object
Throws:
IOException - java io exception

getRadarDataset

public RadialDatasetSweep getRadarDataset(String stnName,
                                          String productID,
                                          Date absTime)
                                   throws IOException
Getting dataset for a single radar station.

Parameters:
stnName - radar station name
productID - _more_
absTime - is absolute time
Returns:
RadialDatasetSweep object
Throws:
IOException - java io exception

getRadarDatasetURI

public URI getRadarDatasetURI(String stnName,
                              Date absTime)
                       throws IOException
Getting URI for a single radar station.

Parameters:
stnName - radar station name
absTime - is absolute time
Returns:
URI
Throws:
IOException - java io exception

getRadarDatasetURI

public URI getRadarDatasetURI(String stnName,
                              String productID,
                              Date absTime)
                       throws IOException
_more_

Parameters:
stnName - _more_
productID - _more_
absTime - _more_
Returns:
_more_
Throws:
IOException - _more_

getRadarStationURIs

public List getRadarStationURIs(String stnName,
                                Date start,
                                Date end)
                         throws IOException
Getting data for a single radar station.

Parameters:
stnName - radar station name
start - of the time
end - of the time
Returns:
data URI list
Throws:
IOException - java io exception

getRadarStationDatasets

public List getRadarStationDatasets(String stnName,
                                    Date start,
                                    Date end)
                             throws IOException
Getting data Iterator for a single radar station.

Parameters:
stnName - radar station name
start - of the time
end - of the time
Returns:
dataset list
Throws:
IOException - java io exception

getRadarStationTimes

public List<Date> getRadarStationTimes(String stnName,
                                       Date start,
                                       Date end)
                                throws IOException
Getting data URI list for a single radar station.

Parameters:
stnName - radar station name
start - of the time
end - of the time
Returns:
list of URIs
Throws:
IOException - java io exception

getRadarStationTimes

public List<Date> getRadarStationTimes(String stnName,
                                       String productID,
                                       Date start,
                                       Date end)
                                throws IOException
Getting data URI list for a single radar station.

Parameters:
stnName - radar station name
productID - _more_
start - of the time
end - of the time
Returns:
list of URIs
Throws:
IOException - java io exception

getDataIterator

public DataIterator getDataIterator(int bufferSize)
                             throws IOException
Getting data Iterator for a single radar station.

Parameters:
bufferSize -
Returns:
data iterator
Throws:
IOException - java io exception

getDataURIs

public List getDataURIs(String sName,
                        DateSelection dateInfo)
                 throws IOException
Getting data URIs for a single radar station, with time range.

Parameters:
sName - radar station name
dateInfo - the date selection information
Returns:
list of URIs
Throws:
IOException - _more_

getData

public List getData(String sName,
                    DateSelection dateInfo)
             throws IOException
Getting data for a single radar station, with time range.

Parameters:
sName - radar station name
dateInfo - the date time selection information
Returns:
list of radialDatasetSweep
Throws:
IOException - _more_

getData

public List getData(String sName,
                    DateSelection dateSelect,
                    CancelTask cancel)
             throws IOException
Getting data for a single radar station, with time range.

Parameters:
sName - radar station name
dateSelect - the date time selection information
cancel - _more_
Returns:
list of radialDatasetSweep
Throws:
IOException - _more_

getDataURIs

public List<URI> getDataURIs(String sName,
                             DateSelection dateSelect,
                             CancelTask cancel)
                      throws IOException
getting data uri list

Parameters:
sName - station name
dateSelect - the date selection
cancel - the cancel task
Returns:
the list of URIs
Throws:
IOException - problem reading URIs

roundTo

public static long roundTo(long roundTo,
                           long seconds)
Getting data for a single radar station, with time range and interval.

Parameters:
roundTo -
seconds - to be round to
Returns:
round to second

main

public static void main(String[] args)
                 throws IOException
Test the program

Parameters:
args - the args
Throws:
IOException - _more_


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