Data structures (For working with Adrian/TDT data)

class ecog_py.structures.Experiment(headers_df, trials_df, stimuli_df)

Bases: object

Data structure for handling data from an ECoG experiment

exp_name

Experiment Name

Type

string

segments

List of Segment objects in the Experiment.

Type

list<Segment>

headers_df

DataFrame containing header.csv information (Loaded from file using DataLoader module)

Type

pandas.DataFrame

trials_df

DataFrame containing trials.csv information (Loaded from file using DataLoader module)

Type

pandas.DataFrame

stimuli_df

DataFrame containing stimuli.csv information (Loaded from file using DataLoader module)

Type

pandas.DataFrame

num_trials

Number of trials

Type

int

has_laser

True if using optogenetics (trials.csv contains has_laser field)

Type

bool

class ecog_py.structures.Segment(exp_name, segment_num, repetitions, stim_set, stim_layout, sweep_duration, sweep_period, first_trial_num, last_trial_num, stim_interval, stim_onset, stim_isi, stim_train_N, stim_shape, stim_ampl, stim_duration, whisker_map, trials_df, stimuli_df, has_laser)

Bases: object

Data structure for storing trial information and data

exp_name

Experiment Name

Type

string

segment_num

Segment number

Type

int

repetitions

Number of repetitions (A repetition is N sweeps, in which the full stimulus set is presented once).

Type

int

stim_set

Array of stimulus IDs in stimulus set

Type

ndarray of type int

stim_layout

Stimulus layout ID (1 - Standard, 2 - Trains, 3 - Interleaved, 5 - RF Mapping, 7 - Multi-whisker synchronous stimuli)

Type

int

sweep_duration

Length of trials in ms (Must be shorter than sweep_period)

Type

int (milliseconds)

sweep_period

Inter-sweep-interval. Interval from start of trial N to start of trial N + 1 in ms. Must be > 200ms longer than sweep_duration.

Type

int (milliseconds)

first_trial_num

Index of first trial in this segment

Type

int

last_trial_num

Index of last trial in this segment

Type

int

stim_interval

Interval between stimulus units

Type

int (milliseconds)

stim_onset

Stimuli onset time

Type

int (milliseconds)

stim_train_N

Number of stimuli per train

Type

int

stim_isi

Stimuli train interval

Type

int (milliseconds)

stim_shape

Stimulus waveform shape (2 - Ramp, 3 - Cosine-rise, 4 - Shulz CF1, 5 - Vibrotactile (independent), 6 - Vibrotactile (identical))

Type

list<int>

stim_ampl

Piezo stimulus amplitude in (micrometers)

Type

list<int>

stim_duration

Piezo stimulus duration (rise + hold + rise)

Type

list<int>

trials

List of trials in this segment

Type

list<Trial>

class ecog_py.structures.Trial(exp_name, segment_num, trial_num, sweep_duration, sweep_period, stim_layout, stim_interval, stim_onset, stim_isi, stim_train_N, stim_shape, stim_ampl, stim_duration, whisker_map, stimuli_df, laser)

Bases: object

Data structure for storing sweep information and data