from Looped_CV_Data import plot_looped_data, get_maximum_current from matplotlib import pyplot as plt directory_list = [ '/Users/st659/Google Drive/Large Ref 1 9-12-16', '/Users/st659/Google Drive/Large Ref 2 9-12-16' ] plt.style.use(['seaborn-white', 'seaborn-poster']) results = list() max_results = list() fig = plt.figure() ax = fig.add_subplot(111) ax2 = ax.twinx() for directory in directory_list: voltage, current = plot_looped_data(directory) split_directory = directory.split(" ") voltage_max, current_max, time_points = get_maximum_current( voltage, current) ax.plot(time_points, voltage_max, label=split_directory[-1]) ax2.plot(time_points, current_max, linestyle='--') ax.legend() ax.set_title( 'Stability of Large Au Pseudo Reference over Time in 100 $\mu$M MB') ax.set_ylabel('Voltage (V)') ax2.set_ylabel('Current (mA)') ax.set_xlabel('Time (mins)') plt.show()
import os def smooth(y, box_pts): box = np.ones(box_pts) / box_pts y_smooth = np.convolve(y, box, mode='same') return y_smooth def mad(data, axis=None): return np.mean(np.abs(data - np.mean(data, axis)), axis) directory = '/Users/st659/Google Drive/Ecoli 50uM MB 1-12-2016' directory2 = '/Users/st659/Google Drive/Cell 1 Reference Measurement' voltage_list, current_list = plot_looped_data(directory) max_current_list = list() max_voltage_list = list() for current, voltage in zip(current_list, voltage_list): max_current = max(current) max_current_arg = np.argmax(current) max_current_list.append(max_current) max_voltage_list.append(voltage[max_current_arg]) time_points = np.linspace(0, len(max_current_list) * 10, num=len(max_current_list)) mad_val = mad(max_voltage_list) voltage_median = np.median(max_voltage_list)
from Looped_CV_Data import plot_looped_data import matplotlib.pyplot as plt import numpy as np import os ecoli = '/Users/st659/Google Drive/Ecoli 50uM MB 1-12-2016' ref = '/Users/st659/Google Drive/Celll Ref Measurements 28-11-16' ref_volt_list, ref_current_list = plot_looped_data(ref) ecoli_volt_list, ecoli_current_list = plot_looped_data(ecoli) max_current_ref_list = list() max_voltage_ref_list = list() max_current_ecoli_list = list() max_voltage_ecoli_list = list() for current, voltage in zip(ref_current_list, ref_volt_list): max_current = max(current) max_current_arg = np.argmax(current) max_current_ref_list.append(max_current) max_voltage_ref_list.append(voltage[max_current_arg]) for current, voltage in zip(ecoli_current_list, ecoli_volt_list): max_current = max(current) max_current_arg = np.argmax(current) max_current_ecoli_list.append(max_current) max_voltage_ecoli_list.append(voltage[max_current_arg]) print(max_voltage_ref_list) print(len(max_voltage_ref_list)) normal_ecoli_voltage = list() normal_ref_voltage = list()