You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that at very short short-receiver distance D, where D is comparable to the longest wavelength of the signal, Pyflex throws an IndexError when trying to curtail the selected peaks/troughs using theoretical traveltimes. This often results in no window selection for these pairs, even if an analyst would have selected the window. Here is one example coming out of Pyatoa, where I would have expected a window,
But instead we get the error:
File "/Users/chow/Repos/pyflex/pyflex/window_selector.py", line 316, in calculate_preliminiaries
min_trough, max_trough = self.troughs[0], self.troughs[-1]
~~~~~~~~~~~~^^^
IndexError: index 0 is out of bounds for axis 0 with size 0
# If troughs have been removed, readd them add the boundaries.
iflen(self.troughs):
iffirst_trough!=self.troughs[0]:
self.troughs=np.concatenate([
np.array([min_idx], dtype=self.troughs.dtype),
self.troughs])
iflast_trough!=self.troughs[-1]:
self.troughs=np.concatenate([
self.troughs,
np.array([max_idx], dtype=self.troughs.dtype)])
This occurs because all troughs are excluded because they do not fall within the theoretically expected times where signal should be expected.
I think this also ties into two pass filtering that tends to smear signal before the event origin time, and the fact that we are at regional distances which complicates things over global waveform. Ultimately this should not result in an uncontrolled error, but rather a window accept/rejection.
I have a development branch where I'm testing out bypassing this check, which is somewhat optional anyway because it depends on having theoretical arrivals, which is not a prerequisite for window selection.
The text was updated successfully, but these errors were encountered:
bch0w
changed the title
IndexError at very short source-receiver distances
IndexError at short source-receiver distances
Jul 27, 2024
…hort source receiver distances, allowing for window selection rather than code crash, also added additional log messages for this preliminaries calculation. See related #21
I have noticed that at very short short-receiver distance D, where D is comparable to the longest wavelength of the signal, Pyflex throws an IndexError when trying to curtail the selected peaks/troughs using theoretical traveltimes. This often results in no window selection for these pairs, even if an analyst would have selected the window. Here is one example coming out of Pyatoa, where I would have expected a window,
But instead we get the error:
The offending code block is here:
pyflex/pyflex/window_selector.py
Lines 289 to 302 in 802ae65
This occurs because all troughs are excluded because they do not fall within the theoretically expected times where signal should be expected.
I think this also ties into two pass filtering that tends to smear signal before the event origin time, and the fact that we are at regional distances which complicates things over global waveform. Ultimately this should not result in an uncontrolled error, but rather a window accept/rejection.
I have a development branch where I'm testing out bypassing this check, which is somewhat optional anyway because it depends on having theoretical arrivals, which is not a prerequisite for window selection.
The text was updated successfully, but these errors were encountered: