Commit e0dc12e1 authored by Marius Isken's avatar Marius Isken
Browse files

wip initial

parent fb54a068
...@@ -885,6 +885,7 @@ class DatasetConfig(HasPaths): ...@@ -885,6 +885,7 @@ class DatasetConfig(HasPaths):
'Note: ''when whitelisting on channel level, both, the raw and ' 'Note: ''when whitelisting on channel level, both, the raw and '
'the processed channel codes have to be listed.') 'the processed channel codes have to be listed.')
synthetic_test = SyntheticTest.T(optional=True) synthetic_test = SyntheticTest.T(optional=True)
kite_displacement_paths = List.T(Path.T, optional=True)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
HasPaths.__init__(self, *args, **kwargs) HasPaths.__init__(self, *args, **kwargs)
...@@ -921,6 +922,11 @@ class DatasetConfig(HasPaths): ...@@ -921,6 +922,11 @@ class DatasetConfig(HasPaths):
ds.add_events(filename=fp(self.events_path)) ds.add_events(filename=fp(self.events_path))
ds.add_waveforms(paths=fp(self.waveform_paths)) 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: if self.clippings_path:
ds.add_clippings(markers_filename=fp(self.clippings_path)) ds.add_clippings(markers_filename=fp(self.clippings_path))
......
...@@ -76,6 +76,7 @@ class Dataset(object): ...@@ -76,6 +76,7 @@ class Dataset(object):
self.apply_correction_delays = True self.apply_correction_delays = True
self.apply_correction_factors = True self.apply_correction_factors = True
self.clip_handling = 'by_nsl' self.clip_handling = 'by_nsl'
self.static_scenes = []
self.synthetic_test = None self.synthetic_test = None
self._picks = None self._picks = None
self._cache = {} self._cache = {}
...@@ -218,6 +219,15 @@ class Dataset(object): ...@@ -218,6 +219,15 @@ class Dataset(object):
self._picks = None 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): def is_blacklisted(self, obj):
try: try:
nslc = self.get_nslc(obj) nslc = self.get_nslc(obj)
...@@ -639,6 +649,9 @@ class Dataset(object): ...@@ -639,6 +649,9 @@ class Dataset(object):
cache[nslc, tmin, tmax] = e cache[nslc, tmin, tmax] = e
raise raise
def get_displacement(self):
return
def get_events(self, magmin=None, event_names=None): def get_events(self, magmin=None, event_names=None):
evs = [] evs = []
for ev in self.events: for ev in self.events:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment