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
65c1c4ee
Commit
65c1c4ee
authored
3 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
input channels/update limit for derived.adjusted
parent
fdf2d967
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!166
Merge branch master into production
,
!158
Merge branch 'master' into 'production'
,
!149
Efield entrypoint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/processing/derived.py
+16
-12
16 additions, 12 deletions
geomagio/processing/derived.py
with
16 additions
and
12 deletions
geomagio/processing/derived.py
+
16
−
12
View file @
65c1c4ee
...
@@ -2,6 +2,7 @@ from typing import List, Optional
...
@@ -2,6 +2,7 @@ from typing import List, Optional
import
numpy
import
numpy
from
..adjusted
import
AdjustedMatrix
from
..algorithm
import
(
from
..algorithm
import
(
AdjustedAlgorithm
,
AdjustedAlgorithm
,
AverageAlgorithm
,
AverageAlgorithm
,
...
@@ -9,18 +10,20 @@ from ..algorithm import (
...
@@ -9,18 +10,20 @@ from ..algorithm import (
)
)
from
..Controller
import
Controller
,
get_realtime_interval
from
..Controller
import
Controller
,
get_realtime_interval
from
..TimeseriesFactory
import
TimeseriesFactory
from
..TimeseriesFactory
import
TimeseriesFactory
from
.factory
import
get_edge_factory
from
.factory
import
get_edge_factory
,
get_miniseed_factory
def
adjusted
(
def
adjusted
(
observatory
:
str
,
observatory
:
str
,
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
input_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
input_channels
:
List
[
str
]
=
[
"
H
"
,
"
E
"
,
"
Z
"
,
"
F
"
],
interval
:
str
=
"
second
"
,
interval
:
str
=
"
second
"
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
output_factory
:
Optional
[
TimeseriesFactory
]
=
None
,
matrix
:
Optional
[
numpy
.
ndarray
]
=
None
,
output_channels
:
List
[
str
]
=
[
"
X
"
,
"
Y
"
,
"
Z
"
,
"
F
"
]
,
pier_correction
:
Optional
[
float
]
=
None
,
matrix
:
AdjustedMatrix
=
None
,
statefile
:
Optional
[
str
]
=
None
,
statefile
:
Optional
[
str
]
=
None
,
realtime_interval
:
int
=
600
,
realtime_interval
:
int
=
600
,
update_limit
:
int
=
10
,
):
):
"""
Run Adjusted algorithm.
"""
Run Adjusted algorithm.
...
@@ -28,25 +31,26 @@ def adjusted(
...
@@ -28,25 +31,26 @@ def adjusted(
----------
----------
observatory: observatory to calculate
observatory: observatory to calculate
input_factory: where to read, should be configured with data_type
input_factory: where to read, should be configured with data_type
input_channels: adjusted algorithm input channels
interval: data interval
interval: data interval
output_factory: where to write, should be configured with data_type
output_factory: where to write, should be configured with data_type
output_channels: adjusted algorithm output channels
matrix: adjusted matrix
matrix: adjusted matrix
pier_correction: adjusted pier correction
statefile: adjusted statefile
statefile: adjusted statefile
realtime_interval: window in seconds
realtime_interval: window in seconds
update_limit: maximum number of windows to backfill
Uses update_limit=10.
"""
"""
if
not
statefile
and
(
not
matrix
or
not
pier_correction
)
:
if
not
statefile
and
not
matrix
:
raise
ValueError
(
"
Either statefile or matrix
and pier_correction
are required.
"
)
raise
ValueError
(
"
Either statefile or matrix are required.
"
)
starttime
,
endtime
=
get_realtime_interval
(
realtime_interval
)
starttime
,
endtime
=
get_realtime_interval
(
realtime_interval
)
controller
=
Controller
(
controller
=
Controller
(
algorithm
=
AdjustedAlgorithm
(
algorithm
=
AdjustedAlgorithm
(
matrix
=
matrix
,
matrix
=
matrix
,
pier_correction
=
pier_correction
,
statefile
=
statefile
,
statefile
=
statefile
,
data_type
=
"
adjusted
"
,
data_type
=
"
adjusted
"
,
location
=
"
A0
"
,
location
=
"
A0
"
,
inchannels
=
input_channels
,
outchannels
=
output_channels
,
),
),
inputFactory
=
input_factory
or
get_edge_factory
(
data_type
=
"
variation
"
),
inputFactory
=
input_factory
or
get_edge_factory
(
data_type
=
"
variation
"
),
inputInterval
=
interval
,
inputInterval
=
interval
,
...
@@ -58,10 +62,10 @@ def adjusted(
...
@@ -58,10 +62,10 @@ def adjusted(
output_observatory
=
(
observatory
,),
output_observatory
=
(
observatory
,),
starttime
=
starttime
,
starttime
=
starttime
,
endtime
=
endtime
,
endtime
=
endtime
,
input_channels
=
(
"
H
"
,
"
E
"
,
"
Z
"
,
"
F
"
)
,
input_channels
=
input_channels
,
output_channels
=
(
"
X
"
,
"
Y
"
,
"
Z
"
,
"
F
"
)
,
output_channels
=
output_channels
,
realtime
=
realtime_interval
,
realtime
=
realtime_interval
,
update_limit
=
10
,
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