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 AddeChooserUsed to grab accounting information for a currently selected server.private Stringname of day variableprivate Stringdefault mandatory data setprivate Stringdefault serverprivate Stringdefault significant datasetprivate Stringname of mandP wind dir variableprivate Stringname of station elevation variableprotected booleanprivate Stringname of mandP height variableprivate Stringname of station id variableprivate Stringname of station latitude variableprivate Stringname of station longitude variableprivate booleanuse main hours onlyprivate NonVetoablePropertymandatory data set propertyprivate Stringmandatory dataset nameprivate Stringmandatory data descriptorprivate Stringmandatory data group nameprivate static final Stringall obs identifierprivate static final Stringdescriptor identifierprivate static final Stringgroup identifierprivate static final Stringnumber of obs identifierprivate static final Stringparameter identifierprivate static final Stringnumber of obs identifierprivate static final Stringselect identifierprivate Stringname of mandP pressure variableprivate static Stringprotected booleanprivate Stringprivate booleanobserved or satellite sounding?private Stringthese are only really used for satellite soundingsprivate static final longDefaultprivate Stringserver nameprivate NonVetoablePropertyserver propertyprivate Stringsignificant dataset nameprivate Stringsig data descriptorprivate Stringsig data group nameprivate NonVetoablePropertysignificant data set propertyprivate NonVetoablePropertysounding times propertyprivate Stringname of mandP wind speed variableprivate NonVetoablePropertystations propertyprivate Stringname of mandP dewpoint variableprivate Stringname of time variableprivate Stringname of mandP temp variableprivate static final StringURL protocol identifierprivate static final StringURL type identifierprivate static StringAccounting 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 StringGet a default value using this Adapter's prefixgetMandatoryURL(SoundingOb sound) Make the mandatory levels URL for the given soundingSet the mandatory data set nameprivate StringGet mandatory data ADDE user/project id for the databooleanAre we looking at satellite soundings?Get the significant data set namegetSigURL(SoundingOb sound) Make the url for the significant levels for the soundingprivate StringGet significant data ADDE user/project id for the dataGet the source of the data (server)private StringGet the select string for use in loadStationsprivate UnitGets the units of the variable.private StringgetUserProj(String key) Get the user/project string for the given keyprivate voidDetermines the names of the variables in the netCDF file that should be used.protected voidinit()Initialize the class.private voidInitialize the group and descriptor stringsinitSoundingOb(SoundingOb sound) Check to see if the RAOB has any dataprivate booleanUtility method that calls McIDASUtil.intBitsToString to get a string to compare to the given parameter sprivate voidInitialize the times, stations and soundings lists.private voidActually do the work of loading the stationsstatic voidtest by running java ucar.unidata.data.sounding.AddeSoundingAdapterprivate StringmakeSelectString(String wmoId, DateTime date) Make a select string for the given station id and dateprivate StringmakeSelectString(SoundingOb sound) Make the select string that will get this observationprivate StringAssemble the URL from the given URL argument array.private StringAssemble the url from the givenurlRootand URL argument array.private doublescaleValue(int value, int scale) scale the values returned from the servervoidsetMandDataset(String value) Set the mandatory data set nameprivate voidsetRAOBData(SoundingOb sound) Fills in the data for the RAOBvoidsetSatelliteSounding(boolean flag) Change behavior if we are looking at satellite soundingsvoidsetSigDataset(String value) Set the significant data set namevoidSet the ADDE server nameprivate StringReturn the given String in single quotestoString()The string representationvoidupdate()Update this adapter for new dataMethods inherited from class ucar.unidata.data.sounding.SoundingAdapterImpl
checkInit, dbPrint, getDflt, getSoundingOb, getSoundingObs, getSoundingTimes, getSoundingTimes, getStations, getStationsMethods inherited from class ucar.unidata.beans.InvisiblePropertiedBean
addProperty, addPropertyChangeListener, addPropertyChangeListener, disablePropertyChangeEvents, enablePropertyChangeEvents, getTitle, removePropertyChangeListener, removePropertyChangeListener, setTitleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
initin 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_ROOTto 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 givenurlRootand 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:
updatein 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:
setSourcein interfaceSoundingAdapter- Parameters:
server- server name or IP address
-
getSource
Get the source of the data (server)- Specified by:
getSourcein 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:
initSoundingObin interfaceSoundingAdapter- Specified by:
initSoundingObin 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
-