| @@ 393-419 (lines=27) @@ | ||
| 390 | return half_wave_potential |
|
| 391 | ||
| 392 | ||
| 393 | def peak_heights(DataFrame_x, DataFrame_y): |
|
| 394 | """Outputs heights of minimum peak and maximum |
|
| 395 | peak from cyclic voltammetry data. |
|
| 396 | ||
| 397 | Parameters |
|
| 398 | ---------- |
|
| 399 | DataFrame_x : should be in the form of a pandas DataFrame column. |
|
| 400 | For example, df['potentials'] could be input as the column of x |
|
| 401 | data. |
|
| 402 | ||
| 403 | DataFrame_y : should be in the form of a pandas DataFrame column. |
|
| 404 | For example, df['currents'] could be input as the column of y |
|
| 405 | data. |
|
| 406 | ||
| 407 | Returns |
|
| 408 | ------- |
|
| 409 | Results: height of maximum peak, height of minimum peak |
|
| 410 | in that order in the form of a list.""" |
|
| 411 | current_max = peak_values(DataFrame_x, DataFrame_y)[1] |
|
| 412 | current_min = peak_values(DataFrame_x, DataFrame_y)[3] |
|
| 413 | x1, x2 = split(DataFrame_x) |
|
| 414 | y1, y2 = split(DataFrame_y) |
|
| 415 | line_at_min = linear_background(x1, y1)[peak_detection_fxn(DataFrame_y)[1]] |
|
| 416 | line_at_max = linear_background(x2, y2)[peak_detection_fxn(DataFrame_y)[0]] |
|
| 417 | height_of_max = current_max - line_at_max |
|
| 418 | height_of_min = abs(current_min - line_at_min) |
|
| 419 | return [height_of_max, height_of_min] |
|
| 420 | ||
| 421 | ||
| 422 | def peak_ratio(DataFrame_x, DataFrame_y): |
|
| @@ 393-419 (lines=27) @@ | ||
| 390 | return half_wave_potential |
|
| 391 | ||
| 392 | ||
| 393 | def peak_heights(DataFrame_x, DataFrame_y): |
|
| 394 | """Outputs heights of minimum peak and maximum |
|
| 395 | peak from cyclic voltammetry data. |
|
| 396 | ||
| 397 | Parameters |
|
| 398 | ---------- |
|
| 399 | DataFrame_x : should be in the form of a pandas DataFrame column. |
|
| 400 | For example, df['potentials'] could be input as the column of x |
|
| 401 | data. |
|
| 402 | ||
| 403 | DataFrame_y : should be in the form of a pandas DataFrame column. |
|
| 404 | For example, df['currents'] could be input as the column of y |
|
| 405 | data. |
|
| 406 | ||
| 407 | Returns |
|
| 408 | ------- |
|
| 409 | Results: height of maximum peak, height of minimum peak |
|
| 410 | in that order in the form of a list.""" |
|
| 411 | current_max = peak_values(DataFrame_x, DataFrame_y)[1] |
|
| 412 | current_min = peak_values(DataFrame_x, DataFrame_y)[3] |
|
| 413 | x1, x2 = split(DataFrame_x) |
|
| 414 | y1, y2 = split(DataFrame_y) |
|
| 415 | line_at_min = linear_background(x1, y1)[peak_detection_fxn(DataFrame_y)[1]] |
|
| 416 | line_at_max = linear_background(x2, y2)[peak_detection_fxn(DataFrame_y)[0]] |
|
| 417 | height_of_max = current_max - line_at_max |
|
| 418 | height_of_min = abs(current_min - line_at_min) |
|
| 419 | return [height_of_max, height_of_min] |
|
| 420 | ||
| 421 | ||
| 422 | def peak_ratio(DataFrame_x, DataFrame_y): |
|