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
71b113da
Commit
71b113da
authored
4 years ago
by
Jeremy M Fee
Browse files
Options
Downloads
Patches
Plain Diff
Switch dbdt suffix from _DDT to _DT, round at 6 decimals
parent
dfcac50b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
geomagio/algorithm/DbDtAlgorithm.py
+3
-3
3 additions, 3 deletions
geomagio/algorithm/DbDtAlgorithm.py
geomagio/edge/MiniSeedFactory.py
+2
-2
2 additions, 2 deletions
geomagio/edge/MiniSeedFactory.py
test/algorithm_test/DbDtAlgorithm_test.py
+2
-2
2 additions, 2 deletions
test/algorithm_test/DbDtAlgorithm_test.py
with
7 additions
and
7 deletions
geomagio/algorithm/DbDtAlgorithm.py
+
3
−
3
View file @
71b113da
...
@@ -34,11 +34,11 @@ class DbDtAlgorithm(Algorithm):
...
@@ -34,11 +34,11 @@ class DbDtAlgorithm(Algorithm):
"""
"""
out
=
Stream
()
out
=
Stream
()
for
trace
in
stream
:
for
trace
in
stream
:
dbdt
=
np
.
diff
(
trace
.
data
)
dbdt
=
np
.
around
(
np
.
diff
(
trace
.
data
)
,
decimals
=
6
)
stats
=
Stats
(
trace
.
stats
)
stats
=
Stats
(
trace
.
stats
)
stats
.
channel
=
"
{}_
D
DT
"
.
format
(
stats
.
channel
)
stats
.
channel
=
"
{}_DT
"
.
format
(
stats
.
channel
)
trace_out
=
create_empty_trace
(
trace_out
=
create_empty_trace
(
starttime
=
stats
.
starttime
+
s
elf
.
period
,
starttime
=
stats
.
starttime
+
s
tats
.
delta
,
endtime
=
stats
.
endtime
,
endtime
=
stats
.
endtime
,
observatory
=
stats
.
station
,
observatory
=
stats
.
station
,
type
=
stats
.
location
,
type
=
stats
.
location
,
...
...
This diff is collapsed.
Click to expand it.
geomagio/edge/MiniSeedFactory.py
+
2
−
2
View file @
71b113da
...
@@ -349,7 +349,7 @@ class MiniSeedFactory(TimeseriesFactory):
...
@@ -349,7 +349,7 @@ class MiniSeedFactory(TimeseriesFactory):
return
channel
return
channel
if
suffix
is
not
None
:
if
suffix
is
not
None
:
if
suffix
==
"
Dist
"
or
suffix
==
"
SQ
"
or
suffix
==
"
SV
"
or
suffix
==
"
D
DT
"
:
if
suffix
==
"
Dist
"
or
suffix
==
"
SQ
"
or
suffix
==
"
SV
"
or
suffix
==
"
DT
"
:
# these suffixes modify location code, but use element channel
# these suffixes modify location code, but use element channel
channel
=
element
channel
=
element
else
:
else
:
...
@@ -421,7 +421,7 @@ class MiniSeedFactory(TimeseriesFactory):
...
@@ -421,7 +421,7 @@ class MiniSeedFactory(TimeseriesFactory):
location_suffix
=
"
Q
"
location_suffix
=
"
Q
"
elif
suffix
==
"
SV
"
:
elif
suffix
==
"
SV
"
:
location_suffix
=
"
V
"
location_suffix
=
"
V
"
elif
suffix
==
"
D
DT
"
:
elif
suffix
==
"
DT
"
:
location_suffix
=
"
R
"
location_suffix
=
"
R
"
elif
suffix
not
in
(
"
Bin
"
,
"
Volt
"
):
elif
suffix
not
in
(
"
Bin
"
,
"
Volt
"
):
raise
TimeseriesFactoryException
(
raise
TimeseriesFactoryException
(
...
...
This diff is collapsed.
Click to expand it.
test/algorithm_test/DbDtAlgorithm_test.py
+
2
−
2
View file @
71b113da
...
@@ -10,7 +10,7 @@ def test_process():
...
@@ -10,7 +10,7 @@ def test_process():
original script
original script
"""
"""
# initialize DbDt object
# initialize DbDt object
dbdt
=
DbDtAlgorithm
(
inchannels
=
[
"
H
"
],
outchannels
=
[
"
H_
D
DT
"
],
period
=
60
)
dbdt
=
DbDtAlgorithm
(
inchannels
=
[
"
H
"
],
outchannels
=
[
"
H_DT
"
],
period
=
60
)
# load boulder May 20 files from /etc/ directory
# load boulder May 20 files from /etc/ directory
hez_iaga2002_file
=
open
(
"
etc/dbdt/BOU202005vmin.min
"
)
hez_iaga2002_file
=
open
(
"
etc/dbdt/BOU202005vmin.min
"
)
...
@@ -25,7 +25,7 @@ def test_process():
...
@@ -25,7 +25,7 @@ def test_process():
result
=
dbdt
.
process
(
hez
)
result
=
dbdt
.
process
(
hez
)
# unpack channels from result
# unpack channels from result
rh
=
result
.
select
(
channel
=
"
H_
D
DT
"
)[
0
]
rh
=
result
.
select
(
channel
=
"
H_DT
"
)[
0
]
# unpack channels from BOU202005dbdt.min
# unpack channels from BOU202005dbdt.min
h
=
hez_dbdt
.
select
(
channel
=
"
H
"
)[
0
]
h
=
hez_dbdt
.
select
(
channel
=
"
H
"
)[
0
]
...
...
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