Module gonioanalysis.drosom.reports.left_right

Exporting results for the set of experiments where one location in each left/right eye was measured.

Functions

def left_right_displacements(manalysers, group_name, fn_prefix='LR-displacements', savedir='/home/joni/.gonioanalysis/final_results/LR_exports', stimuli={'uv': ['uv', ')'], 'green': ['green'], 'NA': []}, strong_weak_division=False, divide_threshold=3, wanted_imagefolders=None, microns=True, phase=False, mean_lr=False, reference_frame=False)

Saves CSV files of left and right eye movements and ERGs.

If many recordings for an eye/stimulus/specimen combination exist, then takes the mean of these (so that each eye appears only once).

Arguments

manalysers : list of objects
MAnalyser objects for
group_name : string
Name that describes the manalysers. For example, "blind_norpa" or "controls".
fn_prefix : string
Text to append in the beginnign of the CSV filename.
stimuli : dict of lists of strings
Each key is the name of the stimulus, and matching value is a list of the suffixes that match the stimulus (the suffix in the end of imagefolder name)
strong_weak_division : bool
If True, group data based on strong and weak eye instead of combined left and right.
divide_threshold : int
Related to the strong_weak_divison argument. For some specimen there may be recordings only from one eye, and divide_threshold or more is required to in total to do the division.
wanted_imagefolders : None or a dict
Keys specimen names, items a sequence of wanted imagefolders Relaxes horizontal conditions.
microns : bool
Convert pixel movement values to microns
phase : bool
If True, return phase (vector direction) instead of the magnitude.
mean_lr : bool
If True, average the left and right eye data together.
reference_frame : False or int
If an interger (between 0 and N_frames-1), use the corresponding frame as a reference zero point.
def left_right_summary(manalysers)

Condensed from left/right

def lrfiles_summarise(lrfiles, point_type='mean', ab=(None, None))

Datapoints for making box/bar plots and/or for statistical testing.

Arguments

lrfiles : list of filenames
LR-displacements files of the left_right_displacements.
point_type : string
Either "mean" to take mean of the range (used for DPP movement data) or min-start to take the mean around the minimum and subtract start value (used for ERGs). If not specified, use 'mean'.
ab : tuple
Specify the range as indices (rows of the lrfiles excluding the header) If not specified, try to autodetect based on if ERGs is contained in the filesames ((half,end) for DPP, (400, 800) for ERGs).
def quantify_metric(data1d, metric_type='mean', ab=(None, None))

From a 1D array (time series) quantify single value metric.

metric_type : string "mean" to take the mean of the range ab : tuple of integers The range as datapoint indices.

def read_CSV_cols(fn)
def write_CSV_cols(fn, columns)

Note

Writes as many rows as there are rows in the first columns.

Attributes

columns : list of lists
Each item is column, and in each item that is also a list, each item is the value of the row.