liplited_test.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. from ctypes import Structure
  2. from re import M
  3. import pandas as pd
  4. import numpy as np
  5. import datetime
  6. import time, datetime
  7. import matplotlib.pyplot as plt
  8. from pylab import*
  9. from scipy.signal import savgol_filter
  10. import os
  11. import log
  12. path = r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561原始数据'
  13. def get_file(): #创建一个空列表
  14. files =os.listdir(path)
  15. files.sort() #排序
  16. file_list= []
  17. for file in files:
  18. if not os.path.isdir(path +file): #判断该文件是否是一个文件夹
  19. f_name = str(file)
  20. # print(f_name)
  21. tr = '\\' #多增加一个斜杠
  22. filename = path + tr + f_name
  23. file_list.append(filename)
  24. return file_list
  25. mylog=log.Mylog('log_diag.txt','error')
  26. mylog.logcfg()
  27. df_lipltd_data = pd.DataFrame(columns=['sn','time','liplated','liplated_amount'])
  28. file_list = get_file()
  29. for file in file_list:
  30. data = pd.read_csv(file,encoding='GB18030')
  31. #----------------------------------------定义滤波函数-----------------------------------------------------------------------
  32. def moving_average(interval, windowsize):
  33. window = np.ones(int(windowsize)) / float(windowsize)
  34. re = np.convolve(interval, window, 'same')
  35. return re
  36. #----------------------------------------筛选充电后静置数据------------------------------------------------------------
  37. chrgr_rest_data_temp = data.loc[((data['充电状态'] == 0) & (data['SOC[%]'] > 98) & (data['总电流[A]'] == 0))|
  38. ((data['充电状态'] == 2) & (data['SOC[%]'] > 98) & (data['总电流[A]'] == 0))]#接近慢充后静置数据
  39. chrgr_rest_data = chrgr_rest_data_temp.reset_index(drop=True)
  40. temp_rest_time = chrgr_rest_data['时间戳'].reset_index(drop=True)
  41. rest_time = pd.to_datetime(temp_rest_time)
  42. # rest_chrg_time = datetime(rest_time)
  43. # delta_time = np.diff(rest_chrg_time)
  44. delta_time = (np.diff(rest_time)/pd.Timedelta(1, 'min'))#计算时间差的分钟数
  45. pos = np.where(delta_time > 30)
  46. pos_ful_tem = np.insert(pos, 0, 0)
  47. pos_len = len(pos_ful_tem)
  48. data_len = len(rest_time)
  49. pos_ful = np.insert(pos_ful_tem, pos_len, data_len-1)
  50. splice_num = []
  51. if len(pos[0]) >= 1:
  52. pos_ful_tem = np.insert(pos, 0, 0)
  53. pos_len = len(pos_ful_tem)
  54. data_len = len(rest_time)
  55. pos_ful = np.insert(pos_ful_tem, pos_len, data_len-1)
  56. for item in range(0,len(pos_ful)-1):
  57. splice_num.extend(item*np.ones(pos_ful[item +1]-pos_ful[item]))
  58. splice_num = np.insert(splice_num, 0, 0)
  59. else:
  60. splice_num = np.zeros(len(temp_rest_time))
  61. pos_ful = np.array([0])
  62. chrgr_rest_data['chrgr_rest'] = splice_num
  63. #---------------------------判断数据点数大于30的数据段,对电压微分并画图--------------------------------------------
  64. cellvolt_name=['单体电压'+str(x) for x in range(1,18)]
  65. cellvolt_list = cellvolt_name
  66. chrgr_rest_check_data = chrgr_rest_data.drop(['GSM信号','故障等级','故障代码','单体压差','绝缘电阻','总电流[A]','总电压[V]','充电状态','单体压差','SOC[%]'],axis=1,inplace=False)
  67. chrgr_rest_check_data.fillna(value=0)
  68. df_rest_volt_diffdt = pd.DataFrame()
  69. df_rest_volt_smooth = pd.DataFrame()
  70. df_ini_volt_total = pd.DataFrame()
  71. k = 0
  72. for j in range(0,len(pos_ful)-1):#len(pos_ful)-1#有几段充电后静置数据
  73. df_test_rest_data = chrgr_rest_check_data.loc[chrgr_rest_check_data['chrgr_rest'] == j]
  74. df_rest_volt_smooth = pd.DataFrame()
  75. df_ini_volt = pd.DataFrame()
  76. df_test_rest_time = pd.to_datetime(df_test_rest_data['时间戳'],format='%Y-%m-%d %H:%M:%S')
  77. df_test_rest_time = df_test_rest_time.reset_index(drop=True)
  78. df_data_length = len(df_test_rest_time)
  79. if (df_data_length > 30) & ((df_test_rest_time[df_data_length - 1] - df_test_rest_time[0])/pd.Timedelta(1, 'min') > 40):#静置时间大于40min
  80. df_test_rest_time_dif_temp = np.diff(df_test_rest_time)/pd.Timedelta(1, 'min')
  81. num_list = []
  82. data_jump_pos = np.where(df_test_rest_time_dif_temp > 3)
  83. if len(data_jump_pos[0]) > 0:
  84. if data_jump_pos[0][0] > 100:
  85. for i in range(0,data_jump_pos[0][0],15):##采样密集时每隔10行取数据
  86. num_list.append(i)
  87. df_rest_data_temp = df_test_rest_data.iloc[num_list]
  88. df_test_rest_data_choose = pd.DataFrame(df_rest_data_temp)
  89. df_test_rest_data_choose_else = df_test_rest_data.iloc[data_jump_pos[0][0]+1:len(df_test_rest_data)-1]
  90. df_rest_data_recon_temp = df_test_rest_data_choose.append(df_test_rest_data_choose_else)
  91. df_rest_data_recon =df_rest_data_recon_temp.reset_index(drop=True)
  92. else:
  93. df_rest_data_recon = df_test_rest_data
  94. else:
  95. df_rest_data_recon = df_test_rest_data
  96. df_rest_time = pd.to_datetime(df_rest_data_recon['时间戳'],format='%Y-%m-%d %H:%M:%S')
  97. df_rest_time = df_rest_time.reset_index(drop=True)
  98. df_rest_time_dif_temp = np.diff(df_rest_time)/pd.Timedelta(1, 'min')
  99. df_rest_volt = df_rest_data_recon[cellvolt_list]
  100. for item in cellvolt_list:
  101. window_temp = int(len(df_rest_volt[item])/3)
  102. if window_temp%2:#滤波函数的窗口长度需为奇数
  103. window = window_temp
  104. else:
  105. window = window_temp - 1
  106. step = min(int(window/3),5)
  107. df_volt_smooth = savgol_filter(df_rest_volt[item],window,step)
  108. df_rest_volt_smooth[item] = df_volt_smooth
  109. df_ini_volt = df_ini_volt.append(df_rest_volt_smooth)
  110. df_ini_volt.columns = cellvolt_list
  111. df_test_rest_volt_diff_temp = np.diff(df_rest_volt_smooth,axis=0)
  112. df_test_rest_time_dif = pd.DataFrame(df_rest_time_dif_temp)
  113. df_test_rest_volt_diff = pd.DataFrame(df_test_rest_volt_diff_temp)
  114. df_test_rest_volt_diffdt_temp = np.divide(df_test_rest_volt_diff,df_test_rest_time_dif)#电压对时间的微分
  115. df_test_rest_volt_diffdt = pd.DataFrame(df_test_rest_volt_diffdt_temp)
  116. df_test_rest_volt_diffdt = df_test_rest_volt_diffdt.append(df_test_rest_volt_diffdt.iloc[len(df_test_rest_volt_diffdt)-1])
  117. df_test_rest_volt_diffdt.columns = cellvolt_list
  118. if len(df_test_rest_volt_diffdt) > 25:
  119. for item in cellvolt_list:
  120. df_volt_diffdt_smooth = savgol_filter(df_test_rest_volt_diffdt[item],13,3)
  121. df_test_rest_volt_diffdt[item] = df_volt_diffdt_smooth
  122. df_test_rest_volt_diffdt['chrgr_rest'] = k
  123. df_test_rest_volt_diffdt['时间戳'] = list(df_rest_time)
  124. df_ini_volt['chrgr_rest'] = k
  125. df_ini_volt['时间戳'] = list(df_rest_time)
  126. k = k+1
  127. df_rest_volt_diffdt = df_rest_volt_diffdt.append(df_test_rest_volt_diffdt)#电压对时间的一次微分
  128. df_rest_volt_diffdt.reset_index()
  129. df_ini_volt_total = df_ini_volt_total.append(df_ini_volt)
  130. df_ini_volt_total.reset_index()
  131. #--------------------------------------------------------确认是否析锂----------------------------------------------------------------------------
  132. # df_lipltd_data = pd.DataFrame(columns=['sn','date','liplated'])
  133. m_num = 0
  134. df_fig_dvdtdata = pd.DataFrame()
  135. df_fig_voltdata = pd.DataFrame()
  136. for item in range(0,k):
  137. lipltd_confirm = []
  138. lipltd_amount = []
  139. df_check_liplated_temp = df_rest_volt_diffdt.loc[df_rest_volt_diffdt['chrgr_rest'] == item].reset_index(drop = True)
  140. df_check_volt_temp = df_ini_volt_total.loc[df_ini_volt_total['chrgr_rest'] == item].reset_index(drop = True)
  141. df_lipltd_volt_temp = df_check_liplated_temp[cellvolt_list]
  142. df_lipltd_volt_len = len(df_lipltd_volt_temp)
  143. df_data_temp_add = df_lipltd_volt_temp.iloc[df_lipltd_volt_len-3:df_lipltd_volt_len-1]#电压对时间的一次微分
  144. df_lipltd_volt_temp_add = df_lipltd_volt_temp.append(df_data_temp_add)
  145. # df_lipltd_volt_temp_dif = np.diff(df_lipltd_volt_temp_add,axis=0)#电压一次微分,计算dv/dt
  146. # df_lipltd_volt_temp_dif = pd.DataFrame(df_lipltd_volt_temp_dif)
  147. # df_lipltd_volt_temp_dif.columns = cellvolt_list
  148. df_lipltd_volt_temp_difdif = np.diff(df_lipltd_volt_temp_add,axis=0)#电压二次微分,判断升降
  149. df_lipltd_volt_temp_difdif = pd.DataFrame(df_lipltd_volt_temp_difdif)
  150. df_lipltd_volt_temp_difdif.columns = cellvolt_list
  151. df_lipltd_volt_temp_difdif_temp = df_lipltd_volt_temp_difdif
  152. df_lipltd_volt_temp_difdif_temp[df_lipltd_volt_temp_difdif_temp >= 0] = 1
  153. df_lipltd_volt_temp_difdif_temp[df_lipltd_volt_temp_difdif_temp < 0] = -1
  154. df_lipltd_volt_temp_difdifdif = np.diff(df_lipltd_volt_temp_difdif_temp,axis=0)#三次微分,利用-2,2判断波分和波谷
  155. df_lipltd_volt_difdifdif = pd.DataFrame(df_lipltd_volt_temp_difdifdif)
  156. df_lipltd_volt_difdifdif.columns = cellvolt_list
  157. df_lipltd_volt_difdifdif['chrgr_rest'] = k
  158. df_lipltd_volt_difdifdif['时间戳'] = list(df_check_liplated_temp['时间戳'])
  159. df_lipltd_volt_difdifdif = df_lipltd_volt_difdifdif.reset_index(drop = True)
  160. df_lipltd_data_temp = df_lipltd_volt_difdifdif.loc[df_lipltd_volt_difdifdif['时间戳'] < (df_check_liplated_temp['时间戳'][0] + datetime.timedelta(minutes=90))]
  161. for cell_name in cellvolt_list:#对每个电芯判断
  162. df_check_plated_data = df_lipltd_data_temp[cell_name]
  163. peak_pos = np.where(df_check_plated_data == -2)
  164. bot_pos = np.where(df_check_plated_data == 2)
  165. if len(bot_pos[0]) & len(peak_pos[0]):
  166. ini_dvdt = df_check_liplated_temp[cell_name][0]
  167. peak_dvdt = df_check_liplated_temp[cell_name][peak_pos[0][0] + 1]
  168. bot_dvdt = df_check_liplated_temp[cell_name][bot_pos[0][0] + 1]
  169. peak_hight = peak_dvdt - ini_dvdt
  170. peak_bot_hight = peak_dvdt - bot_dvdt
  171. liplted_amount_temp = (df_check_liplated_temp['时间戳'][bot_pos[0][0] + 1] - df_check_liplated_temp['时间戳'][0])/pd.Timedelta(1, 'min')
  172. if ((bot_pos[0][0] - peak_pos[0][0]) > 3) & (df_check_liplated_temp[cell_name][peak_pos[0][0] + 1] < 0) & (peak_bot_hight > 0.05*peak_hight) & (liplted_amount_temp > 15):
  173. lipltd_confirm.append(1)#1为析锂,0为非析锂
  174. lipltd_amount.append(liplted_amount_temp)
  175. else:
  176. lipltd_confirm.append(0)
  177. lipltd_amount.append(0)
  178. else:
  179. lipltd_confirm.append(0)
  180. lipltd_amount.append(0)
  181. if any(lipltd_confirm):
  182. temp = file.split('\\')
  183. sn_name = temp[-1].split('.')[0]
  184. df_lipltd_confir_temp = pd.DataFrame({"sn":[sn_name], "time":[df_check_liplated_temp['时间戳'][0]], "liplated":[str(lipltd_confirm)], "liplated_amount":[str(lipltd_amount)]})
  185. df_lipltd_data = df_lipltd_data.append(df_lipltd_confir_temp)
  186. df_lipltd_data = df_lipltd_data.reset_index(drop = True)
  187. df_lipltd_data.sort_values(by = ['time'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
  188. df_fig_dvdtdata_temp = df_check_liplated_temp
  189. df_fig_dvdtdata_temp['chrgr_rest'] = m_num
  190. df_fig_dvdtdata = df_fig_dvdtdata.append(df_fig_dvdtdata_temp)#电压对时间微分数据
  191. df_fig_dvdtdata = df_fig_dvdtdata.reset_index(drop = True)
  192. df_fig_voltdata_temp = df_check_volt_temp
  193. df_fig_voltdata_temp['chrgr_rest'] = m_num
  194. df_fig_voltdata = df_fig_voltdata.append(df_fig_voltdata_temp)#原始电压数据
  195. df_fig_voltdata = df_fig_voltdata.reset_index(drop = True)
  196. m_num = m_num + 1
  197. df_lipltd_data.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561析锂检测结果\PK50001A100000561.csv',index=False,encoding='GB18030')
  198. df_fig_dvdtdata.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561析锂检测结果\微分电压曲线.csv',index=False,encoding='GB18030')
  199. df_fig_voltdata.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561析锂检测结果\电压曲线.csv',index=False,encoding='GB18030')
  200. for i in range(0,m_num):
  201. fig = plt.figure(figsize=(20,10))
  202. df_fig_temp = df_fig_dvdtdata.loc[df_fig_dvdtdata['chrgr_rest'] == i]
  203. df_fig_temp = df_fig_temp.reset_index(drop=True)
  204. df_fig = df_fig_temp.loc[df_fig_temp['时间戳'] < (df_fig_temp['时间戳'][0] + datetime.timedelta(hours=1))]
  205. length = len(df_fig)
  206. df_hms_temp = pd.to_datetime(df_fig['时间戳'])#转换时间格式
  207. df_hms = df_hms_temp.dt.time#仅保留时分秒
  208. df_hms_fig = df_hms.apply(lambda x:x.strftime('%H:%M:%S'))
  209. for volt_num in cellvolt_name[0:10]:
  210. # plt.scatter([x for x in range(0, length)], df_fig[volt_num][0:length], label=volt_num)
  211. plt.plot(df_hms_fig, df_fig[volt_num],linewidth = 2, linestyle = '-', marker = 's',label=volt_num)
  212. mpl.rcParams['font.sans-serif']=['KaiTi']
  213. mpl.rcParams['axes.unicode_minus']=False #用来正常显示负号
  214. plt.legend()
  215. temp = file.split('\\')
  216. sn_name = temp[-1].split('.')[0]
  217. title = sn_name + '-' + df_fig['时间戳'][0].strftime('%y-%m-%d')#df_fig['device_id'][0] + '-' +
  218. plt.xlabel('时间', fontsize=16)
  219. plt.ylabel('电压的时间微分(mv/min)', fontsize=16)
  220. plt.xticks(range(1,len(df_hms_fig),5),rotation=45, fontsize=16)
  221. plt.yticks(fontsize=16)
  222. # plt.xlim((df_hms_temp[0]-datetime.timedelta(minutes=5)).dt.time,(df_hms_temp[0] + datetime.timedelta(hours=1.5)).dt.time)
  223. # plt.ylim(-2.5,0.5)
  224. plt.title(title, fontsize=20)
  225. # plt.show()
  226. plt.savefig(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561析锂分布画图\微分电压曲线\\'+title+'前.png', dpi=300)
  227. for i in range(0,m_num):
  228. fig = plt.figure(figsize=(20,10))
  229. df_fig_temp = df_fig_dvdtdata.loc[df_fig_dvdtdata['chrgr_rest'] == i]
  230. df_fig_temp = df_fig_temp.reset_index(drop=True)
  231. df_fig = df_fig_temp.loc[df_fig_temp['时间戳'] < (df_fig_temp['时间戳'][0] + datetime.timedelta(hours=1))]
  232. length = len(df_fig)
  233. df_hms_temp = pd.to_datetime(df_fig['时间戳'])#转换时间格式
  234. df_hms = df_hms_temp.dt.time#仅保留时分秒
  235. df_hms_fig = df_hms.apply(lambda x:x.strftime('%H:%M:%S'))
  236. for volt_num in cellvolt_name[10:21]:
  237. # plt.scatter([x for x in range(0, length)], df_fig[volt_num][0:length], label=volt_num)
  238. plt.plot(df_hms_fig, df_fig[volt_num],linewidth = 2, linestyle = '-', marker = 's',label=volt_num)
  239. mpl.rcParams['font.sans-serif']=['KaiTi']
  240. mpl.rcParams['axes.unicode_minus']=False #用来正常显示负号
  241. plt.legend()
  242. temp = file.split('\\')
  243. sn_name = temp[-1].split('.')[0]
  244. title = sn_name + '-' + df_fig['时间戳'][0].strftime('%y-%m-%d')#df_fig['device_id'][0] + '-' +
  245. plt.xlabel('时间', fontsize=16)
  246. plt.ylabel('电压的时间微分(mv/min)', fontsize=16)
  247. plt.xticks(range(1,len(df_hms_fig),5),rotation=45, fontsize=16)
  248. plt.yticks(fontsize=16)
  249. # plt.xlim((df_hms_temp[0]-datetime.timedelta(minutes=5)).dt.time,(df_hms_temp[0] + datetime.timedelta(hours=1.5)).dt.time)
  250. # plt.ylim(-2.5,0.5)
  251. plt.title(title, fontsize=20)
  252. # plt.show()
  253. plt.savefig(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561析锂分布画图\微分电压曲线\\'+title+'后.png', dpi=300)
  254. #-------------------------------------原始电压变化曲线-------------------------------------------------
  255. fig = plt.figure(figsize=(20,15))
  256. for i in range(0,m_num):#0,k
  257. # fig = plt.figure(figsize=(20,10))
  258. df_fig = df_fig_voltdata.loc[df_fig_voltdata['chrgr_rest'] == i]
  259. df_fig = df_fig.reset_index(drop=True)
  260. length = len(df_fig)
  261. temp = file.split('\\')
  262. sn_name = temp[-1].split('.')[0]
  263. title = sn_name + '-' + df_fig['时间戳'][0].strftime('%y-%m-%d')#df_fig['device_id'][0] + '-' +
  264. plt_data_len = len(df_fig)
  265. # for volt_num in cellvolt_name[5:6]:
  266. # plt.scatter([x for x in range(0, length)], df_fig[volt_num][0:length], label=volt_num)
  267. # plt.plot([x for x in range(0, plt_data_len)], df_fig[cellvolt_name[5]],linewidth = 2, linestyle = '-', marker = 's',label = title)
  268. plt.plot([x for x in range(0, plt_data_len)], df_fig[cellvolt_name[5]],linewidth = 2, linestyle = '-', marker = 's',label = title)
  269. # plt.plot(df_fig['时间戳'], df_fig[cellvolt_name[5]],linewidth = 2, linestyle = '-', marker = 's',label = title)#cellvolt_name[5]
  270. mpl.rcParams['font.sans-serif']=['KaiTi']
  271. mpl.rcParams['axes.unicode_minus']=False #用来正常显示负号
  272. plt.legend(fontsize=24)
  273. plt.xlabel('采样点', fontsize=24)
  274. plt.ylabel('电压(mV)', fontsize=24)
  275. plt.xticks(fontsize=20)
  276. plt.yticks(fontsize=20)
  277. # plt.xlim(df_fig['时间戳'][0]-datetime.timedelta(minutes=5),df_fig['时间戳'][0] + datetime.timedelta(hours=1.5))
  278. # plt.xlim(0, 30)
  279. # plt.ylim(4120, 4200)
  280. # plt.ylim(-2.5,0.5)
  281. plt.title('6#电芯不同时刻电压曲线', fontsize=30)
  282. plt.savefig(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\PK6040\0561析锂分布画图\静置电压曲线\\'+'6#电芯不同时刻电压曲线'+'.png', dpi=300)
  283. # # plt.show()
  284. # fig = plt.figure(figsize=(20,10))
  285. # for i in range(3,4):#0,k
  286. # # fig = plt.figure(figsize=(20,10))
  287. # df_fig = df_rest_volt_diffdt.loc[df_rest_volt_diffdt['chrgr_rest'] == i]
  288. # df_fig = df_fig.reset_index(drop=True)
  289. # length = len(df_fig)
  290. # temp = file.split('\\')
  291. # sn_name = temp[9].split('.')[0]
  292. # title = sn_name + '-' + df_fig['时间戳'][0].strftime('%y-%m-%d')#df_fig['device_id'][0] + '-' +
  293. # plt_data_len = len(df_fig)
  294. # # for volt_num in cellvolt_name[5:6]:
  295. # # plt.scatter([x for x in range(0, length)], df_fig[volt_num][0:length], label=volt_num)
  296. # # plt.plot([x for x in range(0, plt_data_len)], df_fig[cellvolt_name[5]],linewidth = 2, linestyle = '-', marker = 's',label = title)
  297. # # plt.plot([x for x in range(0, plt_data_len)], df_fig[cellvolt_name[2]],linewidth = 2, linestyle = '-', marker = 's',label = title)
  298. # plt.plot(df_fig['时间戳'], df_fig[cellvolt_name[5]],linewidth = 2, linestyle = '-', marker = 's',label = cellvolt_name[5])
  299. # mpl.rcParams['font.sans-serif']=['SimHei']
  300. # mpl.rcParams['axes.unicode_minus']=False #用来正常显示负号
  301. # plt.legend()
  302. # plt.xlabel('采样点', fontsize=14)
  303. # plt.ylabel('电压的时间微分(mv/min)', fontsize=14)
  304. # plt.xlim(df_fig['时间戳'][0]-datetime.timedelta(minutes=5),df_fig['时间戳'][0] + datetime.timedelta(hours=5))
  305. # # plt.xlim(0, 60)
  306. # # plt.ylim(-2.5,0.5)
  307. # plt.title('6#电芯不同时间电压微分曲线')
  308. # plt.savefig(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\MGMCLN750N215N049\\'+'6#电芯析锂'+'.png', dpi=300)
  309. # plt.show()