Merge branch 'feature/magnitude4QtPyLoT'

Conflicts:
	pylot/core/util/utils.py
This commit is contained in:
2016-09-13 12:02:21 +02:00
8 changed files with 341 additions and 166 deletions

View File

@@ -328,6 +328,23 @@ def isIterable(obj):
return False
return True
def key_for_set_value(d):
"""
takes a dictionary and returns the first key for which's value the
boolean is True
:param d: dictionary containing values
:type d: dict
:return: key to the first non-False value found; None if no value's
boolean equals True
"""
r = None
for k, v in d.items():
if v:
return k
return r
def prepTimeAxis(stime, trace):
'''
takes a starttime and a trace object and returns a valid time axis for
@@ -377,6 +394,20 @@ def find_horizontals(data):
return rval
def remove_underscores(data):
"""
takes a `obspy.core.stream.Stream` object and removes all underscores
from stationnames
:param data: stream of seismic data
:type data: `obspy.core.stream.Stream`
:return: data stream
"""
for tr in data:
# remove underscores
tr.stats.station = tr.stats.station.strip('_')
return data
def scaleWFData(data, factor=None, components='all'):
"""
produce scaled waveforms from given waveform data and a scaling factor,