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
f18a45ae
Commit
f18a45ae
authored
4 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
update realtime argument parsing
parent
1b3684cb
No related branches found
No related tags found
2 merge requests
!146
Release CMO metadata to production
,
!52
Update legacy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/processing/obsrio.py
+31
-17
31 additions, 17 deletions
geomagio/processing/obsrio.py
with
31 additions
and
17 deletions
geomagio/processing/obsrio.py
+
31
−
17
View file @
f18a45ae
import
os
from
typing
import
Optional
from
argparse
import
Namespace
import
typer
from
..algorithm
import
Algorithm
,
FilterAlgorithm
from
..edge
import
EdgeFactory
,
MiniSeedFactory
from
..Controller
import
(
Controller
,
get_input_factory
,
get_output_factory
,
get_realtime_interval
,
)
from
..TimeseriesFactory
import
TimeseriesFactory
...
...
@@ -22,10 +19,10 @@ def main():
def
filter_realtime
(
observatory
:
str
,
input_factory
:
str
=
"
miniseed
"
,
input_factory
:
Optional
[
str
]
=
None
,
host
:
str
=
"
127.0.0.1
"
,
port
:
str
=
2061
,
output_factory
:
str
=
"
edge
"
,
output_factory
:
Optional
[
str
]
=
None
,
write_port
:
int
=
2061
,
realtime_interval
:
int
=
600
,
update_limit
:
int
=
10
,
...
...
@@ -33,26 +30,43 @@ def filter_realtime(
"""
Filter 10Hz miniseed, 1 second, one minute, and temperature data.
Defaults set for realtime processing; can also be implemented to update legacy data
"""
args
=
Namespace
()
args
.
input
=
input_factory
args
.
input_host
=
host
args
.
input_port
=
port
args
.
output
=
output_factory
args
.
output_port
=
write_port
input_factory
=
get_input_factory
(
args
)
output_factory
=
get_output_factory
(
args
)
if
input_factory
==
"
miniseed
"
:
input_factory
=
MiniSeedFactory
(
host
=
host
,
port
=
port
)
elif
input_factory
==
"
edge
"
:
input_factory
=
EdgeFactory
(
host
=
host
,
port
=
port
)
if
output_factory
==
"
miniseed
"
:
output_factory
=
MiniSeedFactory
(
host
=
host
,
port
=
write_port
)
elif
output_factory
==
"
edge
"
:
output_factory
=
EdgeFactory
(
host
=
host
,
port
=
write_port
)
obsrio_tenhertz
(
observatory
,
realtime_interval
,
input_factory
,
output_factory
,
update_limit
observatory
=
observatory
,
input_factory
=
input_factory
,
output_factory
=
output_factory
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
)
obsrio_second
(
observatory
,
realtime_interval
,
input_factory
,
output_factory
,
update_limit
observatory
=
observatory
,
input_factory
=
input_factory
,
output_factory
=
output_factory
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
)
obsrio_minute
(
observatory
,
realtime_interval
,
input_factory
,
output_factory
,
update_limit
observatory
=
observatory
,
input_factory
=
input_factory
,
output_factory
=
output_factory
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
)
obsrio_temperatures
(
observatory
,
realtime_interval
,
input_factory
,
output_factory
,
update_limit
observatory
=
observatory
,
input_factory
=
input_factory
,
output_factory
=
output_factory
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
)
...
...
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