Skip to content
Snippets Groups Projects
Commit b4fc20ce authored by Erin (Josh) Rigler's avatar Erin (Josh) Rigler
Browse files

Remove cwbhost and cwbport from EdgeFactory

These options were never used. Presumably they were once intended to allow
a separate edgecwb host to be specified for non-real time data. It just isn't
obvious why this would be desirable in 2024.
parent c1e6fbb1
No related branches found
No related tags found
1 merge request!289Migrating to new edge config - stage 01
...@@ -38,8 +38,6 @@ class EdgeFactory(TimeseriesFactory): ...@@ -38,8 +38,6 @@ class EdgeFactory(TimeseriesFactory):
the port number the waveserver is listening on. the port number the waveserver is listening on.
write_port: integer write_port: integer
the port number the client is writing to. the port number the client is writing to.
cwbport: int
the port number of the cwb host to connect to.
tag: str tag: str
A tag used by edge to log and associate a socket with a given data A tag used by edge to log and associate a socket with a given data
source source
...@@ -62,8 +60,6 @@ class EdgeFactory(TimeseriesFactory): ...@@ -62,8 +60,6 @@ class EdgeFactory(TimeseriesFactory):
locationCode: str locationCode: str
the location code for the given edge server, overrides type the location code for the given edge server, overrides type
in get_timeseries/put_timeseries in get_timeseries/put_timeseries
cwbhost: str
a string represeting the IP number of the cwb host to connect to.
See Also See Also
-------- --------
...@@ -82,7 +78,6 @@ class EdgeFactory(TimeseriesFactory): ...@@ -82,7 +78,6 @@ class EdgeFactory(TimeseriesFactory):
host: str = "edgecwb.usgs.gov", host: str = "edgecwb.usgs.gov",
port: int = 2060, port: int = 2060,
write_port: int = 7981, write_port: int = 7981,
cwbport: int = 0,
tag: str = "GeomagAlg", tag: str = "GeomagAlg",
forceout: bool = False, forceout: bool = False,
observatory: Optional[str] = None, observatory: Optional[str] = None,
...@@ -91,20 +86,17 @@ class EdgeFactory(TimeseriesFactory): ...@@ -91,20 +86,17 @@ class EdgeFactory(TimeseriesFactory):
interval: Optional[DataInterval] = None, interval: Optional[DataInterval] = None,
observatoryMetadata: Optional[ObservatoryMetadata] = None, observatoryMetadata: Optional[ObservatoryMetadata] = None,
locationCode: Optional[str] = None, locationCode: Optional[str] = None,
cwbhost: Optional[str] = None,
): ):
TimeseriesFactory.__init__(self, observatory, channels, type, interval) TimeseriesFactory.__init__(self, observatory, channels, type, interval)
self.client = earthworm.Client(host, port) self.client = earthworm.Client(host, port)
self.host = host self.host = host
self.port = port self.port = port
self.write_port = write_port self.write_port = write_port
self.cwbport = cwbport
self.tag = tag self.tag = tag
self.forceout = forceout self.forceout = forceout
self.interval = interval self.interval = interval
self.observatoryMetadata = observatoryMetadata or ObservatoryMetadata() self.observatoryMetadata = observatoryMetadata or ObservatoryMetadata()
self.locationCode = locationCode self.locationCode = locationCode
self.cwbhost = cwbhost or ""
def get_timeseries( def get_timeseries(
self, self,
...@@ -445,18 +437,10 @@ class EdgeFactory(TimeseriesFactory): ...@@ -445,18 +437,10 @@ class EdgeFactory(TimeseriesFactory):
location=self.locationCode, location=self.locationCode,
) )
now = UTCDateTime(datetime.utcnow())
if ((now - endtime) > 864000) and (self.cwbport > 0):
host = self.cwbhost
port = self.cwbport
else:
host = self.host
port = self.write_port
ric = RawInputClient( ric = RawInputClient(
self.tag, self.tag,
host, self.host,
port, self.write_port,
sncl.station, sncl.station,
sncl.channel, sncl.channel,
sncl.location, sncl.location,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment