| @@ 482-508 (lines=27) @@ | ||
| 479 | return half_wave_pot |
|
| 480 | ||
| 481 | ||
| 482 | def peak_heights(dataframe_x, dataframe_y): |
|
| 483 | """Outputs heights of minimum peak and maximum |
|
| 484 | peak from cyclic voltammetry data. |
|
| 485 | ||
| 486 | Parameters |
|
| 487 | ---------- |
|
| 488 | DataFrame_x : should be in the form of a pandas DataFrame column. |
|
| 489 | For example, df['potentials'] could be input as the column of x |
|
| 490 | data. |
|
| 491 | ||
| 492 | DataFrame_y : should be in the form of a pandas DataFrame column. |
|
| 493 | For example, df['currents'] could be input as the column of y |
|
| 494 | data. |
|
| 495 | ||
| 496 | Returns |
|
| 497 | ------- |
|
| 498 | Results: height of maximum peak, height of minimum peak |
|
| 499 | in that order in the form of a list.""" |
|
| 500 | current_max = peak_values(dataframe_x, dataframe_y)[1] |
|
| 501 | current_min = peak_values(dataframe_x, dataframe_y)[3] |
|
| 502 | col_x1, col_x2 = split(dataframe_x) |
|
| 503 | col_y1, col_y2 = split(dataframe_y) |
|
| 504 | line_at_min = linear_background(col_x1, col_y1)[peak_detection_fxn(dataframe_y)[1]] |
|
| 505 | line_at_max = linear_background(col_x2, col_y2)[peak_detection_fxn(dataframe_y)[0]] |
|
| 506 | height_of_max = current_max - line_at_max |
|
| 507 | height_of_min = abs(current_min - line_at_min) |
|
| 508 | return [height_of_max, height_of_min] |
|
| 509 | ||
| 510 | ||
| 511 | def peak_ratio(dataframe_x, dataframe_y): |
|
| @@ 82-108 (lines=27) @@ | ||
| 79 | return half_wave_pot |
|
| 80 | ||
| 81 | ||
| 82 | def peak_heights(dataframe_x, dataframe_y): |
|
| 83 | """Outputs heights of minimum peak and maximum |
|
| 84 | peak from cyclic voltammetry data. |
|
| 85 | ||
| 86 | Parameters |
|
| 87 | ---------- |
|
| 88 | DataFrame_x : should be in the form of a pandas DataFrame column. |
|
| 89 | For example, df['potentials'] could be input as the column of x |
|
| 90 | data. |
|
| 91 | ||
| 92 | DataFrame_y : should be in the form of a pandas DataFrame column. |
|
| 93 | For example, df['currents'] could be input as the column of y |
|
| 94 | data. |
|
| 95 | ||
| 96 | Returns |
|
| 97 | ------- |
|
| 98 | Results: height of maximum peak, height of minimum peak |
|
| 99 | in that order in the form of a list.""" |
|
| 100 | current_max = peak_values(dataframe_x, dataframe_y)[1] |
|
| 101 | current_min = peak_values(dataframe_x, dataframe_y)[3] |
|
| 102 | col_x1, col_x2 = core.split(dataframe_x) |
|
| 103 | col_y1, col_y2 = core.split(dataframe_y) |
|
| 104 | line_at_min = core.linear_background(col_x1, col_y1)[core.peak_detection_fxn(dataframe_y)[1]] |
|
| 105 | line_at_max = core.linear_background(col_x2, col_y2)[core.peak_detection_fxn(dataframe_y)[0]] |
|
| 106 | height_of_max = current_max - line_at_max |
|
| 107 | height_of_min = abs(current_min - line_at_min) |
|
| 108 | return [height_of_max, height_of_min] |
|
| 109 | ||
| 110 | ||
| 111 | def peak_ratio(dataframe_x, dataframe_y): |
|