diff --git a/src/utils.py b/src/utils.py index f5b8067..772de7b 100644 --- a/src/utils.py +++ b/src/utils.py @@ -23,6 +23,10 @@ def crossings(profile_x, profile_z, constant_z): profile_z = np.array(profile_z)[valid] profile_x = np.array(profile_x)[valid] + # Return empty list if mask removes all values + if profile_x.size == 0: + return [] + # Normalize the 'signal' to zero. # Use np.subtract rather than a list comprehension for performance reasons z = np.subtract(profile_z, constant_z)