| @@ 481-507 (lines=27) @@ | ||
| 478 | return half_wave_potential |
|
| 479 | ||
| 480 | ||
| 481 | def peak_heights(DataFrame_x, DataFrame_y): |
|
| 482 | """Outputs heights of minimum peak and maximum |
|
| 483 | peak from cyclic voltammetry data. |
|
| 484 | ||
| 485 | Parameters |
|
| 486 | ---------- |
|
| 487 | DataFrame_x : should be in the form of a pandas DataFrame column. |
|
| 488 | For example, df['potentials'] could be input as the column of x |
|
| 489 | data. |
|
| 490 | ||
| 491 | DataFrame_y : should be in the form of a pandas DataFrame column. |
|
| 492 | For example, df['currents'] could be input as the column of y |
|
| 493 | data. |
|
| 494 | ||
| 495 | Returns |
|
| 496 | ------- |
|
| 497 | Results: height of maximum peak, height of minimum peak |
|
| 498 | in that order in the form of a list.""" |
|
| 499 | current_max = peak_values(DataFrame_x, DataFrame_y)[1] |
|
| 500 | current_min = peak_values(DataFrame_x, DataFrame_y)[3] |
|
| 501 | x1, x2 = split(DataFrame_x) |
|
| 502 | y1, y2 = split(DataFrame_y) |
|
| 503 | line_at_min = linear_background(x1, y1)[peak_detection_fxn(DataFrame_y)[1]] |
|
| 504 | line_at_max = linear_background(x2, y2)[peak_detection_fxn(DataFrame_y)[0]] |
|
| 505 | height_of_max = current_max - line_at_max |
|
| 506 | height_of_min = abs(current_min - line_at_min) |
|
| 507 | return [height_of_max, height_of_min] |
|
| 508 | ||
| 509 | ||
| 510 | def peak_ratio(DataFrame_x, DataFrame_y): |
|
| @@ 100-126 (lines=27) @@ | ||
| 97 | return half_wave_potential |
|
| 98 | ||
| 99 | ||
| 100 | def peak_heights(DataFrame_x, DataFrame_y): |
|
| 101 | """Outputs heights of minimum peak and maximum |
|
| 102 | peak from cyclic voltammetry data. |
|
| 103 | ||
| 104 | Parameters |
|
| 105 | ---------- |
|
| 106 | DataFrame_x : should be in the form of a pandas DataFrame column. |
|
| 107 | For example, df['potentials'] could be input as the column of x |
|
| 108 | data. |
|
| 109 | ||
| 110 | DataFrame_y : should be in the form of a pandas DataFrame column. |
|
| 111 | For example, df['currents'] could be input as the column of y |
|
| 112 | data. |
|
| 113 | ||
| 114 | Returns |
|
| 115 | ------- |
|
| 116 | Results: height of maximum peak, height of minimum peak |
|
| 117 | in that order in the form of a list.""" |
|
| 118 | current_max = peak_values(DataFrame_x, DataFrame_y)[1] |
|
| 119 | current_min = peak_values(DataFrame_x, DataFrame_y)[3] |
|
| 120 | x1, x2 = split(DataFrame_x) |
|
| 121 | y1, y2 = split(DataFrame_y) |
|
| 122 | line_at_min = linear_background(x1, y1)[peak_detection_fxn(DataFrame_y)[1]] |
|
| 123 | line_at_max = linear_background(x2, y2)[peak_detection_fxn(DataFrame_y)[0]] |
|
| 124 | height_of_max = current_max - line_at_max |
|
| 125 | height_of_min = abs(current_min - line_at_min) |
|
| 126 | return [height_of_max, height_of_min] |
|
| 127 | ||
| 128 | ||
| 129 | def peak_ratio(DataFrame_x, DataFrame_y): |
|