From 0f5d20de3d735af13f707bde9e35c2bbe1b51b2a Mon Sep 17 00:00:00 2001 From: Hal Simpson <hasimpson@usgs.gov> Date: Tue, 7 Jul 2015 09:19:02 -0600 Subject: [PATCH] Added some comments --- geomagio/Controller.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/geomagio/Controller.py b/geomagio/Controller.py index 9d58f640..20d75155 100644 --- a/geomagio/Controller.py +++ b/geomagio/Controller.py @@ -57,9 +57,9 @@ class Controller(object): algorithm_end, channels=input_channels) processed = self._algorithm.process(timeseries) - output_channels = self._algorithm.get_output_channels() + output_channels = self._algorithm._get_output_channels() - output_channels = self.get_output_channels(output_channels, + output_channels = self._get_output_channels(output_channels, options.outchannels) self._outputFactory.put_timeseries(timeseries=processed, @@ -87,9 +87,9 @@ class Controller(object): Calls run for each new period, oldest to newest. """ input_channels = self._algorithm.get_input_channels() - output_channels = self._algorithm.get_output_channels() + output_channels = self._algorithm._get_output_channels() - output_channels = self.get_output_channels(output_channels, + output_channels = self._get_output_channels(output_channels, options.outchannels) timeseries_source = self._inputFactory.get_timeseries(starttime, @@ -118,7 +118,20 @@ class Controller(object): continue self.run(target_gap[0], target_gap[1], options) - def get_output_channels(self, algorithm_channels, commandline_channels): + def _get_output_channels(self, algorithm_channels, commandline_channels): + """get output channels + + Parameters + ---------- + algorithm_channels: array_like + list of channels required by the algorithm + commandline_channels: array_like + list of channels requested by the user + Notes + ----- + We want to return the channels requested by the user, but we require + that they be in the list of channels for the algorithm. + """ if commandline_channels is not None: for channel in commandline_channels: if channel not in algorithm_channels: -- GitLab