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
f5c10e14
Commit
f5c10e14
authored
3 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
filter legacy temperature channels at 1 hour and 1 day
parent
15bbfd00
No related branches found
No related tags found
2 merge requests
!166
Merge branch master into production
,
!165
filter legacy temperature channels at 1 hour and 1 day
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/processing/filters.py
+50
-9
50 additions, 9 deletions
geomagio/processing/filters.py
with
50 additions
and
9 deletions
geomagio/processing/filters.py
+
50
−
9
View file @
f5c10e14
...
@@ -30,7 +30,9 @@ def day_command(
...
@@ -30,7 +30,9 @@ def day_command(
observatory
:
str
=
Argument
(
None
,
help
=
"
observatory id
"
),
observatory
:
str
=
Argument
(
None
,
help
=
"
observatory id
"
),
input_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to request data from
"
),
input_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to request data from
"
),
output_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to write data to
"
),
output_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to write data to
"
),
realtime_interval
:
int
=
Option
(
86400
,
help
=
"
length of update window (in seconds)
"
),
realtime_interval
:
int
=
Option
(
604800
,
help
=
"
length of update window (in seconds)
"
),
update_limit
:
int
=
Option
(
7
,
help
=
"
number of update windows
"
),
update_limit
:
int
=
Option
(
7
,
help
=
"
number of update windows
"
),
):
):
day_filter
(
day_filter
(
...
@@ -40,6 +42,21 @@ def day_command(
...
@@ -40,6 +42,21 @@ def day_command(
realtime_interval
=
realtime_interval
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
update_limit
=
update_limit
,
)
)
temperature_filter
(
observatory
=
observatory
,
channels
=
(
(
"
UK1
"
,
"
PK1
"
),
(
"
UK2
"
,
"
PK2
"
),
(
"
UK3
"
,
"
PK3
"
),
(
"
UK4
"
,
"
PK4
"
),
),
input_factory
=
get_edge_factory
(
host
=
input_host
),
input_interval
=
"
minute
"
,
output_factory
=
get_miniseed_factory
(
host
=
output_host
),
output_interval
=
"
day
"
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
)
@app.command
(
@app.command
(
...
@@ -50,7 +67,7 @@ def hour_command(
...
@@ -50,7 +67,7 @@ def hour_command(
observatory
:
str
=
Argument
(
None
,
help
=
"
observatory id
"
),
observatory
:
str
=
Argument
(
None
,
help
=
"
observatory id
"
),
input_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to request data from
"
),
input_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to request data from
"
),
output_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to write data to
"
),
output_host
:
str
=
Option
(
"
127.0.0.1
"
,
help
=
"
host to write data to
"
),
realtime_interval
:
int
=
Option
(
36
00
,
help
=
"
length of update window (in seconds)
"
),
realtime_interval
:
int
=
Option
(
864
00
,
help
=
"
length of update window (in seconds)
"
),
update_limit
:
int
=
Option
(
24
,
help
=
"
number of update windows
"
),
update_limit
:
int
=
Option
(
24
,
help
=
"
number of update windows
"
),
):
):
hour_filter
(
hour_filter
(
...
@@ -60,6 +77,21 @@ def hour_command(
...
@@ -60,6 +77,21 @@ def hour_command(
realtime_interval
=
realtime_interval
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
update_limit
=
update_limit
,
)
)
temperature_filter
(
observatory
=
observatory
,
channels
=
(
(
"
UK1
"
,
"
RK1
"
),
(
"
UK2
"
,
"
RK2
"
),
(
"
UK3
"
,
"
RK3
"
),
(
"
UK4
"
,
"
RK4
"
),
),
input_factory
=
get_edge_factory
(
host
=
input_host
),
input_interval
=
"
minute
"
,
output_factory
=
get_miniseed_factory
(
host
=
output_host
),
output_interval
=
"
hour
"
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
)
@app.command
(
@app.command
(
...
@@ -118,8 +150,16 @@ def realtime_command(
...
@@ -118,8 +150,16 @@ def realtime_command(
)
)
temperature_filter
(
temperature_filter
(
observatory
=
observatory
,
observatory
=
observatory
,
channels
=
(
(
"
LK1
"
,
"
UK1
"
),
(
"
LK2
"
,
"
UK2
"
),
(
"
LK3
"
,
"
UK3
"
),
(
"
LK4
"
,
"
UK4
"
),
),
input_factory
=
get_miniseed_factory
(
host
=
input_host
),
input_factory
=
get_miniseed_factory
(
host
=
input_host
),
input_interval
=
"
second
"
,
output_factory
=
get_edge_factory
(
host
=
output_host
),
output_factory
=
get_edge_factory
(
host
=
output_host
),
output_interval
=
"
minute
"
,
realtime_interval
=
realtime_interval
,
realtime_interval
=
realtime_interval
,
update_limit
=
update_limit
,
update_limit
=
update_limit
,
)
)
...
@@ -165,7 +205,7 @@ def realtime_command(
...
@@ -165,7 +205,7 @@ def realtime_command(
def
day_filter
(
def
day_filter
(
observatory
:
str
,
observatory
:
str
,
channels
:
List
[
str
]
=
[
"
U
"
,
"
V
"
,
"
W
"
,
"
F
"
,
"
T1
"
,
"
T2
"
,
"
T3
"
,
"
T4
"
],
channels
:
List
[
str
]
=
[
"
U
"
,
"
V
"
,
"
W
"
,
"
F
"
],
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
realtime_interval
:
int
=
86400
,
realtime_interval
:
int
=
86400
,
...
@@ -216,7 +256,7 @@ def day_filter(
...
@@ -216,7 +256,7 @@ def day_filter(
def
hour_filter
(
def
hour_filter
(
observatory
:
str
,
observatory
:
str
,
channels
:
List
[
str
]
=
[
"
U
"
,
"
V
"
,
"
W
"
,
"
F
"
,
"
T1
"
,
"
T2
"
,
"
T3
"
,
"
T4
"
],
channels
:
List
[
str
]
=
[
"
U
"
,
"
V
"
,
"
W
"
,
"
F
"
],
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
realtime_interval
:
int
=
600
,
realtime_interval
:
int
=
600
,
...
@@ -367,8 +407,11 @@ def second_filter(
...
@@ -367,8 +407,11 @@ def second_filter(
def
temperature_filter
(
def
temperature_filter
(
observatory
:
str
,
observatory
:
str
,
channels
:
List
[
List
[
str
]],
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
input_interval
:
int
=
"
second
"
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_interval
:
int
=
"
minute
"
,
realtime_interval
:
int
=
600
,
realtime_interval
:
int
=
600
,
update_limit
:
int
=
10
,
update_limit
:
int
=
10
,
):
):
...
@@ -376,13 +419,11 @@ def temperature_filter(
...
@@ -376,13 +419,11 @@ def temperature_filter(
starttime
,
endtime
=
get_realtime_interval
(
realtime_interval
)
starttime
,
endtime
=
get_realtime_interval
(
realtime_interval
)
controller
=
Controller
(
controller
=
Controller
(
inputFactory
=
input_factory
or
get_miniseed_factory
(),
inputFactory
=
input_factory
or
get_miniseed_factory
(),
inputInterval
=
"
second
"
,
inputInterval
=
input_interval
,
outputFactory
=
output_factory
or
get_edge_factory
(),
outputFactory
=
output_factory
or
get_edge_factory
(),
outputInterval
=
"
m
in
u
te
"
,
outputInterval
=
output_
inte
rval
,
)
)
renames
=
{
"
LK1
"
:
"
UK1
"
,
"
LK2
"
:
"
UK2
"
,
"
LK3
"
:
"
UK3
"
,
"
LK4
"
:
"
UK4
"
}
for
input_channel
,
output_channel
in
channels
:
for
input_channel
in
renames
.
keys
():
output_channel
=
renames
[
input_channel
]
controller
.
run_as_update
(
controller
.
run_as_update
(
algorithm
=
FilterAlgorithm
(
algorithm
=
FilterAlgorithm
(
input_sample_period
=
1
,
input_sample_period
=
1
,
...
...
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