changed valid_integrals

This commit is contained in:
Diana 2024-10-23 10:51:38 +02:00
parent e552fb6de5
commit 739507722d

View File

@ -356,7 +356,7 @@ def spike_times(stim):
return spikes, stim_dur, dt # se changed spike_times to spikes so its not the same as name of function return spikes, stim_dur, dt # se changed spike_times to spikes so its not the same as name of function
def valid_integrals(integral, local_mean, threshold, point): def valid_integrals(integral, local_mean, point, threshold = 0.5):
""" """
Check if the integral exceeds the threshold compared to the local mean and Check if the integral exceeds the threshold compared to the local mean and
provide feedback on whether the given point is valid or not. provide feedback on whether the given point is valid or not.
@ -379,7 +379,7 @@ def valid_integrals(integral, local_mean, threshold, point):
message : str message : str
A message stating whether the point is valid or not. A message stating whether the point is valid or not.
""" """
valid = integral > (local_mean * threshold) valid = integral > (local_mean * (1 + threshold))
if valid: if valid:
message = f"The point {point} is valid, as its integral exceeds the threshold." message = f"The point {point} is valid, as its integral exceeds the threshold."
else: else: