Skip to content
Snippets Groups Projects
Commit 696082d1 authored by Hal Simpson's avatar Hal Simpson
Browse files

Controller for geomagio

parent 663fb23b
No related branches found
No related tags found
No related merge requests found
#! /usr/bin/env python
"""Converts iaga2002 files from one coordinate system to another.
Inputs
------
inputFactory: TimeseriesFactory
outputFactory: TimeseriesFactory
algorithm: Algorithm
"""
class Controller(object):
def __init__(self, inputFactory, outputFactory, algorithm=None):
self._inputFactory = inputFactory
self._algorithm = algorithm
self._outputFactory = outputFactory
def run(self, starttime, endtime):
input_channels = self._algorithm.get_input_channels()
timeseries = self._inputFactory.get_timeseries(starttime, endtime,
channels=input_channels)
if self._algorithm is not None:
processed = self._algorithm.process(timeseries)
else:
processed = timeseries
output_channels = self._algorithm.get_output_channels()
self._outputFactory.put_timeseries(processed, channels=output_channels)
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