[major, refs #200] major change for the magnitude estimation from GUI
restitution of waveform data has been moved to dataprocessing; the routines have been cleaned up and work in changed order now: new function restitute_data is a wrapper function in order to restitute seismic data with the most popular kinds of station metadata
This commit is contained in:
@@ -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
|
||||
@@ -354,6 +371,20 @@ def prepTimeAxis(stime, trace):
|
||||
return time_ax
|
||||
|
||||
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user