csv_name = '/Trial_table_final_level_3_moving_light_ephys_shaders.csv' np.savetxt(results_dir + csv_name, final_table,delimiter=',', fmt='%s') ################################################################################# trial_table = 'F:/Videogame_Assay/Trial_table_final_level_2_touching_light.csv' table_open =np.genfromtxt(trial_table, delimiter = ',') for r, rat in enumerate(rat_summary_table_path): try: Level_2_pre= prs.Level_2_pre_paths(rat) sessions_subset = Level_2_pre rat_pos_at_touch, before_touch, after_touch = trial.rat_event_crop_pos_finder(sessions_subset, event=2, offset = 120) rat_pos_at_start_flat = [val for sublist in rat_pos_at_start for val in sublist] rat_pos_at_touch_flat = [val for sublist in rat_pos_at_touch for val in sublist] rat_pos_before_touch = [val for sublist in before_touch for val in sublist] rat_pos_after_touch = [val for sublist in after_touch for val in sublist] print(len(rat_pos_at_start_flat)) print(len(rat_pos_at_touch_flat)) print(len(rat_pos_before_touch)) print(len(rat_pos_after_touch))
import matplotlib.pyplot as plt import behaviour_library as behaviour import parser_library as prs from matplotlib.colors import PowerNorm from matplotlib.colors import LogNorm from pylab import * from matplotlib.ticker import LogFormatterExponent import DLC_parser_library as DLC import scipy.signal import seaborn as sns from matplotlib.lines import Line2D rat_summary_table_path = 'F:/Videogame_Assay/AK_33.2_Pt.csv' hardrive_path = r'F:/' Level_2_pre = prs.Level_2_pre_paths(rat_summary_table_path) sessions_subset = Level_2_pre x_centroid_te, y_centroid_te = create_tracking_snippets_touch_to_end_centroid(sessions_subset,end_snippet_idx = 1,mid_snippet_idx = 2) x = len(sessions_subset) sessions_dst_te = [[] for _ in range(x)] for count in np.arange(x): try: x_snippets = np.copy(x_centroid_te[count]) y_snippets = np.copy(y_centroid_te[count]) l =len(x_snippets)