Package edu.wisc.ssec.mcidasv.data.adde
Class AddeSoundingAdapter
java.lang.Object
ucar.unidata.beans.InvisiblePropertiedBean
ucar.unidata.data.sounding.SoundingAdapterImpl
edu.wisc.ssec.mcidasv.data.adde.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 Summary
FieldsModifier and TypeFieldDescriptionprivate AddeChooser
Used to grab accounting information for a currently selected server.private String
name of day variableprivate String
default mandatory data setprivate String
default serverprivate String
default significant datasetprivate String
name of mandP wind dir variableprivate String
name of station elevation variableprotected boolean
private String
name of mandP height variableprivate String
name of station id variableprivate String
name of station latitude variableprivate String
name of station longitude variableprivate boolean
use main hours onlyprivate NonVetoableProperty
mandatory data set propertyprivate String
mandatory dataset nameprivate String
mandatory data descriptorprivate String
mandatory data group nameprivate static final String
all obs identifierprivate static final String
descriptor identifierprivate static final String
group identifierprivate static final String
number of obs identifierprivate static final String
parameter identifierprivate static final String
number of obs identifierprivate static final String
select identifierprivate String
name of mandP pressure variableprivate static String
protected boolean
private String
private boolean
observed or satellite sounding?private String
these are only really used for satellite soundingsprivate static final long
Defaultprivate String
server nameprivate NonVetoableProperty
server propertyprivate String
significant dataset nameprivate String
sig data descriptorprivate String
sig data group nameprivate NonVetoableProperty
significant data set propertyprivate NonVetoableProperty
sounding times propertyprivate String
name of mandP wind speed variableprivate NonVetoableProperty
stations propertyprivate String
name of mandP dewpoint variableprivate String
name of time variableprivate String
name of mandP temp variableprivate static final String
URL protocol identifierprivate static final String
URL type identifierprivate static String
Accounting informationFields inherited from class ucar.unidata.data.sounding.SoundingAdapterImpl
debug, defaults, haveInitialized, soundings, stations, times
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty AddeSoundingAdapterAddeSoundingAdapter
(String server) Retrieve upper air data from a remote ADDE server using only mandatory data.AddeSoundingAdapter
(String server, String dataset) Retrieve upper air data from a remote ADDE server using only mandatory data.AddeSoundingAdapter
(String server, String mandDataset, String sigDataset) Retrieve upper air data from a remote ADDE server using only mandatory data.AddeSoundingAdapter
(String server, String mandDataset, String sigDataset, boolean mainHours) Retrieve upper air data from a remote ADDE server using only mandatory data.AddeSoundingAdapter
(String server, String mandDataset, String sigDataset, boolean mainHours, AddeChooser chooser) AddeSoundingAdapter
(String server, String mandDataset, String sigDataset, String satelliteTime, String satellitePixel, AddeChooser chooser) -
Method Summary
Modifier and TypeMethodDescriptionprivate String
Get a default value using this Adapter's prefixgetMandatoryURL
(SoundingOb sound) Make the mandatory levels URL for the given soundingSet the mandatory data set nameprivate String
Get mandatory data ADDE user/project id for the databoolean
Are we looking at satellite soundings?Get the significant data set namegetSigURL
(SoundingOb sound) Make the url for the significant levels for the soundingprivate String
Get significant data ADDE user/project id for the dataGet the source of the data (server)private String
Get the select string for use in loadStationsprivate Unit
Gets the units of the variable.private String
getUserProj
(String key) Get the user/project string for the given keyprivate void
Determines the names of the variables in the netCDF file that should be used.protected void
init()
Initialize the class.private void
Initialize the group and descriptor stringsinitSoundingOb
(SoundingOb sound) Check to see if the RAOB has any dataprivate boolean
Utility method that calls McIDASUtil.intBitsToString to get a string to compare to the given parameter sprivate void
Initialize the times, stations and soundings lists.private void
Actually do the work of loading the stationsstatic void
test by running java ucar.unidata.data.sounding.AddeSoundingAdapterprivate String
makeSelectString
(String wmoId, DateTime date) Make a select string for the given station id and dateprivate String
makeSelectString
(SoundingOb sound) Make the select string that will get this observationprivate String
Assemble the URL from the given URL argument array.private String
Assemble the url from the givenurlRoot
and URL argument array.private double
scaleValue
(int value, int scale) scale the values returned from the servervoid
setMandDataset
(String value) Set the mandatory data set nameprivate void
setRAOBData
(SoundingOb sound) Fills in the data for the RAOBvoid
setSatelliteSounding
(boolean flag) Change behavior if we are looking at satellite soundingsvoid
setSigDataset
(String value) Set the significant data set namevoid
Set the ADDE server nameprivate String
Return the given String in single quotestoString()
The string representationvoid
update()
Update this adapter for new dataMethods inherited from class ucar.unidata.data.sounding.SoundingAdapterImpl
checkInit, dbPrint, getDflt, getSoundingOb, getSoundingObs, getSoundingTimes, getSoundingTimes, getStations, getStations
Methods inherited from class ucar.unidata.beans.InvisiblePropertiedBean
addProperty, addPropertyChangeListener, addPropertyChangeListener, disablePropertyChangeEvents, enablePropertyChangeEvents, getTitle, removePropertyChangeListener, removePropertyChangeListener, setTitle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ucar.unidata.data.sounding.SoundingAdapter
getSoundingObs, getSoundingTimes, getSoundingTimes, getStations, getStations
-
Field Details
-
serialVersionUID
Default- See Also:
-
satelliteSounding
observed or satellite sounding? -
satelliteTime
these are only really used for satellite soundings -
satellitePixel
-
P_PARAM
parameter identifier- See Also:
-
P_NUM
number of obs identifier- See Also:
-
P_ALL
all obs identifier- See Also:
-
P_POS
number of obs identifier- See Also:
-
P_GROUP
group identifier- See Also:
-
P_DESCR
descriptor identifier- See Also:
-
P_SELECT
select identifier- See Also:
-
URL_ROOT
URL type identifier- See Also:
-
URL_PROTOCOL
URL protocol identifier- See Also:
-
serverProperty
server property -
mandatoryDatasetProperty
mandatory data set property -
significantDatasetProperty
significant data set property -
stationsProperty
stations property -
soundingTimesProperty
sounding times property -
manGroup
mandatory data group name -
manDescriptor
mandatory data descriptor -
sigGroup
sig data group name -
sigDescriptor
sig data descriptor -
mainHours
use main hours only -
prMandPVar
name of mandP pressure variable -
htMandPVar
name of mandP height variable -
tpMandPVar
name of mandP temp variable -
tdMandPVar
name of mandP dewpoint variable -
spdMandPVar
name of mandP wind speed variable -
dirMandPVar
name of mandP wind dir variable -
dayVar
name of day variable -
timeVar
name of time variable -
idVar
name of station id variable -
latVar
name of station latitude variable -
lonVar
name of station longitude variable -
eleVar
name of station elevation variable -
server
server name -
mandDataset
mandatory dataset name -
sigDataset
significant dataset name -
defaultServer
default server -
defaultMandDataset
default mandatory data set -
defaultSigDataset
default significant dataset -
user
Accounting information -
proj
-
firstTime
-
retry
-
addeChooser
Used to grab accounting information for a currently selected server.
-
-
Constructor Details
-
AddeSoundingAdapter
public AddeSoundingAdapter()Construct an empty AddeSoundingAdapter -
AddeSoundingAdapter
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
Retrieve upper air data from a remote ADDE server using only mandatory data.- Parameters:
server
- name or IP address of remote serverdataset
- 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
Retrieve upper air data from a remote ADDE server using only mandatory data.- Parameters:
server
- name or IP address of remote servermandDataset
- 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 servermandDataset
- 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
Initialize the class. Populate the variable list and get the server and dataset information.- Overrides:
init
in classSoundingAdapterImpl
- Throws:
Exception
- problem occurred
-
intEqual
Utility method that calls McIDASUtil.intBitsToString to get a string to compare to the given parameter s- Parameters:
v
- integer string values
- string to compare- Returns:
- true if they are equal
-
sQuote
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
Assemble the URL from the given URL argument array. This turns around and callsmakeUrl(String, String[])
, passing in theURL_ROOT
("/point") and theURL_ROOT
to use.- Parameters:
args
- URL arguments, key value pairs (ex:arg[0]=arg[1]&arg[2]=arg[3]...
)- Returns:
- Associated URL.
-
makeUrl
Assemble the url from the givenurlRoot
and URL argument array. This returns:"URL_PROTOCOL://server urlRoot ?arg[0]=arg[1]&arg[2]=arg[3]...
- Parameters:
urlRoot
- Root for the URLargs
- Key/value pair arguments.- Returns:
- ADDE URL.
-
update
Update this adapter for new data- Specified by:
update
in interfaceSoundingAdapter
-
loadStations
Initialize the times, stations and soundings lists. Load the data into them. -
initGroupAndDescriptors
Initialize the group and descriptor strings -
loadStationsInner
Actually do the work of loading the stations- Throws:
AddeException
- problem accessing data
-
setSource
Set the ADDE server name- Specified by:
setSource
in interfaceSoundingAdapter
- Parameters:
server
- server name or IP address
-
getSource
Get the source of the data (server)- Specified by:
getSource
in interfaceSoundingAdapter
- Returns:
- server name or IP address
-
setMandDataset
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
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
Change behavior if we are looking at satellite soundings -
getSatelliteSounding
Are we looking at satellite soundings? -
initSoundingOb
Check to see if the RAOB has any data- Specified by:
initSoundingOb
in interfaceSoundingAdapter
- Specified by:
initSoundingOb
in classSoundingAdapterImpl
- 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
Make a select string for the given station id and date- Parameters:
wmoId
- station iddate
- time of data- Returns:
- ADDE select clause for the given parameters
-
setRAOBData
Fills in the data for the RAOB- Parameters:
sound
- sounding ob to set
-
scaleValue
scale the values returned from the server- Parameters:
value
- value to scalescale
- scale factor- Returns:
- scaled value
-
getUnit
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
Get a default value using this Adapter's prefix- Parameters:
name
- name of property keydflt
- default value- Returns:
- the default for that property or dflt if not in properties
-
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
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
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
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
The string representation
-