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
5cbce9b7
Commit
5cbce9b7
authored
5 months ago
by
Erin (Josh) Rigler
Browse files
Options
Downloads
Patches
Plain Diff
More compatibility changes (EdgeFactory vs. MiniSeedFactory)
parent
2d7c3cdd
No related branches found
No related tags found
1 merge request
!386
Overhaul EdgeFactory and MiniSeedFactory for Edge data migration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/edge/EdgeFactory.py
+19
-18
19 additions, 18 deletions
geomagio/edge/EdgeFactory.py
with
19 additions
and
18 deletions
geomagio/edge/EdgeFactory.py
+
19
−
18
View file @
5cbce9b7
...
@@ -75,6 +75,8 @@ class EdgeFactory(TimeseriesFactory):
...
@@ -75,6 +75,8 @@ class EdgeFactory(TimeseriesFactory):
sncl_mode: {
'
geomag
'
,
'
legacy
'
}
sncl_mode: {
'
geomag
'
,
'
legacy
'
}
force mode to convert common names to SEED SNCL codes (that is,
force mode to convert common names to SEED SNCL codes (that is,
station, network, channel, location codes); default = legacy
station, network, channel, location codes); default = legacy
timeout: float
timeout for Earthworm client; default=10
See Also
See Also
--------
--------
...
@@ -106,6 +108,7 @@ class EdgeFactory(TimeseriesFactory):
...
@@ -106,6 +108,7 @@ class EdgeFactory(TimeseriesFactory):
convert_channels
:
Optional
[
List
[
str
]]
=
None
,
convert_channels
:
Optional
[
List
[
str
]]
=
None
,
scale_factor
:
Optional
[
int
]
=
None
,
scale_factor
:
Optional
[
int
]
=
None
,
sncl_mode
:
Optional
[
str
]
=
"
legacy
"
,
sncl_mode
:
Optional
[
str
]
=
"
legacy
"
,
timeout
:
Optional
[
float
]
=
None
,
):
):
TimeseriesFactory
.
__init__
(
self
,
observatory
,
channels
,
type
,
interval
)
TimeseriesFactory
.
__init__
(
self
,
observatory
,
channels
,
type
,
interval
)
self
.
host
=
host
or
"
edgecwb.usgs.gov
"
self
.
host
=
host
or
"
edgecwb.usgs.gov
"
...
@@ -118,6 +121,7 @@ class EdgeFactory(TimeseriesFactory):
...
@@ -118,6 +121,7 @@ class EdgeFactory(TimeseriesFactory):
self
.
convert_channels
=
convert_channels
or
[]
self
.
convert_channels
=
convert_channels
or
[]
self
.
scale_factor
=
scale_factor
self
.
scale_factor
=
scale_factor
self
.
sncl_mode
=
sncl_mode
self
.
sncl_mode
=
sncl_mode
self
.
timeout
=
timeout
or
10
if
sncl_mode
==
"
legacy
"
:
if
sncl_mode
==
"
legacy
"
:
self
.
get_sncl
=
LegacySNCL
.
get_sncl
self
.
get_sncl
=
LegacySNCL
.
get_sncl
elif
sncl_mode
==
"
geomag
"
:
elif
sncl_mode
==
"
geomag
"
:
...
@@ -409,7 +413,7 @@ class EdgeFactory(TimeseriesFactory):
...
@@ -409,7 +413,7 @@ class EdgeFactory(TimeseriesFactory):
data
=
Stream
()
data
=
Stream
()
for
port
in
ports
:
for
port
in
ports
:
try
:
try
:
client
=
earthworm
.
Client
(
self
.
host
,
port
,
timeout
=
10
)
client
=
earthworm
.
Client
(
self
.
host
,
port
,
timeout
=
self
.
timeout
)
data
+=
client
.
get_waveforms
(
data
+=
client
.
get_waveforms
(
sncl
.
network
,
sncl
.
network
,
...
@@ -651,23 +655,20 @@ class EdgeFactory(TimeseriesFactory):
...
@@ -651,23 +655,20 @@ class EdgeFactory(TimeseriesFactory):
# everything else (mostly magnetics stored as picoteslas)
# everything else (mostly magnetics stored as picoteslas)
trace_send
.
data
=
trace_send
.
data
*
(
self
.
scale_factor
or
1e3
)
trace_send
.
data
=
trace_send
.
data
*
(
self
.
scale_factor
or
1e3
)
if
self
.
write_port
:
ric
=
RawInputClient
(
ric
=
RawInputClient
(
self
.
tag
,
self
.
tag
,
self
.
host
,
self
.
host
,
self
.
write_port
,
self
.
write_port
,
sncl
.
station
,
sncl
.
station
,
sncl
.
channel
,
sncl
.
channel
,
sncl
.
location
,
sncl
.
location
,
sncl
.
network
,
sncl
.
network
,
)
)
trace_send
.
data
=
trace_send
.
data
.
astype
(
int
)
# ric requires ints
trace_send
.
data
=
trace_send
.
data
.
astype
(
int
)
# ric requires ints
ric
.
send_trace
(
interval
,
trace_send
)
ric
.
send_trace
(
interval
,
trace_send
)
if
self
.
forceout
:
if
self
.
forceout
:
ric
.
forceout
()
ric
.
forceout
()
ric
.
close
()
ric
.
close
()
else
:
raise
TimeseriesFactoryException
(
"
Valid write port was not specified.
"
)
def
_set_metadata
(
def
_set_metadata
(
self
,
self
,
...
...
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