-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathch_dch_plot.py
52 lines (42 loc) · 1.72 KB
/
ch_dch_plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import helper_functions as hf
import json
def plot_ch_dch(battery_dataframe, cycle):
# Charge capacity plot
# -------------------------------------------------------------#
steps = [21, 22]
# Coordinate arrays and value to measure
ch_capacity_points = []
ch_time_points = []
ch_measure_value = 'Charge Capacity (mAh)'
# Define coordinates
for step in steps:
hf.set_coordinate_points(battery_dataframe, step, cycle, ch_capacity_points,
ch_time_points, 0, ch_measure_value)
hf.set_coordinate_points(battery_dataframe, steps[-1], cycle, ch_capacity_points,
ch_time_points, -1, ch_measure_value)
# -------------------------------------------------------------#
# Discharge capacity plot
# -------------------------------------------------------------#
steps = [23, 24]
# Coordinate arrays and value to measure
dch_capacity_points = []
dch_time_points = []
dch_measure_value = 'Discharge Capacity (mAh)'
# Define coordinates
for step in steps:
hf.set_coordinate_points(battery_dataframe, step, cycle, dch_capacity_points,
dch_time_points, 0, dch_measure_value)
hf.set_coordinate_points(battery_dataframe, steps[-1], cycle, dch_capacity_points,
dch_time_points, -1, dch_measure_value)
# -------------------------------------------------------------#
data = {
"ch": {
"time_points": ch_time_points,
"capacity_points": ch_capacity_points,
},
"dch": {
"time_points": dch_time_points,
"capacity_points": dch_capacity_points,
}
}
return data