Commit d5874b1c authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

core: save indices of max(frames) as additional trace

parent 478a929e
......@@ -136,7 +136,7 @@ def scan(
nsls_selected, trs_selected = zip(*dataset)
trs_debug.extend(trs + list(trs_selected))
#trs_debug.extend(trs + list(trs_selected))
deltat_cf = trs_selected[0].deltat
......@@ -200,7 +200,7 @@ def scan(
deltat=deltat_cf,
ydata=frame_maxs)
trs_debug.append(tr_stackmax)
#trs_debug.append(tr_stackmax)
# trace.snuffle(trs_debug)
......@@ -214,6 +214,11 @@ def scan(
tpeaks, apeaks = tr_stackmax.peaks(
config.detector_threshold, shift_max + 1.0/fsmooth_min)
tr_stackmax_indx = tr_stackmax.copy(data=False)
imaxs = num.argmax(frames, axis=0)
tr_stackmax_indx.set_ydata(imaxs.astype(num.int32))
tr_stackmax_indx.set_location('i')
for (tpeak, apeak) in zip(tpeaks, apeaks):
if not (wmin <= tpeak and tpeak < wmax):
continue
......@@ -253,9 +258,9 @@ def scan(
if stop_after_first:
return
tr_stackmax.chop(wmin, wmax)
io.save([tr_stackmax], 'stackmax/trace_%(tmin_ms)s.mseed')
io.save([tr_stackmax, tr_stackmax_indx], 'stackmax/trace_%(tmin_ms)s.mseed')
__all__ = [
......
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