Hi again,
Another hopefully quick question please!
I got all the RFs working for one of my datasets with no issues after your suggestions. However, the next dataset has more time window problems. I’ve attached my code and the datafiles that are a problem. This error is happening for many of my traces for this network, it is not isolated. See the output at the bottom please.
I’ve played around altering the cut time/length and changing the onset time, event time. I can see the files are the same length with same onset time so I’ve got to a dead end. Any suggestions please?
Code
RF_LQT_from_seismogram.ipynb (245.3 KB)
20220823143139_962_Z1.Z01J.hhe (28.0 KB)
20220823143139_962_Z1.Z01J.hhn (28.0 KB)
20220823143139_962_Z1.Z01J.hhz (28.0 KB)
20220823143139_962_Z1.Z01J.hhz
Z1.Z01J…HHE | -75.0s - 205.0s onset:2022-08-23T14:43:19.715974Z | 25.0 Hz, 7001 samples | dist:78.3 baz:92.9 slow:316.30
Z1.Z01J…HHN | -75.0s - 205.0s onset:2022-08-23T14:43:19.715974Z | 25.0 Hz, 7001 samples | dist:78.3 baz:92.9 slow:316.30
Z1.Z01J…HHZ | -75.0s - 205.0s onset:2022-08-23T14:43:19.715974Z | 25.0 Hz, 7001 samples | dist:78.3 baz:92.9 slow:316.30
3 Trace(s) in Stream:
Z1.Z01J…HHE | -75.0s - 205.0s onset:2022-08-23T14:43:19.715974Z | 25.0 Hz, 7001 samples | dist:78.3 baz:92.9 slow:316.30
Z1.Z01J…HHN | -75.0s - 205.0s onset:2022-08-23T14:43:19.715974Z | 25.0 Hz, 7001 samples | dist:78.3 baz:92.9 slow:316.30
Z1.Z01J…HHZ | -75.0s - 205.0s onset:2022-08-23T14:43:19.715974Z | 25.0 Hz, 7001 samples | dist:78.3 baz:92.9 slow:316.30
3 Trace(s) in Stream:
Z1.Z01J…HHE | -15.5s - 84.5s onset:2022-08-23T14:43:35.192669Z | 25.0 Hz, 2501 samples | dist:78.4 baz:93.0 slow:5.51
Z1.Z01J…HHN | -15.5s - 84.5s onset:2022-08-23T14:43:35.192669Z | 25.0 Hz, 2501 samples | dist:78.4 baz:93.0 slow:5.51
Z1.Z01J…HHZ | -15.5s - 84.5s onset:2022-08-23T14:43:35.192669Z | 25.0 Hz, 2501 samples | dist:78.4 baz:93.0 slow:5.51
ValueError Traceback (most recent call last)
Input In [19], in <cell line: 10>()
45 print(stream)
46 # stream[:3].plot(type=‘relative’, reftime=stream[0].stats.onset)
—> 48 stream.rf(deconvolve=‘multitaper’)
49 # stream.rf()
50 stream.moveout
File /opt/anaconda3/envs/RF_package/lib/python3.8/site-packages/decorator.py:232, in decorate..fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
→ 232 return caller(func, *(extras + args), **kw)
File /opt/anaconda3/envs/RF_package/lib/python3.8/site-packages/rf/util.py:243, in _add_processing_info(func, *args, **kwargs)
240 arguments = [‘%s=%s’ % (k, repr(v)) if not isinstance(v, str) else
241 “%s=‘%s’” % (k, v) for k, v in kw.items()]
242 info = info % ‘::’.join(sorted(arguments))
→ 243 stream = func(*args, **kwargs)
244 try:
245 for tr in stream:
File /opt/anaconda3/envs/RF_package/lib/python3.8/site-packages/rf/rfstream.py:326, in RFStream.rf(self, method, filter, trim, downsample, rotate, deconvolve, source_components, **kwargs)
324 if rotate:
325 for stream3c in iter3c(self):
→ 326 stream3c.rotate(rotate)
327 # Multiply -1 on Q component, because Q component is pointing
328 # towards the event after the rotation with ObsPy.
329 # For a positive phase at a Moho-like velocity contrast,
(…)
332 # away from the event.
333 # (compare issue #4)
334 for tr in self:
File /opt/anaconda3/envs/RF_package/lib/python3.8/site-packages/obspy/core/stream.py:2852, in Stream.rotate(self, method, back_azimuth, inclination, inventory, **kwargs)
2843 if (len(i_1) != len(i_2)) or (len(i_1) != len(i_3)) or
2844 (abs(i_1.stats.starttime -
2845 i_2.stats.starttime) > dt) or
(…)
2849 i_2.stats.sampling_rate) or
2850 (i_1.stats.sampling_rate != i_3.stats.sampling_rate):
2851 msg = “All components need to have the same time span.”
→ 2852 raise ValueError(msg)
2853 for i_1, i_2, i_3 in zip(input_1, input_2, input_3):
2854 # Figure out inclination and back-azimuth.
2855 baz = back_azimuth
ValueError: All components need to have the same time span.