Browse Source

get squirrel pile operational

squirrel
Pyrocko Tester 6 months ago
parent
commit
60a8ac252c
  1. 19
      src/core.py
  2. 4
      src/ifc.py

19
src/core.py

@ -43,7 +43,10 @@ class Detection(Object):
def check_data_consistency(p, config):
receivers = config.get_receivers()
nsl_ids = [nslc_id[:3] for nslc_id in p.nslc_ids.keys()]
nslc_ids = [codes[1:5] for codes in p._squirrel.get_codes('waveform')]
nsl_ids = [nslc_id[:3] for nslc_id in nslc_ids]
r_ids = [r.codes for r in receivers]
r_not_in_p = []
@ -159,18 +162,20 @@ def search(
norm_map = gridmod.geometrical_normalization(grid, receivers)
data_paths = glob(fp(config.data_paths))
for data_path in fp(data_paths):
data_paths = []
for data_path_pat in fp(config.data_paths):
data_paths.extend(glob(data_path_pat))
for data_path in data_paths:
if not op.exists(data_path):
raise common.LassieError(
'waveform data path does not exist: %s' % data_path)
sq = pyrocko.Squirrel()
sq = squirrel.Squirrel()
sq.add(data_paths, check=False)
p = sq.pile
#p = pile.make_pile(data_paths, fileformat='detect')
# p = pile.make_pile(data_paths, fileformat='detect')
if p.is_empty():
raise common.LassieError('no usable waveforms found')
@ -226,7 +231,7 @@ def search(
check_data_consistency(p, config)
deltat_cf = max(p.deltats.keys())
deltat_cf = max(p._squirrel.get_deltats('waveform'))
assert deltat_cf > 0.0
while True:

4
src/ifc.py

@ -198,7 +198,7 @@ class WavePacketIFC(IFC):
tr = orig_tr.copy()
if self.pre_downsample_deltat is not None:
tr.downsample_to(self.pre_downsample_deltat)
downsample(tr, self.pre_downsample_deltat)
tr.bandpass(4, self.fmin, self.fmax, demean=True)
@ -295,7 +295,7 @@ class OnsetIFC(IFC):
for orig_tr in trs:
tr = orig_tr.copy()
if self.pre_downsample_deltat is not None:
tr.downsample_to(self.pre_downsample_deltat)
downsample(tr, self.pre_downsample_deltat)
tr.highpass(4, self.fmin, demean=True)
tr.lowpass(4, self.fmax, demean=False)

Loading…
Cancel
Save