Class IdvRadarDatasetCollection

java.lang.Object
ucar.nc2.dt.TypedDatasetImpl
ucar.unidata.data.radar.StationRadarCollectionImpl
ucar.unidata.idv.chooser.IdvRadarDatasetCollection
All Implemented Interfaces:
Closeable, AutoCloseable, ucar.nc2.dt.TypedDataset, StationRadarCollection

public class IdvRadarDatasetCollection extends StationRadarCollectionImpl
Client side for getting data from the TDS radar server.
Author:
yuan
  • Field Details

    • stationHMap

      protected HashMap<String,ucar.unidata.geoloc.Station> stationHMap
      map of station name to station
    • defNS

      protected static final org.jdom2.Namespace defNS
      _more_
  • Method Details

    • factory

      public static IdvRadarDatasetCollection factory(thredds.catalog.InvDataset ds, String dsc_location, StringBuffer errlog) throws IOException
      tds radar dataset collection factory.
      Parameters:
      ds - the ds
      dsc_location - the dsc_location
      errlog - the errlog
      Returns:
      any factory
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • factory

      public static IdvRadarDatasetCollection factory(String desc, String dsc_location, StringBuffer errlog) throws IOException
      tds radar dataset collection factory.
      Parameters:
      desc - the desc
      dsc_location - the dsc_location
      errlog - the errlog
      Returns:
      dataset collection
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readRadarStations

      public HashMap 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.jdom2.Element readElements(org.jdom2.Element elem, String eleName)
      get named element from parent element
      Parameters:
      elem - _more_
      eleName - _more_
      Returns:
      _more_
    • readSelectRegion

      public ucar.unidata.geoloc.LatLonRect readSelectRegion(org.jdom2.Element elem, org.jdom2.Namespace ns)
      get region from parent element
      Parameters:
      elem - _more_
      ns - _more_
      Returns:
      _more_
    • readSelectTime

      public List<String> readSelectTime(org.jdom2.Element elem, org.jdom2.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.jdom2.Element elem, org.jdom2.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 ucar.nc2.dt.TypedDatasetImpl
    • setEndDate

      protected void setEndDate()
      _more_
      Specified by:
      setEndDate in class ucar.nc2.dt.TypedDatasetImpl
    • setBoundingBox

      protected void setBoundingBox()
      _more_
      Specified by:
      setBoundingBox in class ucar.nc2.dt.TypedDatasetImpl
    • getTitle

      public String getTitle()
      get title of dataset collection
      Specified by:
      getTitle in interface ucar.nc2.dt.TypedDataset
      Overrides:
      getTitle in class ucar.nc2.dt.TypedDatasetImpl
      Returns:
      _more_
    • getLocation

      public String getLocation()
      get dataset collection URI
      Overrides:
      getLocation in class ucar.nc2.dt.TypedDatasetImpl
      Returns:
      _more_
    • getDescription

      public String getDescription()
      get dataset collection description
      Specified by:
      getDescription in interface ucar.nc2.dt.TypedDataset
      Overrides:
      getDescription in class ucar.nc2.dt.TypedDatasetImpl
      Returns:
      _more_
    • getRadarsBoundingBox

      public ucar.unidata.geoloc.LatLonRect getRadarsBoundingBox()
      get bounding box of dataset collection
      Returns:
      _more_
    • getRadarTimeSpan

      public List getRadarTimeSpan()
      get start and end time of dataset collection
      Returns:
      _more_
    • getRadarProducts

      public List 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<ucar.unidata.geoloc.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<ucar.unidata.geoloc.Station> getRadarStations()
      get all radar station.
      Returns:
      List of type Station objects
    • getRadarStation

      public ucar.unidata.geoloc.Station getRadarStation(String sName)
      get one radar station.
      Parameters:
      sName - _more_
      Returns:
      Station object
    • getStations

      public List<ucar.unidata.geoloc.Station> getStations(ucar.nc2.util.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<ucar.unidata.geoloc.Station> getStations(ucar.unidata.geoloc.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<ucar.unidata.geoloc.Station> getStations(ucar.unidata.geoloc.LatLonRect boundingBox, ucar.nc2.util.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 ucar.nc2.dt.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 ucar.nc2.dt.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
    • getQueryRadarStationURI

      public URI getQueryRadarStationURI(String stnName, String productID, Date start, Date end) throws IOException
      _more_
      Parameters:
      stnName - _more_
      productID - _more_
      start - _more_
      end - _more_
      Returns:
      _more_
      Throws:
      IOException - _more_
    • 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 ucar.nc2.dt.DataIterator getDataIterator(int bufferSize) throws IOException
      Getting data Iterator for a single radar station.
      Parameters:
      bufferSize - the buffer size
      Returns:
      data iterator
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • 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 - Signals that an I/O exception has occurred.
    • 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 - Signals that an I/O exception has occurred.
    • getData

      public List getData(String sName, DateSelection dateSelect, ucar.nc2.util.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 - the cancel
      Returns:
      list of radialDatasetSweep
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDataURIs

      public List<URI> getDataURIs(String sName, DateSelection dateSelect, ucar.nc2.util.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 - the round to
      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 - Signals that an I/O exception has occurred.