Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions eitprocessing/features/pixel_breath.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ def find_pixel_breaths( # noqa: C901, PLR0912, PLR0915
# find the closest peak to zero lag
peak_lags = lags[lag_range][peaks]
peak_distances = np.abs(peak_lags)
if len(peak_distances) == 0:
# no peaks found, skip pixel
warnings.warn(
f"Skipping pixel ({row}, {col}) because no cross correlation peak found.",
RuntimeWarning,
stacklevel=2,
)
continue
min_peak_distance = np.min(peak_distances)
candidates = peak_lags[peak_distances == min_peak_distance]

Expand Down