|
|
@ -23,6 +23,10 @@ def crossings(profile_x, profile_z, constant_z):
|
|
|
|
profile_z = np.array(profile_z)[valid]
|
|
|
|
profile_z = np.array(profile_z)[valid]
|
|
|
|
profile_x = np.array(profile_x)[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.
|
|
|
|
# Normalize the 'signal' to zero.
|
|
|
|
# Use np.subtract rather than a list comprehension for performance reasons
|
|
|
|
# Use np.subtract rather than a list comprehension for performance reasons
|
|
|
|
z = np.subtract(profile_z, constant_z)
|
|
|
|
z = np.subtract(profile_z, constant_z)
|
|
|
|