| Total Complexity | 0 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | |||
| 2 | results_dict = {} |
||
| 3 | |||
| 4 | # df = main.data_frame(dict_1,1) |
||
| 5 | x = df['Potential'] |
||
|
|
|||
| 6 | y = df['Current'] |
||
| 7 | # Peaks are here [list] |
||
| 8 | peak_index = core.peak_detection_fxn(y) |
||
| 9 | # Split x,y to get baselines |
||
| 10 | x1,x2 = core.split(x) |
||
| 11 | y1,y2 = core.split(y) |
||
| 12 | y_base1 = core.linear_background(x1,y1) |
||
| 13 | y_base2 = core.linear_background(x2,y2) |
||
| 14 | # Calculations based on baseline and peak |
||
| 15 | values = core.peak_values(x,y) |
||
| 16 | Et = values[0] |
||
| 17 | Eb = values[2] |
||
| 18 | dE = core.del_potential(x,y) |
||
| 19 | half_E = min(Et,Eb) + core.half_wave_potential(x,y) |
||
| 20 | ia = core.peak_heights(x,y)[0] |
||
| 21 | ic = core.peak_heights(x,y)[1] |
||
| 22 | ratio_i = core.peak_ratio(x,y) |
||
| 23 | results_dict['Peak Current Ratio'] = ratio_i |
||
| 24 | results_dict['Ipc'] = ic |
||
| 25 | results_dict['Ipa'] = ia |
||
| 26 | results_dict['Epc'] = Eb |
||
| 27 | results_dict['Epa'] = Et |
||
| 28 | results_dict['∆E'] = dE |
||
| 29 | results_dict['Redox Potential'] = half_E |
||
| 30 | if dE>0.3: |
||
| 31 | results_dict['Reversible'] = 'No' |
||
| 32 | else: |
||
| 33 | results_dict['Reversible'] = 'Yes' |
||
| 34 | |||
| 35 | if half_E>0 and 'Yes' in results_dict.values(): |
||
| 36 | results_dict['Type'] = 'Catholyte' |
||
| 37 | elif 'Yes' in results_dict.values(): |
||
| 38 | results_dict['Type'] = 'Anolyte' |
||
| 39 | #return results_dict |