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
3257e52f
Commit
3257e52f
authored
6 years ago
by
Jeremy M Fee
Committed by
Claycomb, Abram Earl
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add todos to SQDist algorithm for implementation
parent
34166f91
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/algorithm/SqDistAlgorithm.py
+10
-0
10 additions, 0 deletions
geomagio/algorithm/SqDistAlgorithm.py
with
10 additions
and
0 deletions
geomagio/algorithm/SqDistAlgorithm.py
+
10
−
0
View file @
3257e52f
...
@@ -199,12 +199,20 @@ class SqDistAlgorithm(Algorithm):
...
@@ -199,12 +199,20 @@ class SqDistAlgorithm(Algorithm):
if
trace
.
stats
.
station
!=
self
.
last_observatory
\
if
trace
.
stats
.
station
!=
self
.
last_observatory
\
or
trace
.
stats
.
channel
!=
self
.
last_channel
\
or
trace
.
stats
.
channel
!=
self
.
last_channel
\
or
trace
.
stats
.
starttime
!=
self
.
next_starttime
:
or
trace
.
stats
.
starttime
!=
self
.
next_starttime
:
# TODO: raise exception to prevent state from being cleared?
# state not correct, clear to be safe
# state not correct, clear to be safe
self
.
yhat0
=
None
self
.
yhat0
=
None
self
.
s0
=
None
self
.
s0
=
None
self
.
l0
=
None
self
.
l0
=
None
self
.
b0
=
None
self
.
b0
=
None
self
.
sigma0
=
None
self
.
sigma0
=
None
# TODO: prepare data for processing
# - controller/get_starttime should ensure state is honored
# - based on a TBD argument (default 30 minutes)
# project SQ/SV up to (default 30 minutes) behind realtime
# by padding end with nan values for additive call.
# trim trailing NaNs if self.trim is set
# trim trailing NaNs if self.trim is set
if
self
.
trim
:
if
self
.
trim
:
trace
.
stats
[
'
npts
'
]
=
np
.
argwhere
(
~
np
.
isnan
(
trace
.
data
))[
-
1
][
0
]
+
1
trace
.
stats
[
'
npts
'
]
=
np
.
argwhere
(
~
np
.
isnan
(
trace
.
data
))[
-
1
][
0
]
+
1
...
@@ -234,6 +242,8 @@ class SqDistAlgorithm(Algorithm):
...
@@ -234,6 +242,8 @@ class SqDistAlgorithm(Algorithm):
self
.
sigma0
=
sigma0
self
.
sigma0
=
sigma0
self
.
last_observatory
=
trace
.
stats
.
station
self
.
last_observatory
=
trace
.
stats
.
station
self
.
last_channel
=
trace
.
stats
.
channel
self
.
last_channel
=
trace
.
stats
.
channel
# TODO: double check next_starttime. Does this work as expected when
# projecting into the future, as long as the inputs are set correctly?
self
.
next_starttime
=
trace
.
stats
.
endtime
+
trace
.
stats
.
delta
self
.
next_starttime
=
trace
.
stats
.
endtime
+
trace
.
stats
.
delta
self
.
save_state
()
self
.
save_state
()
# create updated traces
# create updated traces
...
...
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