Module gonioanalysis.drosom.kinematics

Functions

def latency(manalyser, image_folder, threshold=0.05, method='sigmoidal', fit_to_mean=False)

Response latency ie. when the response exceedes by default 5% of its maximum value.

Arguments

threshold : float
Between 0 and 1
method : string
Either "sigmoidal" (uses the sigmoidal fit) or "simple" (uses the data directly).
fit_to_mean : bool
If method=='sigmoidal', performs the fit on the image folder's mean and not on the responses directly.

Returns

latency : sequency
The time durations in seconds that it takes for the responses to reach (by default) 5% of its maximum value (length of repeats).
def magstd_over_repeats(manalyser, image_folder, maxmethod='max')

Standard deviation in responses (std of max displacement of each repeat)

maxmethod : string See mean_max_response

def mean_max_response(manalyser, image_folder, maxmethod='max')

Averages over repetitions, and returns the maximum of the mean trace.

manalyser image_folder maxmethod : string Method how the determine the maximum displacement 'max': Take the furthest point 'mean_latterhalf': final 50% mean discplacement 'final' : Use the final value

def mean_topspeed(manalyser, image_folder)

Returns the top speed of the mean response.

def save_sigmoidal_fit_CSV(analysers, savefn, save_fits=True, with_extra=True, microns=True, fit_to_mean=False)

Takes in analysers, performs sigmoidal_fit for each and all image_folders. Then saves the results as a CSV file, and by default fit images as well.

analysers : list of objects List of analyser objects savefn : string Filename. save_fits : bool Save png images of the fits. fit_to_mean : bool If True, calculate the mean for the image folder and perform the fit on the mean.

def sigmoidal_fit(manalyser, image_folder, figure_savefn=None, fit_to_mean=False)

Assuming sigmoidal (logistic function) response.

Arguments

manalyser : object
 
image_folder : string
 
figure_savefn : string
If given, saves a figure of the fit

Returns

amplitudes, speeds, halfrise_times : list or None
All Nones if image_folder has not movements
fit_to_mean : bool
If True, calculate the mean for the image folder and perform the fit on the mean.