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
b777fa04
Unverified
Commit
b777fa04
authored
7 years ago
by
Jeremy M Fee
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #189 from hschovanec-usgs/update-channels
Add channels to edge factory
parents
19160cbd
7916cb5e
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/edge/EdgeFactory.py
+12
-0
12 additions, 0 deletions
geomagio/edge/EdgeFactory.py
geomagio/iaga2002/IAGA2002Writer.py
+1
-1
1 addition, 1 deletion
geomagio/iaga2002/IAGA2002Writer.py
test/edge_test/EdgeFactory_test.py
+8
-2
8 additions, 2 deletions
test/edge_test/EdgeFactory_test.py
with
21 additions
and
3 deletions
geomagio/edge/EdgeFactory.py
+
12
−
0
View file @
b777fa04
...
@@ -385,6 +385,18 @@ class EdgeFactory(TimeseriesFactory):
...
@@ -385,6 +385,18 @@ class EdgeFactory(TimeseriesFactory):
edge_channel
=
edge_interval_code
+
'
VX
'
edge_channel
=
edge_interval_code
+
'
VX
'
elif
channel
==
'
Y
'
:
elif
channel
==
'
Y
'
:
edge_channel
=
edge_interval_code
+
'
VY
'
edge_channel
=
edge_interval_code
+
'
VY
'
elif
channel
==
'
E-E
'
:
edge_channel
=
edge_interval_code
+
'
QE
'
elif
channel
==
'
E-N
'
:
edge_channel
=
edge_interval_code
+
'
QN
'
elif
channel
==
'
DIST
'
:
edge_channel
=
edge_interval_code
+
'
DT
'
elif
channel
==
'
DST
'
:
edge_channel
=
edge_interval_code
+
'
GD
'
elif
channel
==
'
SQ
'
:
edge_channel
=
edge_interval_code
+
'
SQ
'
elif
channel
==
'
SV
'
:
edge_channel
=
edge_interval_code
+
'
SV
'
else
:
else
:
edge_channel
=
channel
edge_channel
=
channel
return
edge_channel
return
edge_channel
...
...
This diff is collapsed.
Click to expand it.
geomagio/iaga2002/IAGA2002Writer.py
+
1
−
1
View file @
b777fa04
...
@@ -194,7 +194,7 @@ class IAGA2002Writer(object):
...
@@ -194,7 +194,7 @@ class IAGA2002Writer(object):
buf
=
[
'
DATE TIME DOY
'
]
buf
=
[
'
DATE TIME DOY
'
]
for
channel
in
channels
:
for
channel
in
channels
:
channel_len
=
len
(
channel
)
channel_len
=
len
(
channel
)
if
channel_len
<
1
or
channel_len
>
3
:
if
channel_len
<
1
or
channel_len
>
4
:
raise
TimeseriesFactoryException
(
raise
TimeseriesFactoryException
(
'
channel
"
{}
"
is not 1 character
'
.
format
(
channel
))
'
channel
"
{}
"
is not 1 character
'
.
format
(
channel
))
buf
.
append
(
'
{:<7s}
'
.
format
(
iaga_code
+
channel
))
buf
.
append
(
'
{:<7s}
'
.
format
(
iaga_code
+
channel
))
...
...
This diff is collapsed.
Click to expand it.
test/edge_test/EdgeFactory_test.py
+
8
−
2
View file @
b777fa04
...
@@ -34,8 +34,14 @@ def test__get_edge_channel():
...
@@ -34,8 +34,14 @@ def test__get_edge_channel():
'
MSF
'
)
'
MSF
'
)
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
H
'
,
''
,
'
minute
'
),
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
H
'
,
''
,
'
minute
'
),
'
MVH
'
)
'
MVH
'
)
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
Z
'
,
''
,
'
minute
'
),
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
DIST
'
,
''
,
'
minute
'
),
'
MVZ
'
)
'
MDT
'
)
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
DST
'
,
''
,
'
minute
'
),
'
MGD
'
)
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
E-E
'
,
''
,
'
minute
'
),
'
MQE
'
)
assert_equals
(
EdgeFactory
().
_get_edge_channel
(
''
,
'
E-N
'
,
''
,
'
minute
'
),
'
MQN
'
)
def
test__get_edge_location
():
def
test__get_edge_location
():
...
...
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