Skip to content
Snippets Groups Projects
Commit d53f7251 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Short circuit second call to _get_input_timeseries in update mode

parent cf677074
No related branches found
No related tags found
No related merge requests found
...@@ -139,13 +139,16 @@ class Controller(object): ...@@ -139,13 +139,16 @@ class Controller(object):
channels=channels) channels=channels)
return timeseries return timeseries
def run(self, options): def run(self, options, input_timeseries=None):
"""run controller """run controller
Parameters Parameters
---------- ----------
options: dictionary options: dictionary
The dictionary of all the command line arguments. Could in theory The dictionary of all the command line arguments. Could in theory
contain other options passed in by the controller. contain other options passed in by the controller.
input_timeseries : obspy.core.Stream
Used by run_as_update to save a double input read, since it has
already read the input to confirm data can be produced.
""" """
algorithm = self._algorithm algorithm = self._algorithm
input_channels = options.inchannels or \ input_channels = options.inchannels or \
...@@ -153,7 +156,7 @@ class Controller(object): ...@@ -153,7 +156,7 @@ class Controller(object):
output_channels = options.outchannels or \ output_channels = options.outchannels or \
algorithm.get_output_channels() algorithm.get_output_channels()
# input # input
timeseries = self._get_input_timeseries( timeseries = input_timeseries or self._get_input_timeseries(
observatory=options.observatory, observatory=options.observatory,
starttime=options.starttime, starttime=options.starttime,
endtime=options.endtime, endtime=options.endtime,
...@@ -253,7 +256,7 @@ class Controller(object): ...@@ -253,7 +256,7 @@ class Controller(object):
options.endtime = output_gap[1] options.endtime = output_gap[1]
print >> sys.stderr, 'processing', \ print >> sys.stderr, 'processing', \
options.starttime, options.endtime options.starttime, options.endtime
self.run(options) self.run(options, input_timeseries)
def get_input_factory(args): def get_input_factory(args):
......
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