Compare commits

..

2 Commits

Author SHA1 Message Date
Diana
59f18a1467 changed all_coming_together 2024-10-23 15:27:33 +02:00
Diana
887df50f38 changed all_coming_together 2024-10-23 15:24:16 +02:00

View File

@ -32,7 +32,7 @@ def all_coming_together(freq_array, power_array, points_list, categories, num_ha
Returns
-------
valid_points : list
A list of valid points with their harmonics.
A continuous list of harmonics for all valid points.
color_mapping : dict
A dictionary mapping categories to corresponding colors.
category_harmonics : dict
@ -40,7 +40,7 @@ def all_coming_together(freq_array, power_array, points_list, categories, num_ha
messages : list
A list of messages for each point, stating whether it was valid or not.
"""
valid_points = []
valid_points = [] # A continuous list of harmonics for valid points
color_mapping = {}
category_harmonics = {}
messages = []
@ -58,7 +58,7 @@ def all_coming_together(freq_array, power_array, points_list, categories, num_ha
if valid:
# Step 3: Prepare harmonics if the point is valid
harmonics, color_map, category_harm = prepare_harmonic(point, category, num_harmonics, color)
valid_points.append((point, harmonics))
valid_points.extend(harmonics) # Use extend() to append harmonics in a continuous manner
color_mapping.update(color_map)
category_harmonics.update(category_harm)
messages.append(f"The point {point} is valid.")
@ -67,6 +67,8 @@ def all_coming_together(freq_array, power_array, points_list, categories, num_ha
return valid_points, color_mapping, category_harmonics, messages
def AM(EODf, stimulus):
"""
Calculates the Amplitude Modulation and Nyquist frequency
@ -426,7 +428,11 @@ def spike_times(stim):
return spikes, stim_dur, dt # se changed spike_times to spikes so its not the same as name of function
<<<<<<< HEAD
def valid_integrals(integral, local_mean, point, threshold = 0.1):
=======
def valid_integrals(integral, local_mean, point, threshold = 0.3):
>>>>>>> 3575361af10b14a99959f8aeb1b57a1e08d0446a
"""
Check if the integral exceeds the threshold compared to the local mean and
provide feedback on whether the given point is valid or not.