Commit 02efde88 authored by Sebastian Heimann's avatar Sebastian Heimann
Browse files

can now mix different fsmooth/fmin settings when combining ifcs

parent 5fe224de
......@@ -168,6 +168,17 @@ def scan(
check_data_consistency(p, receivers)
deltat_cf = max(p.deltats.keys())
assert deltat_cf > 0.0
while True:
if not all(ifc.deltat_cf_is_available(deltat_cf * 2) for ifc in ifcs):
break
deltat_cf *= 2
logger.info('sampling interval: %g s' % deltat_cf)
ngridpoints = grid.size()
idetection = 0
......@@ -233,7 +244,8 @@ def scan(
shift_maxs = []
for iifc, ifc in enumerate(ifcs):
dataset = ifc.preprocess(
trs, wmin-tpeaksearch, wmax+tpeaksearch, tshift_max)
trs, wmin-tpeaksearch, wmax+tpeaksearch,
tshift_max, deltat_cf)
if not dataset:
continue
......@@ -244,8 +256,6 @@ def scan(
trs_debug.extend(trs + list(trs_selected))
deltat_cf = trs_selected[0].deltat
t0 = (wmin / deltat_cf) * deltat_cf
istations_selected = num.array(
......
......@@ -34,7 +34,10 @@ class IFC(Object):
def prescan(self, p):
pass
def preprocess(self, trs, wmin, wmax, tpad_new):
def deltat_cf_is_available(self, deltat_cf):
return False
def preprocess(self, trs, wmin, wmax, tpad_new, deltat_cf):
pass
......@@ -56,16 +59,15 @@ class WavePacketIFC(IFC):
def get_fsmooth(self):
return self.fmin * self.fsmooth_factor
def preprocess(self, trs, wmin, wmax, tpad_new):
fsmooth = self.fmin * self.fsmooth_factor
def deltat_cf_is_available(self, deltat_cf):
return deltat_cf < 0.025 / self.get_fsmooth()
def preprocess(self, trs, wmin, wmax, tpad_new, deltat_cf):
fsmooth = self.get_fsmooth()
if not trs:
return []
deltat_cf = max(tr.deltat for tr in trs)
while deltat_cf * 2 < 0.25 / self.fmin:
deltat_cf *= 2
trs_filt = []
for orig_tr in trs:
tr = orig_tr.copy()
......@@ -131,16 +133,15 @@ class OnsetIFC(IFC):
def get_fsmooth(self):
return self.fmin * self.fsmooth_factor
def preprocess(self, trs, wmin, wmax, tpad_new):
fsmooth = self.fmin * self.fsmooth_factor
def deltat_cf_is_available(self, deltat_cf):
return deltat_cf < 0.025 / self.get_fsmooth()
def preprocess(self, trs, wmin, wmax, tpad_new, deltat_cf):
fsmooth = self.get_fsmooth()
if not trs:
return []
deltat_cf = max(tr.deltat for tr in trs)
while deltat_cf * 2 < 0.25 / self.fmin:
deltat_cf *= 2
trs_filt = []
for orig_tr in trs:
tr = orig_tr.copy()
......@@ -291,7 +292,10 @@ class TemplateMatchingIFC(IFC):
def prescan(self, p):
self.masters = self.extract_template(p)
def preprocess(self, trs, wmin, wmax, tpad_new):
def deltat_cf_is_available(self, deltat_cf):
return False
def preprocess(self, trs, wmin, wmax, tpad_new, deltat_cf):
tmin_masters = min(tr.tmin for tr in self.masters.values())
tmax_masters = max(tr.tmax for tr in self.masters.values())
......@@ -381,16 +385,15 @@ class ManualPickIFC(IFC):
def get_fsmooth(self):
return self.fsmooth
def preprocess(self, trs, wmin, wmax, tpad_new):
fsmooth = self.fsmooth
def deltat_cf_is_available(self, deltat_cf):
return deltat_cf < 0.025 / self.get_fsmooth()
def preprocess(self, trs, wmin, wmax, tpad_new, deltat_cf):
fsmooth = self.get_fsmooth()
if not trs:
return []
deltat_cf = trs[0].deltat
while deltat_cf * 2 < 0.25 / self.fmin:
deltat_cf *= 2
mask = num.logical_and(
wmin <= self._picked_times,
wmax >= self._picked_times)
......
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