Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Nov 30, 2023
1 parent 8475cd4 commit f48fe87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aiida_aurora/utils/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ def get_data_from_results(array_node) -> dict:
def post_process_data(t: np.ndarray, Ewe: np.ndarray, I: np.ndarray) -> dict:
"""docstring"""

# filter out zeros - usually first value(s)
zeros = np.where(I == 0)
t, Ewe, I = np.delete(t, zeros), np.delete(Ewe, zeros), I[I != 0]
mask = I != 0 # filter out zero current
t, Ewe, I = t[mask], Ewe[mask], I[mask]

# mark half-cycles (including first and last values)
idx = np.where(np.diff(np.sign(I), prepend=0) != 0)[0]
idx = np.append(idx, len(I))

# integrate and store charge and discharge currents
Qc, Qd = [], []
Expand Down

0 comments on commit f48fe87

Please sign in to comment.