Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
696082d1
Commit
696082d1
authored
10 years ago
by
Hal Simpson
Browse files
Options
Downloads
Patches
Plain Diff
Controller for geomagio
parent
663fb23b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/Controller.py
+29
-0
29 additions, 0 deletions
geomagio/Controller.py
with
29 additions
and
0 deletions
geomagio/Controller.py
0 → 100644
+
29
−
0
View file @
696082d1
#! /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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment