Class AddeSoundingAdapter

All Implemented Interfaces:
Serializable, PropertiedBean, SoundingAdapter

Class for retrieving upper air data from an ADDE remote server. Creates a SoundingOb for each of the stations on the remote server for the latest available data.
See Also:
  • Field Details

  • Constructor Details

    • AddeSoundingAdapter

      Construct an empty AddeSoundingAdapter
    • AddeSoundingAdapter

      public AddeSoundingAdapter(String server) throws Exception
      Retrieve upper air data from a remote ADDE server using only mandatory data.
      Parameters:
      server - name or IP address of remote server
      Throws:
      Exception - (AddeException) if there is no data available or there is trouble connecting to the remote server
    • AddeSoundingAdapter

      public AddeSoundingAdapter(String server, String dataset) throws Exception
      Retrieve upper air data from a remote ADDE server using only mandatory data.
      Parameters:
      server - name or IP address of remote server
      dataset - name of ADDE dataset (group/descriptor)
      Throws:
      Exception - (AddeException) if there is no data available or there is trouble connecting to the remote server
    • AddeSoundingAdapter

      public AddeSoundingAdapter(String server, String mandDataset, String sigDataset) throws Exception
      Retrieve upper air data from a remote ADDE server using only mandatory data.
      Parameters:
      server - name or IP address of remote server
      mandDataset - name of mandatory level upper air ADDE dataset (group/descriptor)
      sigDataset - name of significant level upper air ADDE dataset (group/descriptor)
      Throws:
      Exception - (AddeException) if there is no data available or there is trouble connecting to the remote server
    • AddeSoundingAdapter

      public AddeSoundingAdapter(String server, String mandDataset, String sigDataset, boolean mainHours) throws Exception
      Retrieve upper air data from a remote ADDE server using only mandatory data.
      Parameters:
      server - name or IP address of remote server
      mandDataset - name of mandatory level upper air ADDE dataset (group/descriptor)
      sigDataset - name of significant level upper air ADDE dataset (group/descriptor)
      mainHours - only get data for main (00 & 12Z) hours
      Throws:
      Exception - (AddeException) if there is no data available or there is trouble connecting to the remote server
    • AddeSoundingAdapter

      public AddeSoundingAdapter(String server, String mandDataset, String sigDataset, boolean mainHours, AddeChooser chooser) throws Exception
      Throws:
      Exception
    • AddeSoundingAdapter

      public AddeSoundingAdapter(String server, String mandDataset, String sigDataset, String satelliteTime, String satellitePixel, AddeChooser chooser) throws Exception
      Throws:
      Exception
  • Method Details

    • init

      protected void init() throws Exception
      Initialize the class. Populate the variable list and get the server and dataset information.
      Overrides:
      init in class SoundingAdapterImpl
      Throws:
      Exception - problem occurred
    • intEqual

      private boolean intEqual(int v, String s)
      Utility method that calls McIDASUtil.intBitsToString to get a string to compare to the given parameter s
      Parameters:
      v - integer string value
      s - string to compare
      Returns:
      true if they are equal
    • sQuote

      private String sQuote(String s)
      Return the given String in single quotes
      Parameters:
      s - Add single quotes to the string for select clauses.
      Returns:
      single quoted string (ex: 'foo')
    • makeUrl

      private String makeUrl(String[] args)
      Assemble the URL from the given URL argument array. This turns around and calls makeUrl(String, String[]), passing in the URL_ROOT ("/point") and the URL_ROOT to use.
      Parameters:
      args - URL arguments, key value pairs (ex: arg[0]=arg[1]&arg[2]=arg[3]...)
      Returns:
      Associated URL.
    • makeUrl

      private String makeUrl(String urlRoot, String[] args)
      Assemble the url from the given urlRoot and URL argument array. This returns: "URL_PROTOCOL://server urlRoot ?arg[0]=arg[1]&arg[2]=arg[3]...
      Parameters:
      urlRoot - Root for the URL
      args - Key/value pair arguments.
      Returns:
      ADDE URL.
    • update

      public void update()
      Update this adapter for new data
      Specified by:
      update in interface SoundingAdapter
    • loadStations

      private void loadStations()
      Initialize the times, stations and soundings lists. Load the data into them.
    • initGroupAndDescriptors

      private void initGroupAndDescriptors()
      Initialize the group and descriptor strings
    • loadStationsInner

      private void loadStationsInner() throws AddeException
      Actually do the work of loading the stations
      Throws:
      AddeException - problem accessing data
    • setSource

      public void setSource(String server)
      Set the ADDE server name
      Specified by:
      setSource in interface SoundingAdapter
      Parameters:
      server - server name or IP address
    • getSource

      public String getSource()
      Get the source of the data (server)
      Specified by:
      getSource in interface SoundingAdapter
      Returns:
      server name or IP address
    • setMandDataset

      public void setMandDataset(String value)
      Set the mandatory data set name
      Parameters:
      value - mandatory data set name
    • getMandDataset

      Set the mandatory data set name
      Returns:
      the mandatory data set name
    • setSigDataset

      public void setSigDataset(String value)
      Set the significant data set name
      Parameters:
      value - the significant data set name
    • getSigDataset

      Get the significant data set name
      Returns:
      the significant data set name
    • setSatelliteSounding

      public void setSatelliteSounding(boolean flag)
      Change behavior if we are looking at satellite soundings
    • getSatelliteSounding

      public boolean getSatelliteSounding()
      Are we looking at satellite soundings?
    • initSoundingOb

      Check to see if the RAOB has any data
      Specified by:
      initSoundingOb in interface SoundingAdapter
      Specified by:
      initSoundingOb in class SoundingAdapterImpl
      Parameters:
      sound - sounding to check
      Returns:
      a sounding with data
    • makeSelectString

      Make the select string that will get this observation
      Parameters:
      sound - sounding to use
      Returns:
      select string
    • makeSelectString

      private String makeSelectString(String wmoId, DateTime date)
      Make a select string for the given station id and date
      Parameters:
      wmoId - station id
      date - time of data
      Returns:
      ADDE select clause for the given parameters
    • setRAOBData

      private void setRAOBData(SoundingOb sound)
      Fills in the data for the RAOB
      Parameters:
      sound - sounding ob to set
    • scaleValue

      private double scaleValue(int value, int scale)
      scale the values returned from the server
      Parameters:
      value - value to scale
      scale - scale factor
      Returns:
      scaled value
    • getUnit

      private Unit getUnit(String unitName)
      Gets the units of the variable. Now just a passthrough to ucar.visad.Util.
      Parameters:
      unitName - unit name
      Returns:
      corresponding Unit or null if can't be decoded
      See Also:
    • getDflt

      private String getDflt(String name, String dflt)
      Get a default value using this Adapter's prefix
      Parameters:
      name - name of property key
      dflt - default value
      Returns:
      the default for that property or dflt if not in properties
    • getVariables

      private void getVariables()
      Determines the names of the variables in the netCDF file that should be used.
    • getSigUserProj

      Get significant data ADDE user/project id for the data
      Returns:
      user/project string (ex: "id=idv proj=0")
    • getMandatoryURL

      Make the mandatory levels URL for the given sounding
      Parameters:
      sound - sounding
      Returns:
      mandatory url
    • getSigURL

      public String getSigURL(SoundingOb sound)
      Make the url for the significant levels for the sounding
      Parameters:
      sound - the sounding
      Returns:
      sig url
    • getManUserProj

      Get mandatory data ADDE user/project id for the data
      Returns:
      user/project string (ex: "id=idv proj=0")
    • getUserProj

      private String getUserProj(String key)
      Get the user/project string for the given key
      Parameters:
      key - group/descriptor
      Returns:
      user/project string (ex: "id=idv proj=0") for the specified dataset
    • getStationsSelectString

      Get the select string for use in loadStations
      Returns:
      select string
    • main

      public static void main(String[] args)
      test by running java ucar.unidata.data.sounding.AddeSoundingAdapter
      Parameters:
      args - array of arguments. Takes up to 3 arguments as "server mandatory dataset significant dataset" Use "x" for any of these arguments to use the default.
    • toString

      public String toString()
      The string representation
      Overrides:
      toString in class Object
      Returns:
      The string