def calculate_power_hit_miss_locations(prm, data, channel): hit_data, miss_data = vr_split_data.split_all_data_hit_miss(prm, data) hit_data_ob, hit_data_rz, hit_data_hb = vr_track_location_analysis.split_locations( prm, hit_data) miss_data_ob, miss_data_rz, miss_data_hb = vr_track_location_analysis.split_locations( prm, miss_data) #plot power spectra #hit_data_theta = vr_track_location_analysis.add_theta_and_gamma_signal(prm, hit_data, hit_data) #miss_data_theta = vr_track_location_analysis.add_theta_and_gamma_signal(prm, miss_data, miss_data) #vr_track_location_plots.plot_power_spectrum_all_hitmiss(prm, hit_data_theta,miss_data_theta, channel) #vr_track_location_plots.plot_power_spectrum_all_hitmiss_gamma(prm, hit_data[:,5],miss_data[:,5], channel) #average area under curve etc for all stops hit_power_ob = get_gamma_per_window(prm, hit_data_ob[:, 5]) hit_power_rz = get_gamma_per_window(prm, hit_data_rz[:, 5]) hit_power_hb = get_gamma_per_window(prm, hit_data_hb[:, 5]) miss_power_ob = get_gamma_per_window(prm, miss_data_ob[:, 5]) miss_power_rz = get_gamma_per_window(prm, miss_data_rz[:, 5]) miss_power_hb = get_gamma_per_window(prm, miss_data_hb[:, 5]) vr_power_calculations_plots.plot_gamma_power_hit_miss_locations( prm, hit_power_ob, miss_power_ob, hit_power_rz, miss_power_rz, hit_power_hb, miss_power_hb, channel) hit_power_ob = get_gamma_per_window(prm, hit_data_ob[:, 4]) hit_power_rz = get_gamma_per_window(prm, hit_data_rz[:, 4]) hit_power_hb = get_gamma_per_window(prm, hit_data_hb[:, 4]) miss_power_ob = get_gamma_per_window(prm, miss_data_ob[:, 4]) miss_power_rz = get_gamma_per_window(prm, miss_data_rz[:, 4]) miss_power_hb = get_gamma_per_window(prm, miss_data_hb[:, 4]) vr_power_calculations_plots.plot_theta_power_hit_miss_locations( prm, hit_power_ob, miss_power_ob, hit_power_rz, miss_power_rz, hit_power_hb, miss_power_hb, channel)
def calculate_power_speed_hit_miss(prm, data, channel): hit_data, miss_data = vr_split_data.split_all_data_hit_miss(prm, data) speed_hit = get_average_speed(prm, hit_data[:, 6]) speed_miss = get_average_speed(prm, miss_data[:, 6]) gamma_power_hit = get_gamma_per_window(prm, hit_data[:, 5]) gamma_power_miss = get_gamma_per_window(prm, miss_data[:, 5]) theta_power_hit = get_gamma_per_window(prm, hit_data[:, 4]) theta_power_miss = get_gamma_per_window(prm, miss_data[:, 4]) #plot for gamma hit_data = np.vstack((speed_hit, gamma_power_hit)) hit_data = np.transpose(hit_data) miss_data = np.vstack((speed_miss, gamma_power_miss)) miss_data = np.transpose(miss_data) bins_hit, speed_bins_hit = bin_speed_data(prm, hit_data) bins_miss, speed_bins_miss = bin_speed_data(prm, miss_data) vr_power_calculations_plots.plot_gamma_power_speed_hit_miss( prm, bins_hit, speed_bins_hit, bins_miss, speed_bins_miss, channel) #plot for theta hit_data = np.vstack((speed_hit, theta_power_hit)) hit_data = np.transpose(hit_data) miss_data = np.vstack((speed_miss, theta_power_miss)) miss_data = np.transpose(miss_data) bins_hit, speed_bins_hit = bin_speed_data(prm, hit_data) bins_miss, speed_bins_miss = bin_speed_data(prm, miss_data) vr_power_calculations_plots.plot_theta_power_speed_hit_miss( prm, bins_hit, speed_bins_hit, bins_miss, speed_bins_miss, channel)
def calculate_power_speed_hit_miss_locations(prm, data, channel): hit_data, miss_data = vr_split_data.split_all_data_hit_miss(prm, data) hit_data_ob, hit_data_rz, hit_data_hb = vr_track_location_analysis.split_locations( prm, hit_data) miss_data_ob, miss_data_rz, miss_data_hb = vr_track_location_analysis.split_locations( prm, miss_data) speed_hit_ob = get_average_speed(prm, hit_data_ob[:, 6]) speed_hit_rz = get_average_speed(prm, hit_data_rz[:, 6]) speed_hit_hb = get_average_speed(prm, hit_data_hb[:, 6]) speed_miss_ob = get_average_speed(prm, miss_data_ob[:, 6]) speed_miss_rz = get_average_speed(prm, miss_data_rz[:, 6]) speed_miss_hb = get_average_speed(prm, miss_data_hb[:, 6]) gamma_power_hit_ob = get_gamma_per_window(prm, hit_data_ob[:, 5]) gamma_power_hit_rz = get_gamma_per_window(prm, hit_data_rz[:, 5]) gamma_power_hit_hb = get_gamma_per_window(prm, hit_data_hb[:, 5]) gamma_power_miss_ob = get_gamma_per_window(prm, miss_data_ob[:, 5]) gamma_power_miss_rz = get_gamma_per_window(prm, miss_data_rz[:, 5]) gamma_power_miss_hb = get_gamma_per_window(prm, miss_data_hb[:, 5]) theta_power_hit_ob = get_gamma_per_window(prm, hit_data_ob[:, 4]) theta_power_hit_rz = get_gamma_per_window(prm, hit_data_rz[:, 4]) theta_power_hit_hb = get_gamma_per_window(prm, hit_data_hb[:, 4]) theta_power_miss_ob = get_gamma_per_window(prm, miss_data_ob[:, 4]) theta_power_miss_rz = get_gamma_per_window(prm, miss_data_rz[:, 4]) theta_power_miss_hb = get_gamma_per_window(prm, miss_data_hb[:, 4]) #plot gamma hit_data_ob = np.vstack((speed_hit_ob, gamma_power_hit_ob)) hit_data_ob = np.transpose(hit_data_ob) miss_data_ob = np.vstack((speed_miss_ob, gamma_power_miss_ob)) miss_data_ob = np.transpose(miss_data_ob) hit_data_rz = np.vstack((speed_hit_rz, gamma_power_hit_rz)) hit_data_rz = np.transpose(hit_data_rz) miss_data_rz = np.vstack((speed_miss_rz, gamma_power_miss_rz)) miss_data_rz = np.transpose(miss_data_rz) hit_data_hb = np.vstack((speed_hit_hb, gamma_power_hit_hb)) hit_data_hb = np.transpose(hit_data_hb) miss_data_hb = np.vstack((speed_miss_hb, gamma_power_miss_hb)) miss_data_hb = np.transpose(miss_data_hb) bins_hit_ob, speed_bins_hit_ob = bin_speed_data(prm, hit_data_ob) bins_hit_rz, speed_bins_hit_rz = bin_speed_data(prm, hit_data_rz) bins_hit_hb, speed_bins_hit_hb = bin_speed_data(prm, hit_data_hb) bins_miss_ob, speed_bins_miss_ob = bin_speed_data(prm, miss_data_ob) bins_miss_rz, speed_bins_miss_rz = bin_speed_data(prm, miss_data_rz) bins_miss_hb, speed_bins_miss_hb = bin_speed_data(prm, miss_data_hb) vr_power_calculations_plots.plot_gamma_power_speed_hit_miss_locations( prm, bins_hit_ob, speed_bins_hit_ob, bins_miss_ob, speed_bins_miss_ob, bins_hit_rz, speed_bins_hit_rz, bins_miss_rz, speed_bins_miss_rz, bins_hit_hb, speed_bins_hit_hb, bins_miss_hb, speed_bins_miss_hb, channel)
def process_movement_and_stationary_locations_hit_miss( prm, before_stop_outbound, before_stop_rewardzone, before_stop_homebound, after_stop_outbound, after_stop_rewardzone, after_stop_homebound, channel): #above based on hit or miss #split based on hit and miss bs_outbound_hit, bs_outbound_miss = vr_split_data.split_all_data_hit_miss( prm, before_stop_outbound) as_outbound_hit, as_outbound_miss = vr_split_data.split_all_data_hit_miss( prm, after_stop_outbound) bs_rz_hit, bs_rz_miss = vr_split_data.split_all_data_hit_miss( prm, before_stop_rewardzone) as_rz_hit, as_rz_miss = vr_split_data.split_all_data_hit_miss( prm, after_stop_rewardzone) bs_homebound_hit, bs_homebound_miss = vr_split_data.split_all_data_hit_miss( prm, before_stop_homebound) as_homebound_hit, as_homebound_miss = vr_split_data.split_all_data_hit_miss( prm, after_stop_homebound) # make example power spectras vr_track_location_analysis.stop_start_power_spectra_locations_hit_miss( prm, bs_outbound_hit, bs_outbound_miss, as_outbound_hit, as_outbound_miss, bs_rz_hit, bs_rz_miss, as_rz_hit, as_rz_miss, bs_homebound_hit, bs_homebound_miss, as_homebound_hit, as_homebound_miss, channel) # FIGURE 2 B : # pull data from whole recording vr_power_calculations.calculate_and_plot_pooled_gamma_power_stop_start_locations_hit_miss( prm, bs_outbound_hit, bs_outbound_miss, as_outbound_hit, as_outbound_miss, bs_rz_hit, bs_rz_miss, as_rz_hit, as_rz_miss, bs_homebound_hit, bs_homebound_miss, as_homebound_hit, as_homebound_miss, channel) # plot example continuous data vr_track_location_plots.make_stop_start_locations_hit_miss_continuous_plot( prm, channel, bs_outbound_hit, bs_outbound_miss, as_outbound_hit, as_outbound_miss, bs_rz_hit, bs_rz_miss, as_rz_hit, as_rz_miss, bs_homebound_hit, bs_homebound_miss, as_homebound_hit, as_homebound_miss)