Newer
Older

Jeremy M Fee
committed
class Algorithm(object):
"""Base class for geomag algorithms
Parameters
----------
channels: array_like
the list of channels to be processed.
Notes
-----
An algorithm processes a stream of timeseries to produce new timeseries.

Jeremy M Fee
committed
"""
Hal Simpson
committed
def __init__(self, channels=None):
self._channels = channels
pass

Jeremy M Fee
committed
def process(self, stream):

Jeremy M Fee
committed
Parameters
----------
stream : obspy.core.Stream
input data
Returns
-------
obspy.core.Stream
resulting data
"""
return stream.copy()
Hal Simpson
committed
def get_input_channels(self):
"""Get input channels
Returns
-------
array_like
list of channels the algorithm needs to operate.
"""
Hal Simpson
committed
return self._channels
def get_output_channels(self):
"""Get output channels
Returns
-------
array_like
list of channels the algorithm will be returning.
"""
Hal Simpson
committed
return self._channels