Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Heimann
grond
Commits
e0dc12e1
Commit
e0dc12e1
authored
Jan 20, 2017
by
Marius Isken
Browse files
wip initial
parent
fb54a068
Changes
2
Show whitespace changes
Inline
Side-by-side
src/core.py
View file @
e0dc12e1
...
...
@@ -885,6 +885,7 @@ class DatasetConfig(HasPaths):
'Note: ''when whitelisting on channel level, both, the raw and '
'the processed channel codes have to be listed.'
)
synthetic_test
=
SyntheticTest
.
T
(
optional
=
True
)
kite_displacement_paths
=
List
.
T
(
Path
.
T
,
optional
=
True
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
HasPaths
.
__init__
(
self
,
*
args
,
**
kwargs
)
...
...
@@ -921,6 +922,11 @@ class DatasetConfig(HasPaths):
ds
.
add_events
(
filename
=
fp
(
self
.
events_path
))
ds
.
add_waveforms
(
paths
=
fp
(
self
.
waveform_paths
))
if
self
.
kite_displacement_paths
:
ds
.
add_kite_displacement
(
filenames
=
fp
(
self
.
kite_displacement_paths
))
if
self
.
clippings_path
:
ds
.
add_clippings
(
markers_filename
=
fp
(
self
.
clippings_path
))
...
...
src/dataset.py
View file @
e0dc12e1
...
...
@@ -76,6 +76,7 @@ class Dataset(object):
self
.
apply_correction_delays
=
True
self
.
apply_correction_factors
=
True
self
.
clip_handling
=
'by_nsl'
self
.
static_scenes
=
[]
self
.
synthetic_test
=
None
self
.
_picks
=
None
self
.
_cache
=
{}
...
...
@@ -218,6 +219,15 @@ class Dataset(object):
self
.
_picks
=
None
def
add_kite_displacement
(
self
,
filenames
):
try
:
from
kite
import
read
except
ImportError
:
raise
ImportError
(
'Module kite could not be imported, '
'please install from http://pyrocko.org'
)
for
file
in
filenames
:
self
.
static_scenes
.
append
(
read
(
file
))
def
is_blacklisted
(
self
,
obj
):
try
:
nslc
=
self
.
get_nslc
(
obj
)
...
...
@@ -639,6 +649,9 @@ class Dataset(object):
cache
[
nslc
,
tmin
,
tmax
]
=
e
raise
def
get_displacement
(
self
):
return
def
get_events
(
self
,
magmin
=
None
,
event_names
=
None
):
evs
=
[]
for
ev
in
self
.
events
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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