diff --git a/src/qseek/models/detection.py b/src/qseek/models/detection.py index 4a9d89c9..a33d7df3 100644 --- a/src/qseek/models/detection.py +++ b/src/qseek/models/detection.py @@ -241,6 +241,8 @@ def get_waveforms( ) ) accessor_id = "qseek.event_detection" + if not times: + return [] tmin = min(times).timestamp() - seconds_before tmax = max(times).timestamp() + seconds_after diff --git a/src/qseek/models/semblance.py b/src/qseek/models/semblance.py index 16ed130f..53e03ff7 100644 --- a/src/qseek/models/semblance.py +++ b/src/qseek/models/semblance.py @@ -139,11 +139,11 @@ def __init__( fill_zero_bytes(self.semblance_unpadded) else: logger.info( - "re-allocating semblance memory: %d", human_readable_bytes(n_values * 4) + "re-allocating semblance memory: %s", human_readable_bytes(n_values * 4) ) self.semblance_unpadded = np.zeros((n_nodes, n_samples), dtype=np.float32) - Semblance._semblance_allocation = self.semblance_unpadded + Semblance._semblance_allocation = self.semblance_unpadded.ravel() Semblance._stats.semblance_allocation_bytes = self.semblance_unpadded.nbytes self._stats.semblance_size_bytes = self.semblance_unpadded.nbytes