Commit b69de43d authored by Sebastian Heimann's avatar Sebastian Heimann
Browse files

fix error in plotting of cf traces

parent afa541a6
......@@ -531,6 +531,7 @@ class ManualPickIFC(IFC):
nsl = tr.nslc_id[:3]
try:
index = nsl_to_index[nsl]
print nsl
ts = picked_times[picked_index == index]
its = (num.round((ts - tr.tmin) / tr.deltat)).astype(num.int64)
its = its[num.logical_and(0 <= its, its < tr.data_len())]
......
......@@ -198,12 +198,13 @@ def plot_detection(
station_index = dict(
(rec.codes, i) for (i, rec) in enumerate(receivers))
dists = []
dists_all = []
amps = []
shifts = []
pdata2 = []
for trs, shift_table, shifter in pdata:
trs = [tr.copy() for tr in trs]
dists = []
for tr in trs:
istation = station_index[tr.nslc_id[:3]]
shift = shift_table[imax, istation]
......@@ -217,10 +218,11 @@ def plot_detection(
amps.append(num.max(num.abs(amp)))
shifts.append(shift)
pdata2.append((trs, shift_table, shifter))
pdata2.append((trs, dists, shift_table, shifter))
dists_all.extend(dists)
dist_min = min(dists)
dist_max = max(dists)
dist_min = min(dists_all)
dist_max = max(dists_all)
shift_min = min(shifts)
shift_max = max(shifts)
......@@ -245,7 +247,7 @@ def plot_detection(
lw=2.)
nsl_have = set()
for ishifter, (trs, shift_table, shifter) in enumerate(pdata2):
for ishifter, (trs, dists, shift_table, shifter) in enumerate(pdata2):
color = plot.mpl_graph_color(ishifter)
for tr, dist in zip(trs, dists):
......
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