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 InvDatasetInfo _more_
 class TDSRadarDatasetCollection.TDSRadarDatasetInfo
          Class DqcRadarDatasetInfo _more_
 
Field Summary
protected static org.jdom.Namespace defNS
          _more_
protected  java.util.HashMap stationHMap
          _more_
 
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(java.lang.String sName, Product product)
          check the exist of a product in this dataset collection
static TDSRadarDatasetCollection factory(InvDataset ds, java.lang.String dsc_location, java.lang.StringBuffer errlog)
          tds radar dataset collection factory
static TDSRadarDatasetCollection factory(java.lang.String desc, java.lang.String dsc_location, java.lang.StringBuffer errlog)
          tds radar dataset collection factory
 java.util.ArrayList getData(java.lang.String sName, DateSelection dateInfo)
          Getting data for a single radar station, with time range.
 java.util.ArrayList getData(java.lang.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.
 java.util.ArrayList getDataURIs(java.lang.String sName, DateSelection dateInfo)
          Getting data URIs for a single radar station, with time range.
 java.util.ArrayList getDataURIs(java.lang.String sName, DateSelection dateSelect, CancelTask cancel)
          getting data uri list
 java.lang.String getDescription()
          get dataset collection description
 java.lang.String getLocationURI()
          get dataset collection URI
 RadialDatasetSweep getRadarDataset(java.lang.String stnName, java.util.Date absTime)
          Getting dataset for a single radar station.
 RadialDatasetSweep getRadarDataset(java.lang.String stnName, java.lang.String productID, java.util.Date absTime)
          Getting dataset for a single radar station.
 java.net.URI getRadarDatasetURI(java.lang.String stnName, java.util.Date absTime)
          Getting URI for a single radar station.
 java.net.URI getRadarDatasetURI(java.lang.String stnName, java.lang.String productID, java.util.Date absTime)
           
 java.util.List getRadarProducts()
          get products of dataset collection
 LatLonRect getRadarsBoundingBox()
          get bounding box of dataset collection
 StationImpl getRadarStation(java.lang.String sName)
          get one radar station.
 java.util.ArrayList getRadarStationDatasets(java.lang.String stnName, java.util.Date start, java.util.Date end)
          Getting data Iterator for a single radar station.
 java.util.List getRadarStations()
          get all radar station.
 java.util.ArrayList getRadarStationTimes(java.lang.String stnName, java.util.Date start, java.util.Date end)
          Getting data URI list for a single radar station.
 java.util.ArrayList getRadarStationTimes(java.lang.String stnName, java.lang.String productID, java.util.Date start, java.util.Date end)
          Getting data URI list for a single radar station.
 java.util.ArrayList getRadarStationURIs(java.lang.String stnName, java.util.Date start, java.util.Date end)
          Getting data for a single radar station.
 java.util.List getRadarTimeSpan()
          get start and end time of dataset collection
 int getStationProductCount(java.lang.String sName)
          get the number of products
 java.util.List getStations()
          get all radar station.
 java.util.List getStations(CancelTask cancel)
          get all radar station within box.
 java.util.List getStations(LatLonRect boundingBox)
          get all radar station within box.
 java.util.List getStations(LatLonRect boundingBox, CancelTask cancel)
          get all radar station within box.
 java.lang.String getTitle()
          get title of dataset collection
static void main(java.lang.String[] args)
          _more_
 org.jdom.Element readElements(org.jdom.Element elem, java.lang.String eleName)
          get named element from parent element
 java.util.HashMap readRadarStations(java.lang.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
 java.util.List readSelectTime(org.jdom.Element elem, org.jdom.Namespace ns)
          get start and end elemnt form parent element
 java.util.List 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, 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 java.util.HashMap stationHMap
_more_


defNS

protected static final org.jdom.Namespace defNS
_more_

Method Detail

factory

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

Parameters:
ds - _more_
dsc_location - _more_
errlog - _more_
Returns:
any foctory
Throws:
java.io.IOException - _more_
java.io.IOException - _more_
java.net.URISyntaxException - _more_

factory

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

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

readRadarStations

public java.util.HashMap readRadarStations(java.lang.String stsXML_location)
                                    throws java.io.IOException
retrieve all radar stations in this dataset collection

Parameters:
stsXML_location - _more_
Returns:
station hashmap
Throws:
java.io.IOException - _more_

readElements

public org.jdom.Element readElements(org.jdom.Element elem,
                                     java.lang.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 java.util.List 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 java.util.List 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 java.lang.String getTitle()
get title of dataset collection

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

getLocationURI

public java.lang.String getLocationURI()
get dataset collection URI

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

getDescription

public java.lang.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 java.util.List getRadarTimeSpan()
get start and end time of dataset collection

Returns:
_more_

getRadarProducts

public java.util.List getRadarProducts()
get products of dataset collection

Returns:
_more_

checkStationProduct

public boolean checkStationProduct(java.lang.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(java.lang.String sName)
get the number of products

Parameters:
sName - _more_
Returns:
_more_

getStations

public java.util.List getStations()
                           throws java.io.IOException
get all radar station.

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

getRadarStations

public java.util.List getRadarStations()
get all radar station.

Returns:
List of type DqcRadarStation objects
Throws:
java.io.IOException - java io exception

getRadarStation

public StationImpl getRadarStation(java.lang.String sName)
get one radar station.

Parameters:
sName - _more_
Returns:
StationImpl object
Throws:

getStations

public java.util.List getStations(CancelTask cancel)
                           throws java.io.IOException
get all radar station within box.

Overrides:
getStations in class StationRadarCollectionImpl
Parameters:
cancel - _more_
Returns:
List of type DqcRadarStation objects
Throws:
java.io.IOException - java io exception

getStations

public java.util.List getStations(LatLonRect boundingBox)
                           throws java.io.IOException
get all radar station within box.

Overrides:
getStations in class StationRadarCollectionImpl
Parameters:
boundingBox - _more_
Returns:
List of type DqcRadarStation objects
Throws:
java.io.IOException - java io exception

getStations

public java.util.List getStations(LatLonRect boundingBox,
                                  CancelTask cancel)
                           throws java.io.IOException
get all radar station within box.

Specified by:
getStations in interface StationRadarCollection
Overrides:
getStations in class StationRadarCollectionImpl
Parameters:
boundingBox - _more_
cancel - _more_
Returns:
List of type DqcRadarStation objects
Throws:
java.io.IOException - java io exception

getRadarDataset

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

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

getRadarDataset

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

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

getRadarDatasetURI

public java.net.URI getRadarDatasetURI(java.lang.String stnName,
                                       java.util.Date absTime)
                                throws java.io.IOException
Getting URI for a single radar station.

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

getRadarDatasetURI

public java.net.URI getRadarDatasetURI(java.lang.String stnName,
                                       java.lang.String productID,
                                       java.util.Date absTime)
                                throws java.io.IOException
Throws:
java.io.IOException

getRadarStationURIs

public java.util.ArrayList getRadarStationURIs(java.lang.String stnName,
                                               java.util.Date start,
                                               java.util.Date end)
                                        throws java.io.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:
java.io.IOException - java io exception

getRadarStationDatasets

public java.util.ArrayList getRadarStationDatasets(java.lang.String stnName,
                                                   java.util.Date start,
                                                   java.util.Date end)
                                            throws java.io.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:
java.io.IOException - java io exception

getRadarStationTimes

public java.util.ArrayList getRadarStationTimes(java.lang.String stnName,
                                                java.util.Date start,
                                                java.util.Date end)
                                         throws java.io.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:
java.io.IOException - java io exception

getRadarStationTimes

public java.util.ArrayList getRadarStationTimes(java.lang.String stnName,
                                                java.lang.String productID,
                                                java.util.Date start,
                                                java.util.Date end)
                                         throws java.io.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:
java.io.IOException - java io exception

getDataIterator

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

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

getDataURIs

public java.util.ArrayList getDataURIs(java.lang.String sName,
                                       DateSelection dateInfo)
                                throws java.io.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:
java.io.IOException - _more_

getData

public java.util.ArrayList getData(java.lang.String sName,
                                   DateSelection dateInfo)
                            throws java.io.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:
java.io.IOException - _more_

getData

public java.util.ArrayList getData(java.lang.String sName,
                                   DateSelection dateSelect,
                                   CancelTask cancel)
                            throws java.io.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:
java.io.IOException - _more_

getDataURIs

public java.util.ArrayList getDataURIs(java.lang.String sName,
                                       DateSelection dateSelect,
                                       CancelTask cancel)
                                throws java.io.IOException
getting data uri list

Parameters:
sName - _more_
dateSelect - _more_
cancel - _more_
Returns:
_more_
Throws:
java.io.IOException - _more_

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(java.lang.String[] args)
                 throws java.io.IOException
_more_

Parameters:
args - _more_
Throws:
java.io.IOException - _more_