Browse Source

process_dynamic timeseries: bugfix

- store target ordering was not kept through the process. Fixed
master
mmetz 10 months ago
committed by Sebastian Heimann
parent
commit
4f697aad9a
  1. 9
      src/gf/seismosizer.py
  2. 4
      test/gf/test_gf.py

9
src/gf/seismosizer.py

@ -3010,6 +3010,7 @@ def process_dynamic_timeseries(work, psources, ptargets, engine, nthreads=0):
interpolations = set([t.interpolation for t in store_targets])
base_seismograms = []
store_targets_out = []
for samp_rate in sample_rates:
for interp in interpolations:
@ -3020,11 +3021,11 @@ def process_dynamic_timeseries(work, psources, ptargets, engine, nthreads=0):
if not engine_targets:
continue
store_targets_out += engine_targets
base_seismograms += engine.base_seismograms(
source,
[t for t in store_targets if
t.sample_rate == samp_rate and
t.interpolation == interp],
engine_targets,
components,
dsource_cache,
nthreads)
@ -3043,7 +3044,7 @@ def process_dynamic_timeseries(work, psources, ptargets, engine, nthreads=0):
components=components))))
raise e
for seismogram, target in zip(base_seismograms, store_targets):
for seismogram, target in zip(base_seismograms, store_targets_out):
try:
result = engine._post_process_dynamic(

4
test/gf/test_gf.py

@ -765,8 +765,8 @@ class GFTestCase(unittest.TestCase):
deltat_tr = [tr.deltat for tr in synthetic_traces]
deltat_targ = [1./t.sample_rate for t in targets]
assert num.unique(deltat_tr).shape[0] == \
num.unique(deltat_targ).shape[0]
for deltat_t, deltat_ta in zip(deltat_tr, deltat_targ):
assert deltat_t == deltat_ta
def benchmark_get(self):
store_dir = self.get_benchmark_store_dir()

Loading…
Cancel
Save