timing#

Timing: reaction time, time between trials, center port holds, trial duration, misses and early pokeouts.

Functions

add_early_pokeouts

Adds a boolean column 'early_pokeout' to the dataframe indicating whether there was an early pokeout in the center port before holding the required time.

add_inter_trial_interval_column_to_df

Add an inter-trial interval column to the dataframe.

add_port_holds

Adds port<N>_holds: the duration of every poke in that port during the trial (including the ITI), as an array per trial.

add_reaction_time

Adds reaction_time: time from the last center poke out to the next side poke.

add_time_between_trials

Adds time_between_trials: time from the start of the previous trial of the same session (NaN for the first trial of each session).

add_trial_duration_column_to_df

Add a trial duration column to the dataframe.

add_trial_initiation_time_to_df

Add a trial initiation time column to the dataframe.

add_trial_misses

Add a trial misses column to the dataframe.

adjust_trials_and_time_of_start_to_first_session

Adjusts the 'TRIAL_START' and 'trial' columns to start from the first session.

calculate_time_between_trials_and_reaction_time

Calculate Time Between Trials and Reaction Time.

get_center_hold_df

Per day: mean and 5-95 percentiles of the number of center pokes per trial and of the duration of those pokes.

get_reaction_times_by_date_df

Per day: mean and 5-95 percentiles of the reaction time and of the time between trials.