I have battery voltage data for one month I need to find out the cycle count for how many cycles the battery fully charged and discharged when the peak voltage value is grater than 53v and valley has to be inbetween 43 and 44 it has to detect one full cycle since I used peak detection algorithm it is not detecting correctly here is y data https://docs.google.com/spreadsheets/d/1K0XspcrpO94mv2wFgW45DzSjAO0Af1uSwmoHHVxDJwI/edit?usp=sharing
Script I used:
import numpy as np
op_col = []
for i in df["voltage"]:
op_col.append(i)
np.set_printoptions(threshold=np.inf)
x = np.array(op_col)
from scipy.signal import find_peaks
peak, _ = find_peaks(x, width=800,prominence=1,height=51)
fig= plt.figure(figsize=(19,8))
plt.plot(x)
plt.xlim(0,45000)
plt.plot(peak, x[peak], "x", color = 'r')
This cycles count I need to get it how can I do that: