adding with ittertools the combinations
This commit is contained in:
		
							parent
							
								
									363f2dd14c
								
							
						
					
					
						commit
						00d6fed161
					
				| @ -1,4 +1,4 @@ | ||||
| import os | ||||
| import itertools | ||||
| 
 | ||||
| import numpy as np | ||||
| from IPython import embed | ||||
| @ -598,15 +598,20 @@ def main(datapath: str) -> None: | ||||
|             bool_vector = np.ones(len(sort_chirps_electrodes), dtype=bool) | ||||
|             # make index vector  | ||||
|             index_vector = np.arange(len(sort_chirps_electrodes)) | ||||
|             # make it more than only two electrodes for the search after chirps  | ||||
|             combinations_best_elctrodes = list(itertools.combinations(range(3), 2)) | ||||
| 
 | ||||
|             the_real_chirps = [] | ||||
|             for chirp_index, seoc in enumerate(sort_chirps_electrodes): | ||||
|                 if bool_vector[chirp_index] == False: | ||||
|                     continue | ||||
|                 else: | ||||
|                 cm = index_vector[(sort_chirps_electrodes >= seoc) & ( | ||||
|                         sort_chirps_electrodes <= seoc + config.chirp_window_threshold)] | ||||
|                  | ||||
|                 for combination in combinations_best_elctrodes: | ||||
|                     if set(combination).issubset(sort_electrodes[cm]): | ||||
|                         the_real_chirps.append(np.mean(sort_chirps_electrodes[cm])) | ||||
|                 """ | ||||
|                 if set([0,1]).issubset(sort_electrodes[cm]): | ||||
|                     the_real_chirps.append(np.mean(sort_chirps_electrodes[cm])) | ||||
|                 elif set([1,0]).issubset(sort_electrodes[cm]): | ||||
| @ -615,6 +620,7 @@ def main(datapath: str) -> None: | ||||
|                     the_real_chirps.append(np.mean(sort_chirps_electrodes[cm])) | ||||
|                 elif set([1,2]).issubset(sort_electrodes[cm]): | ||||
|                     the_real_chirps.append(np.mean(sort_chirps_electrodes[cm])) | ||||
|                 """ | ||||
| 
 | ||||
|                 bool_vector[cm] = False | ||||
|             for ct in the_real_chirps: | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user