Add cycle number and charge/discharge tags in solution data
See original GitHub issueSummary Automatically provide information on cycle number and whether the data describe charge / discharge
Motivation After running an experiment, some data post-processing is needed to append information on cycle number and charge/discharge, which can be useful for further data analysis. These features could be automatically extracted and included in sol.data
Additional context Using Pandas and Numpy, I have added a couple of lines to add these features after importing the data into a DataFrame, although I do realize they may not fully describe all existing use cases for more complex charge/discharge cycles:
df["Charge/Discharge"] = np.where(df["Current [A]"] >=0, "D", "C")
df["Cycle number"] = np.ceil(df["Charge/Discharge"].ne(df["Charge/Discharge"].shift()).cumsum() / 2).astype("int32")
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
The way
solution.data
is constructed is not super straightforward, it has to evaluate pybamm symbols (variables). We could add a variable which is the sign of the current. Adding a variable for cycle number is harderAre you aware of
solution.cycles
and (e.g.)solution.cycles[0].steps
, which give an easy way of splitting cycles and steps?