Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Shakemap
shakyground2
Commits
f9701830
Commit
f9701830
authored
Mar 25, 2021
by
Peter Evans
Browse files
import_fdsnws_eq: Return depths in km, not metres
parent
c4365e84
Changes
2
Hide whitespace changes
Inline
Side-by-side
shakyground2/import_fdsnws_eq.py
View file @
f9701830
...
...
@@ -105,6 +105,9 @@ def fetch_origin(root, ns, preferredoriginID):
d
[
tag
]
=
float
(
v
)
except
ValueError
:
pass
# QuakeML depths are in metres.
d
[
"depth"
]
=
d
[
"depth"
]
/
1000.0
return
d
...
...
tests/test_quakexml.py
View file @
f9701830
...
...
@@ -24,10 +24,15 @@ class QuakeMLReadTestCase(unittest.TestCase):
outfile
=
"data/testoutput.yaml"
def
test_read_good_file
(
self
):
"""
This GEOFON event has a focal mechanism, and a depth of 34 km.
Check that a value in km, not metres, is produced.
"""
infile
=
"data/gfz2021ekhv.xml"
result
=
fetch_quakeml
(
infile
)
self
.
assertTrue
(
isinstance
(
result
,
dict
))
self
.
assertEqual
(
result
[
"id"
],
"gfz2021ekhv"
)
self
.
assertLess
(
result
[
"origin"
][
"depth"
],
100.0
)
def
test_read_good_eventid
(
self
):
"""
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment