changes in resolution window (added parameter for extent), TRIAL: changes in YLims of pickwindow after init Pick

This commit is contained in:
Marcel Paffrath 2017-05-31 10:28:31 +02:00
parent f493359c26
commit 396555b4b4
3 changed files with 19 additions and 15 deletions

View File

@ -1 +1 @@
ceed1-dirty
f493-dirty

View File

@ -436,7 +436,7 @@ def getsignalwin(t, t1, tsignal):
return isignal
def getResolutionWindow(snr, aperture):
def getResolutionWindow(snr, extent):
"""
Number -> Float
produce the half of the time resolution window width from given SNR
@ -447,6 +447,8 @@ def getResolutionWindow(snr, aperture):
1.5 > SNR -> 15 sec VLRW
see also Diehl et al. 2009
:parameter: extent, can be 'local', 'regional', 'global'
>>> getResolutionWindow(0.5)
7.5
>>> getResolutionWindow(1.8)
@ -466,15 +468,15 @@ def getResolutionWindow(snr, aperture):
}
if snr < 1.5:
time_resolution = res_wins[aperture]['VLRW']
time_resolution = res_wins[extent]['VLRW']
elif snr < 2.:
time_resolution = res_wins[aperture]['LRW']
time_resolution = res_wins[extent]['LRW']
elif snr < 3.:
time_resolution = res_wins[aperture]['MRW']
time_resolution = res_wins[extent]['MRW']
elif snr >3.:
time_resolution = res_wins[aperture]['HRW']
time_resolution = res_wins[extent]['HRW']
else:
time_resolution = res_wins[aperture]['VLRW']
time_resolution = res_wins[extent]['VLRW']
return time_resolution / 2

View File

@ -438,6 +438,8 @@ class WaveformWidget(FigureCanvas):
nmax = 0
compclass = SetChannelComponents()
if not component == '*':
alter_comp = compclass.getCompPosition(component)
alter_comp = str(alter_comp[0])
@ -982,7 +984,7 @@ class PickDlg(QDialog):
else:
noiselevel = nfac
x_res = getResolutionWindow(snr, 'regional')
x_res = getResolutionWindow(snr, parameter.get('extent'))
# remove mean noise level from waveforms
for trace in data:
@ -991,7 +993,7 @@ class PickDlg(QDialog):
trace = demeanTrace(trace=trace, window=inoise)
self.setXLims([ini_pick - x_res, ini_pick + x_res])
self.setYLims(np.array([-noiselevel * 2.5, noiselevel * 2.5]) +
self.setYLims(np.array([-noiselevel * 3.5, noiselevel * 3.5]) +
trace_number)
self.getPlotWidget().plotWFData(wfdata=data,
title=self.getStation() +
@ -1042,12 +1044,12 @@ class PickDlg(QDialog):
horiz_comp = find_horizontals(data)
data = scaleWFData(data, noiselevel * 2.5, horiz_comp)
x_res = getResolutionWindow(snr, 'regional')
x_res = getResolutionWindow(snr, parameter.get('extent'))
self.setXLims(tuple([ini_pick - x_res, ini_pick + x_res]))
traces = self.getTraceID(horiz_comp)
traces.sort()
self.setYLims(tuple(np.array([-0.5, +0.5]) +
self.setYLims(tuple(np.array([-1.0, +1.0]) +
np.array(traces)))
noiselevels = [trace + 1 / (2.5 * 2) for trace in traces] + \
[trace - 1 / (2.5 * 2) for trace in traces]