Commit 0f15c65c authored by ArneRonneburg's avatar ArneRonneburg
Browse files

Update data_reduction_workflow.py

parent b735c16a
......@@ -60,12 +60,12 @@ file.close()
path = r"E:\HZBdata\20220304_PTBTown/"
path = r"E:\Postdoc\experimental_data\multidimensional spectroscopy experiments\benchmark-exp/"
samples=os.listdir(path)
if __name__=='__main__':
mp.freeze_support()
# for sample in samples:
for sample in ['20220304_PTBTown']:
for sample in ['20211213_PTBT_12mm']:
mainpath=path + sample + "/"
state_dict=pickle.loads(open(mainpath + "state_dict.txt", "rb").read())
echem_folders=state_dict['echem_folders']
......@@ -84,60 +84,60 @@ if __name__=='__main__':
echemie=reduction_echem(mainpath, echem_folders, reference_folder,
timeformat=timeformat, starting_string=start)
#return data_all, OCP, reference,(capacity in coulomb,cycle lengths in s, ch_start, ch_end, dis_start, dis_end)
# UVvis=reduction_UVvis(mainpath, uvvis_folder, dark_folder, timeformat=timeformat, starting_string=start, multicore=True, pool=mp.Pool(8))
UVvis=reduction_UVvis(mainpath, uvvis_folder, dark_folder, timeformat=timeformat, starting_string=start, multicore=True, pool=mp.Pool(8))
#return uvdata, uv_smooth
# EIS, ZHIT=reduction_EIS(mainpath, echem_folders, timeformat=timeformat, starting_string=start,decimal=decimal,multicore=True, pool=mp.Pool(8), zhit=True)
EIS=reduction_EIS(mainpath, echem_folders, timeformat=timeformat, starting_string=start,decimal=decimal,multicore=True, pool=mp.Pool(8), zhit=True)
# if zhit==True:
# return EISdata, ZHITdata
# else:
# return EISdata
# return EISdata
# EIS and UVvis use mp.Pool.imap for asynchronous evaluation
#########################################################
###plotting overviews####################################
#########################################################
# fig, [ax1, ax2, ax3, ax4, ax5, ax6]=plt.subplots(6, num=1, sharex=True, figsize=(25,25))
fig, [ax1, ax2, ax3, ax4, ax5, ax6]=plt.subplots(6, num=1, sharex=True, figsize=(25,25))
# ax1.set_title('Raman-spectra smoothed')
# ax2.set_title('UVvis data smoothed')
# ax3.set_title('Impedance real')
# ax4.set_title('abs Impedance imag')
# ax5.set_title('voltage')
# ax6.set_title('reference voltage')
# for df in Raman[1]:
ax1.set_title('Raman-spectra smoothed')
ax2.set_title('UVvis data smoothed')
ax3.set_title('Impedance real')
ax4.set_title('abs Impedance imag')
ax5.set_title('voltage')
ax6.set_title('reference voltage')
for df in Raman[1]:
# im1=ax1.imshow(np.asarray(df)[::-1], vmin=0, vmax=10000, extent=(df.columns[0]/3600, df.columns[-1]/3600,df.index[0], df.index[-1]),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
im1=ax1.imshow(np.asarray(df)[::-1], vmin=0, vmax=10000, extent=(df.columns[0]/3600, df.columns[-1]/3600,df.index[0], df.index[-1]),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
# im2=ax2.imshow(np.asarray(UVvis[1])[::-1], vmin=0, vmax=0.09, extent=(UVvis[1].columns[0]/3600, UVvis[1].columns[-1]/3600,UVvis[1].index[0], UVvis[1].index[-1]),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
# im3=ax3.imshow(np.asarray(EIS[0])[::-1], extent=(EIS[0].columns[0]/3600, EIS[0].columns[-1]/3600,np.log10(EIS[0].index[0]), np.log10(EIS[0].index[-1])), norm=LogNorm(),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
# # ax3.set_yscale('log')
# im4=ax4.imshow(abs(np.asarray(EIS[1]))[::-1], extent=(EIS[1].columns[0]/3600, EIS[1].columns[-1]/3600,np.log10(EIS[1].index[0]), np.log10(EIS[1].index[-1])),norm=LogNorm(),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
# # ax4.set_yscale('log')
# if np.size(echemie[2])>2:
# ax6.plot(echemie[2].Time/3600, echemie[2].Voltage, 'k--')
# line1=ax5.plot(echemie[0].Time/3600, echemie[0].Voltage, 'r.', label='cycling')
# line2=ax5.plot(echemie[1].Time/3600, echemie[1].Voltage, 'ko', label='OCP')
# fig.subplots_adjust(right=0.9)
# cbar_ax_1 = fig.add_axes([0.9, 0.78, 0.04, 0.10])#left, bottom, width, height
# cbar_ax_2 = fig.add_axes([0.9, 0.64, 0.04, 0.10])#left, bottom, width, height
# cbar_ax_3 = fig.add_axes([0.9, 0.51, 0.04, 0.10])#left, bottom, width, height
# cbar_ax_4 = fig.add_axes([0.9, 0.39, 0.04, 0.10])#left, bottom, width, height
# cbar_1=fig.colorbar(im1, cax=cbar_ax_1, format=mpl.ticker.ScalarFormatter())
# cbar_2=fig.colorbar(im2, cax=cbar_ax_2, format=mpl.ticker.ScalarFormatter())
# cbar_3=fig.colorbar(im3, cax=cbar_ax_3, format=mpl.ticker.ScalarFormatter())
# cbar_4=fig.colorbar(im4, cax=cbar_ax_4, format=mpl.ticker.ScalarFormatter())
im2=ax2.imshow(np.asarray(UVvis[1])[::-1], vmin=0, vmax=0.09, extent=(UVvis[1].columns[0]/3600, UVvis[1].columns[-1]/3600,UVvis[1].index[0], UVvis[1].index[-1]),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
im3=ax3.imshow(np.asarray(EIS[0])[::-1], extent=(EIS[0].columns[0]/3600, EIS[0].columns[-1]/3600,np.log10(EIS[0].index[0]), np.log10(EIS[0].index[-1])), norm=LogNorm(),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
# ax3.set_yscale('log')
im4=ax4.imshow(abs(np.asarray(EIS[1]))[::-1], extent=(EIS[1].columns[0]/3600, EIS[1].columns[-1]/3600,np.log10(EIS[1].index[0]), np.log10(EIS[1].index[-1])),norm=LogNorm(),cmap=plt.cm.rainbow, interpolation ='none', aspect='auto', filternorm = False)
# ax4.set_yscale('log')
if np.size(echemie[2])>2:
ax6.plot(echemie[2].Time/3600, echemie[2].Voltage, 'k--')
line1=ax5.plot(echemie[0].Time/3600, echemie[0].Voltage, 'r.', label='cycling')
line2=ax5.plot(echemie[1].Time/3600, echemie[1].Voltage, 'ko', label='OCP')
fig.subplots_adjust(right=0.9)
cbar_ax_1 = fig.add_axes([0.9, 0.78, 0.04, 0.10])#left, bottom, width, height
cbar_ax_2 = fig.add_axes([0.9, 0.64, 0.04, 0.10])#left, bottom, width, height
cbar_ax_3 = fig.add_axes([0.9, 0.51, 0.04, 0.10])#left, bottom, width, height
cbar_ax_4 = fig.add_axes([0.9, 0.39, 0.04, 0.10])#left, bottom, width, height
cbar_1=fig.colorbar(im1, cax=cbar_ax_1, format=mpl.ticker.ScalarFormatter())
cbar_2=fig.colorbar(im2, cax=cbar_ax_2, format=mpl.ticker.ScalarFormatter())
cbar_3=fig.colorbar(im3, cax=cbar_ax_3, format=mpl.ticker.ScalarFormatter())
cbar_4=fig.colorbar(im4, cax=cbar_ax_4, format=mpl.ticker.ScalarFormatter())
# ax6.set_xlabel('experimental time in h')
# ax6.set_ylabel('Voltage Counter-Reference in V')
# ax5.set_ylabel('voltage Working-Counter in V')
# ax4.set_ylabel('log10 frequency in Hz')
# ax3.set_ylabel('log10 frequency in Hz')
# ax2.set_ylabel('wavelength in nm')
# ax1.set_ylabel('raman shift in 1/cm')
ax6.set_xlabel('experimental time in h')
ax6.set_ylabel('Voltage Counter-Reference in V')
ax5.set_ylabel('voltage Working-Counter in V')
ax4.set_ylabel('log10 frequency in Hz')
ax3.set_ylabel('log10 frequency in Hz')
ax2.set_ylabel('wavelength in nm')
ax1.set_ylabel('raman shift in 1/cm')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment