In [1]:
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
import glob
import sys
Import a list of filenames¶
In [2]:
path = os.getcwd()
path
Out[2]:
'C:\\Users\\Kosuke Sato\\OneDrive - 学校法人トヨタ学園豊田工業大学\\ドキュメント\\research_data\\Aichi-SR'
In [3]:
def import_list_of_filenames(keyword):
l = glob.glob("%s\\*%s*_2.txt"%(path,keyword))
#l.extend(glob.glob("%s\\*%s-??.txt"%(path,keyword)))
return l
In [4]:
def exp_XRD(filename):
df = pd.read_csv(filename,sep="\t",usecols=[0,1])
#print(df)
l_ang = np.array(df.iloc[:,0])
l_int = np.array(df.iloc[:,1])
l_int = np.array([float(d) for d in l_int])
#print(l_int)
#print(min(l_int))
l_int = l_int - min(l_int)
#print(l_int)
k = max(l_int)
l_int = l_int/k
return [l_ang, l_int]
In [5]:
def exp_XRD_raw(filename):
df = pd.read_csv(filename,sep="\t",usecols=[0,1])
#print(df)
l_ang = np.array(df.iloc[:,0])
l_int = np.array(df.iloc[:,1])
l_int = np.array([float(d) for d in l_int])
return l_ang, l_int
In [6]:
def get_ang_int(l):
return [ exp_XRD(c) for i, c in enumerate(l)]
In [7]:
def get_ang_int_raw(l):
l_a, l_i = [], []
for i, c in enumerate(l):
l1, l2 = exp_XRD_raw(c)
#print(len(l2))
l_a.append(l1); l_i.append(l2)
#l_i = np.array(l_i)
return l_a, l_i
In [8]:
def reshape_intensity_array(amin,amax,la,li):
lii = []
for i,lt in enumerate(li):
lll = [v for j, v in enumerate(lt) if la[i][j] > amin-0.0001 and amax-0.0001 > la[i][j]]
#print(len(lll))
lii.append(lll)
return lii
In [9]:
def find_peak_root(l,ran):
l_iamo = []
for i, ll in enumerate(l):
amax = np.argmax(ll[1])
angmax = ll[0][amax]
#print(imax,ll[0][imax],ll[1][imax])
amin = np.argmin(ll[1][amax-ran:amax+ran])
angmin = ll[0][amin+amax-ran]
imin = ll[1][amin+amax-ran]
#print(amax,angmax,amin,angmin,imin)
l_iamo.append(imin)
return l_iamo
In [10]:
# Ag2S0.7Te0.3 No.49 continuous
l49 = import_list_of_filenames("Ag2S0.7Te0.3_No.49")
#print(l49)
l_49 = get_ang_int(l49)
l_49r_a, l_49r_i= get_ang_int_raw(l49)
l_49r_i2 = reshape_intensity_array(8.99,23.01,l_49r_a,l_49r_i)
In [11]:
# Ag2S0.6Te0.4 No.54 continuous
l54 = import_list_of_filenames("Ag2S0.6Te0.4_No.54")
#print(l54)
l_54 = get_ang_int(l54)
l_54r_a, l_54r_i= get_ang_int_raw(l54)
l_54r_i2 = reshape_intensity_array(8.99,23.01,l_54r_a,l_54r_i)
In [12]:
# Ag2S0.5Te0.5 No.50 continuous
l50 = import_list_of_filenames("Ag2S0.5Te0.5_No.50")
#print(l50)
l_50 = get_ang_int(l50)
l_50r_a, l_50r_i= get_ang_int_raw(l50)
l_50r_i2 = reshape_intensity_array(8.99,23.01,l_50r_a,l_50r_i)
In [13]:
# Ag2S0.4Te0.6 No.53 continuous
l53 = import_list_of_filenames("Ag2S0.4Te0.6_No.53")
#print(l53)
l_53 = get_ang_int(l53)
l_53r_a, l_53r_i= get_ang_int_raw(l53)
l_53r_i2 = reshape_intensity_array(8.99,23.01,l_53r_a,l_53r_i)
Reference (Ag2S)¶
In [14]:
l_ag2s_l = exp_XRD("20210827100945-Ag2S_No.1_stoichi-1.txt")
l_ag2s_l
Out[14]:
[array([ 0.1 , 0.11, 0.12, ..., 95.01, 95.02, 95.03]),
array([0. , 0.00029807, 0. , ..., 0.01730043, 0.01492125,
0.01709218])]
In [15]:
l_ag5te3 = exp_XRD("20220628180733-Ag453Te3-1.txt")
l_ag5te3
Out[15]:
[array([8.000e-02, 9.000e-02, 1.000e-01, ..., 9.458e+01, 9.459e+01,
9.460e+01]),
array([0. , 0. , 0. , ..., 0.01522797, 0.01382063,
0.01524719])]
Experimental XRD from structure of ICSD.¶
In [16]:
def xrd_spectra(l_ang,l_int,theta_min,theta_max,dtheta,width):
theta_range = theta_max - theta_min
N = int(theta_range/dtheta)
l_int_sme, l_ang_sme = [], []
for i in range(N):
theta = theta_min + i*dtheta
I_theta = 0.0
for j, intensity in enumerate(l_int):
fact = ((theta-l_ang[j])/width)**2
I_theta += intensity*np.exp(-fact)
l_ang_sme.append(theta)
l_int_sme.append(I_theta)
l_int_sme = l_int_sme/max(l_int_sme)
return l_ang_sme,l_int_sme
In [17]:
def xrd_to_lists(filename):
f = open(filename,"r")
l_ = f.readlines()
f.close()
l_ang, l_int = [], []
for i in range(2,len(l_)):
sp = l_[i].split()
l_ang.append(float(sp[0]))
l_int.append(float(sp[1]))
l_int1 = np.array(l_int)
l_int2 = l_int1/max(l_int1)
l_ang2 = np.array(l_ang)
return [l_ang2, l_int2]
In [18]:
def pks_to_lists(filename):
f = open(filename,"r")
l_ = f.readlines()
f.close()
l_ang, l_int = [], []
for i in range(13,len(l_)):
#print(l_[i])
sp = l_[i].split()
l_ang.append(float(sp[1]))
l_int.append(float(sp[4]))
l_int1 = np.array(l_int)
l_int2 = l_int1/max(l_int1)
l_ang2 = np.array(l_ang)
return l_ang2, l_int2
In [19]:
l_ag = xrd_to_lists("Ag_crystal.gpd")
In [20]:
l_ag2te_l = xrd_to_lists("ag2te_low_temp.gpd")
l_ag2te_l
Out[20]:
[array([ 3.01, 3.02, 3.03, ..., 119.98, 119.99, 120. ]), array([0. , 0. , 0. , ..., 0.001836, 0.001868, 0.001912])]
In [21]:
#l_ang_ag2s_l, l_int_ag2s_l = xrd_to_lists("ag2s_low_temp.int")
In [22]:
l_ag2s_h = xrd_to_lists("ag2s_high_temp_match.gpd")
In [23]:
l_ag2te_l = xrd_to_lists("ag2te_low_temp.gpd")
In [24]:
l_ag2te_h = xrd_to_lists("ag2te_high_temp.gpd")
In [25]:
l_ag3cus2 = xrd_to_lists("ag3cus2.gpd")
In [26]:
l_cu2s_l = xrd_to_lists("cu2s_low_temp.gpd")
In [27]:
l_al2o3 = xrd_to_lists("Al2O3.gpd")
2D mappings for bird's view¶
In [28]:
def XRD_picture_2Dmap(l_temp,l_step,l_i,xmin,xmax,ymin,ymax,zmin,zmax,filename):
plt.clf() # initialization
plt.figure(figsize=(10, 6))
plt.axis([xmin,xmax,ymin,ymax])
plt.tick_params(direction="in")
plt.rcParams["font.family"] = "serif"
plt.rcParams["axes.linewidth"] = 1.5
plt.tick_params(direction="in")
plt.rcParams["xtick.major.size"] = 10
plt.rcParams["xtick.major.width"] = 1.5
plt.rcParams["ytick.major.size"] = 10
plt.rcParams["ytick.major.width"] = 1.5
plt.rcParams["font.size"] = 20
plt.ylabel("Time steps")
plt.xlabel(r"2$\theta$, degree")
plt.contourf(l_temp,l_step,l_i,cmap=plt.cm.binary,vmin=zmin, vmax=zmax)
plt.colorbar(label='Intensity')
plt.savefig(filename,bbox_inches="tight")
plt.show()
In [29]:
l_step = np.arange(len(l_49r_i2))
l_temp, l_step = np.meshgrid(np.arange(9.01,23,0.01), l_step)
#print(len(l_42r_i2[0]),len(l_step[0]))
XRD_picture_2Dmap(l_temp,l_step,l_49r_i2,9,23,0,45,0,400,"XRD_analysis_AichiSR_20221019_Ag2S0.7Te0.3_No.49_up.jpg")
<Figure size 432x288 with 0 Axes>
In [30]:
l_step = np.arange(len(l_54r_i2))
l_temp, l_step = np.meshgrid(np.arange(9.01,23,0.01), l_step)
#print(len(l_42r_i2[0]),len(l_step[0]))
XRD_picture_2Dmap(l_temp,l_step,l_54r_i2,9,23,0,45,0,640,"XRD_analysis_AichiSR_20221109_Ag2S0.6Te0.4_No.54_2Dmap.jpg")
<Figure size 432x288 with 0 Axes>
In [31]:
l_step = np.arange(len(l_50r_i2[:39]))
l_temp, l_step = np.meshgrid(np.arange(9.01,23,0.01), l_step)
#print(len(l_42r_i2[0]),len(l_step[0]))
XRD_picture_2Dmap(l_temp,l_step,l_50r_i2[:39],9,23,0,38,0,640,"XRD_analysis_AichiSR_20221109_Ag2S0.5Te0.5_No.50_2Dmap_heating.jpg")
<Figure size 432x288 with 0 Axes>
In [32]:
l_step = np.arange(len(l_50r_i2[39:]))
l_temp, l_step = np.meshgrid(np.arange(9.01,23,0.01), l_step)
#print(len(l_42r_i2[0]),len(l_step[0]))
XRD_picture_2Dmap(l_temp,l_step,l_50r_i2[39:],9,23,0,18,0,640,"XRD_analysis_AichiSR_20221109_Ag2S0.5Te0.5_No.50_2Dmap_cooling.jpg")
<Figure size 432x288 with 0 Axes>
In [33]:
l_step = np.arange(len(l_53r_i2))
l_temp, l_step = np.meshgrid(np.arange(9.01,23,0.01), l_step)
#print(len(l_42r_i2[0]),len(l_step[0]))
XRD_picture_2Dmap(l_temp,l_step,l_53r_i2,9,23,0,57,0,640,"XRD_analysis_AichiSR_20221109_Ag2S0.4Te0.6_No.53_2Dmap.jpg")
<Figure size 432x288 with 0 Axes>
In [34]:
def XRD_picture_raw(l_ang,l_int,l_colors,l_labs,l_mrks,xmin,xmax,ymax,filename):
plt.clf() # initialization
plt.figure(figsize=(8, 6))
plt.axis([xmin,xmax,0,ymax])
plt.tick_params(direction="in")
plt.rcParams["font.family"] = "times new roman"
plt.rcParams['mathtext.fontset'] = 'cm'
plt.rcParams["axes.linewidth"] = 1.5
plt.tick_params(direction="in")
plt.rcParams["xtick.major.size"] = 10
plt.rcParams["xtick.major.width"] = 1.5
plt.rcParams["ytick.major.size"] = 10
plt.rcParams["ytick.major.width"] = 1.5
plt.rcParams["font.size"] = 30
plt.ylabel("Intensity (arb. unit)")
plt.xlabel(r"2$\theta$ (degrees)")
l_line = ["-","-","-"]
for i in range(len(l_ang)):
#plt.scatter(l_ang[i], l_int[i],color=l_color[i],marker=l_mrks[i],label=l_lab[i])
plt.plot(l_ang[i], l_int[i],color=l_color[i],marker="None",label=l_labs[i],linestyle=l_line[i])
#plt.legend(loc='upper right')
plt.savefig(filename,bbox_inches="tight")
plt.show()
In [35]:
def XRD_picture_shifted(l_,l_colors,l_mrks,xmin,xmax,xfig,yfig,filename):
Nang = len(l_)
plt.clf() # initialization
plt.figure(figsize=(xfig,yfig))
plt.axis([xmin,xmax,-Nang+1,max(l_[0][1])])
plt.tick_params(direction="in")
plt.rcParams["font.family"] = "times new roman"
plt.rcParams['mathtext.fontset'] = 'cm'
plt.rcParams["axes.linewidth"] = 1.5
plt.tick_params(direction="in")
plt.rcParams["xtick.major.size"] = 10
plt.rcParams["xtick.major.width"] = 1.5
plt.rcParams["ytick.major.size"] = 10
plt.rcParams["ytick.major.width"] = 1.5
plt.rcParams["font.size"] = 30
plt.ylabel("Intensity (arb. unit)")
plt.xlabel(r"2$\theta$ (degrees)")
plt.tick_params(labelleft=False)
l_line = ["-","-","-","-","-","-"]
for i in range(len(l_)):
#plt.scatter(l_ang[i], l_int[i],color=l_color[i],marker=l_mrks[i],label=l_lab[i])
plt.hlines([-i],0,100,linestyle="--")
#plt.plot(l_[i][0], l_[i][1]-i,color="black",marker="None",linestyle="-")
plt.plot(l_[i][0], l_[i][1]-i,color=l_color[i],marker="None",linestyle="-")
#plt.legend(loc='upper right')
plt.savefig(filename,bbox_inches="tight")
plt.show()
In [36]:
l_color = ["black","red", "blue","green","cyan","purple","orange","brown","gray","pink"]
l_mrks = ["o","^", "*","d",">","<","o"]
exp XRD comparison¶
No.49 Ag2S0.7Te0.3¶
In [37]:
Nini, Nend = 0,10
l_ = [l_49[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20221109_Ag2S0.7Te0.3_No.49_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [38]:
Nini, Nend = 10,20
l_ = [l_49[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221109_Ag2S0.7Te0.3_No.49_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [39]:
Nini, Nend = 20,30
l_ = [l_49[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221109_Ag2S0.7Te0.3_No.49_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [40]:
Nini, Nend = 30,40
l_ = [l_49[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221109_Ag2S0.7Te0.3_No.49_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [41]:
l_tar = [0,9,10,15,23,30,45]
l_ = [l_49[i] for i in l_tar]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20221109_Ag2S0.7Te0.3_No.49_target.jpg")
<Figure size 432x288 with 0 Axes>
In [42]:
l_tar = [0,10,15,23,30]
l_ = [l_49[i] for i in l_tar]
l_ += [l_ag2s_l,l_ag2s_h,l_ag2te_l]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20221109_Ag2S0.7Te0.3_No.49_characterization.jpg")
<Figure size 432x288 with 0 Axes>
No.54 Ag2S0.6Te0.4¶
In [45]:
l_a = [l_54r_a[i] for i in [0,16,25]]
l_i = [l_54r_i[i] for i in [0,16,25]]
l_color = ["black","red","blue"]
l_lab = ["300 K","458 K","545 K"]
XRD_picture_raw(l_a,l_i,l_color,l_lab,l_mrks,9,23,500,"test.jpg")
<Figure size 432x288 with 0 Axes>
In [46]:
Nini, Nend = 30,-1
l_ = [l_54[i] for i in range(Nini,Nend,-1)]
l_color = ["black"]*len(l_)
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221222_Ag2S0.6Te0.4_No.54_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [47]:
Nini, Nend = 31,46
l_ = [l_54[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221222_Ag2S0.6Te0.4_No.54_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [48]:
l_tar = [25,16,0]
l_ = [l_54[i] for i in l_tar]
l_color = ["black"]*3
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20230309_Ag2S0.6Te0.4_No.54_precipitation.jpg")
<Figure size 432x288 with 0 Axes>
In [49]:
l_tar = [19]
l_ = [l_54[i] for i in l_tar]
l_ += [l_ag2s_l,l_ag2te_l]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20230202_Ag2S0.6Te0.4_No.54.jpg")
<Figure size 432x288 with 0 Axes>
No.50 Ag2S0.5Te0.5¶
In [50]:
Nini, Nend = 37,-1
l_ = [l_50[i] for i in range(Nini,Nend,-1)]
l_color = ["black"]*len(l_)
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221222_Ag2S0.5Te0.5_No.50_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [51]:
Nini, Nend = 38,58
l_ = [l_50[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221223_Ag2S0.5Te0.5_No.50_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [53]:
l_tar = [29]
l_ = [l_50[i] for i in l_tar]
l_color = ["green"]*3
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20221212_Ag2S0.5Te0.5_No.50_heating_cooling.jpg")
<Figure size 432x288 with 0 Axes>
In [54]:
l_a = [l_50r_a[i] for i in [0,19,27]]
l_i = [l_50r_i[i] for i in [0,19,27]]
l_color = ["black","red","blue"]
l_lab = ["300 K","477 K","566 K"]
XRD_picture_raw(l_a,l_i,l_color,l_lab,l_mrks,9,23,500,"test.jpg")
<Figure size 432x288 with 0 Axes>
In [55]:
l_tar = [27,19,0]
l_ = [l_50[i] for i in l_tar]
l_color = ["black"]*3
#l_ += [l_ag2s_l,l_ag2s_h,l_ag2te_l,l_ag5te3]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20230309_Ag2S0.5Te0.5_No.50_precipitation.jpg")
<Figure size 432x288 with 0 Axes>
In [57]:
l_tar = [23]
l_ = [l_50[i] for i in l_tar]
l_ += [l_ag2s_l,l_ag2te_l]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20230202_Ag2S0.5Te0.5_No.50_o23.jpg")
<Figure size 432x288 with 0 Axes>
No.53 Ag2S0.4Te0.6¶
In [59]:
Nini, Nend = 37,-1
l_ = [l_53[i] for i in range(Nini,Nend,-1)]
l_color = ["black"]*len(l_)
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221223_Ag2S0.4Te0.6_No.53_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [60]:
Nini, Nend = 38,58
l_ = [l_53[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,16,"XRD_analysis_AichiSR_20221223_Ag2S0.4Te0.6_No.53_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [61]:
Nini, Nend = 20,30
l_ = [l_53[i] for i in range(Nini,Nend)]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20221109_Ag2S0.4Te0.6_No.53_step%i-%i.jpg"%(Nini,Nend))
<Figure size 432x288 with 0 Axes>
In [67]:
l_tar = [0,5,10,14,15,18,29]
l_ = [l_53[i] for i in l_tar]
l_color = ["black"]*len(l_tar)
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20230309_Ag2S0.4Te0.6_No.53_precipitation.jpg")
<Figure size 432x288 with 0 Axes>
In [73]:
l_tar = [25]
l_ = [l_53[i] for i in l_tar]
l_ += [l_ag2s_l,l_ag2te_l]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,"XRD_analysis_AichiSR_20230201_Ag2S0.4Te0.6_No.53_LTP.jpg")
<Figure size 432x288 with 0 Axes>
In [74]:
l_tar = [38,43,48,53,57]
l_ = [l_53[i] for i in l_tar]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,"XRD_analysis_AichiSR_20221212_Ag2S0.4Te0.6_No.53_cooling.jpg")
<Figure size 432x288 with 0 Axes>
In [46]:
l_tar = [29,19,0]
l_ = [l_53[i] for i in l_tar]
l_color = ["black"]*len(l_tar)
XRD_picture_shifted(l_,l_color,l_mrks,9,23,8,6,"XRD_analysis_AichiSR_20221109_Ag2S0.4Te0.6_No.53_heating_cooling.jpg")
<Figure size 432x288 with 0 Axes>
In [45]:
l_a = [l_53r_a[i] for i in [0,19,29]]
l_i = [l_53r_i[i] for i in [0,19,29]]
l_color = ["black","red","blue"]
l_lab = ["300 K","477 K","587 K"]
XRD_picture_raw(l_a,l_i,l_color,l_lab,l_mrks,9,23,500,"test.jpg")
<Figure size 432x288 with 0 Axes>
In [76]:
l_tar = [37, 52,-1]
l_ = [l_53[i] for i in l_tar]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,"XRD_analysis_AichiSR_20221215_Ag2S0.4Te0.6_No.53_test.jpg")
<Figure size 432x288 with 0 Axes>
In [77]:
l_tar = [0,27,28,37,56]
l_ = [l_53[i] for i in l_tar]
l_ += [l_ag2s_l,l_ag2s_h,l_ag2te_l,l_ag2te_h,l_ag5te3]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,"XRD_analysis_AichiSR_20221109_Ag2S0.4Te0.6_No.53_characterization.jpg")
<Figure size 432x288 with 0 Axes>
Precipitations analysis¶
In [40]:
l_ = [l_49[-1],l_54[-1],l_50[-1],l_53[-1]]
#l_ += [l_ag2s_l,l_ag2s_h,l_ag2te_l,l_ag2te_h,l_ag5te3]
XRD_picture_shifted(l_,l_color,l_mrks,9,23,"XRD_analysis_AichiSR_20230220_Ag2S1-xTex_x=0.3-0.6_HTP_comparison.jpg")
<Figure size 432x288 with 0 Axes>
In [79]:
l_ = [l_ag2s_l,l_ag2s_h,l_ag2te_l,l_ag2te_h,l_ag5te3]
XRD_picture_shifted(l_,l_color,l_mrks,5,25,"XRD_analysis_AichiSR_20221110_reference_SR.jpg")
<Figure size 432x288 with 0 Axes>
Amorphous intensity¶
read temperature files¶
In [73]:
def read_averaged_temperature(Iini,Nstep,Nskip,fname):
f = open(fname,"r")
l = f.readlines()
f.close()
l_temp = []
for i in range(Nstep):
sp = l[Iini+i*Nskip].split()
l_temp.append(float(sp[-1]))
return np.array(l_temp)
In [74]:
l_t54 = read_averaged_temperature(186,46,4,"DvT_Mean_20221018_DBTemp_104836.txt")
l_t54
Out[74]:
array([ 30. , 40.4, 50. , 59.8, 69.4, 79.1, 88.8, 98.4, 108. ,
117.6, 127.3, 136.9, 146.6, 156. , 165.7, 175.3, 184.9, 194.5,
204.1, 213.8, 223.4, 233. , 242.6, 252.1, 261.9, 272. , 282.4,
292.7, 303.3, 313.6, 318.2, 300.2, 279.3, 259.3, 239.9, 220.7,
201.7, 182.3, 163.1, 144. , 124.7, 105.7, 86.6, 67.6, 48.7,
31.7])
In [75]:
l_t50 = read_averaged_temperature(370,58,4,"DvT_Mean_20221018_DBTemp_104836.txt")
l_t50
Out[75]:
array([ 30.3, 40.3, 50.2, 59.8, 69.4, 79.1, 88.6, 98.4, 108. ,
117.6, 127.3, 136.8, 146.5, 156. , 165.6, 175.1, 185. , 194.5,
204.1, 213.7, 223.4, 233. , 242.5, 252. , 261.9, 271.9, 282.3,
292.8, 303.1, 313.6, 324. , 334.2, 344.9, 355.3, 365.7, 376.1,
386.5, 396.7, 394.5, 373.9, 353.4, 332.6, 311.7, 291. , 270.2,
250.7, 231.4, 211.9, 193.2, 173.8, 154.6, 135.5, 116.2, 97.1,
78.1, 59.1, 40.5, 27.6])
In [76]:
l_t53 = read_averaged_temperature(602,58,4,"DvT_Mean_20221018_DBTemp_104836.txt")
l_t53
Out[76]:
array([ 30.1, 40.3, 50.1, 59.9, 69.4, 79.1, 88.8, 98.3, 108.1,
117.7, 127.3, 136.9, 146.5, 156.1, 165.7, 175.3, 184.8, 194.6,
204.1, 213.8, 223.3, 233. , 242.6, 252.2, 261.8, 271.8, 282.6,
292.8, 303.2, 313.7, 324. , 334.5, 344.8, 355.1, 366. , 376.1,
386.5, 396.8, 394.1, 373.6, 353. , 331.8, 311.7, 290.6, 267.4,
250.3, 231. , 211.7, 192.8, 173.4, 154.3, 135.2, 115.8, 96.8,
77.8, 58.7, 40.2, 27.4])
extract intensity of amorphous phase¶
In [91]:
for i in range(30,46):
li54.append(max(l_54[i][1][400:500]))
li54
Out[91]:
[0.18526994359387589, 0.191152920727144, 0.18062575799320735, 0.17716793674672096, 0.16925114006826067, 0.16816098176385716, 0.16062647115311607, 0.15849645828769268, 0.15278469307916634, 0.15210586198170412, 0.1499456879303725, 0.1421695031803335, 0.14245929657923562, 0.14523504470131876, 0.1429514760160426, 0.14309121807282904]
In [95]:
li50 = []
for i in range(38,58):
li50.append(max(l_50[i][1][400:475]))
li50
Out[95]:
[0.19469088491084396, 0.19699284393342445, 0.1920840774522121, 0.18447086984210642, 0.18516442301788777, 0.17468804791584014, 0.17594638892500006, 0.17327561091300467, 0.17198742876418477, 0.16718514683734942, 0.1597431966186531, 0.15296892482123586, 0.16068516916173523, 0.14750420754484625, 0.1509463725546967, 0.1465478637973001, 0.14016939961948377, 0.1396849033120047, 0.1375679477637065, 0.13878052079106976]
In [98]:
li53 = []
for i in range(38,58):
li53.append(max(l_53[i][1][400:475]))
li53
Out[98]:
[0.23607596726085292, 0.23047708052995683, 0.21090061745514124, 0.20647827286480452, 0.19222917543885126, 0.18682777001875145, 0.18167106535031982, 0.17754545884156747, 0.18657726489820203, 0.17335844013849241, 0.17247849960143186, 0.1672791865735636, 0.1629585909552224, 0.15945209838643254, 0.15941931080429458, 0.16418724470850354, 0.16276715070980868, 0.1621988296446435, 0.16955169825706762, 0.17704264686881935]
In [100]:
def peak_ratio_cry_amo(flag,l_x,l_,xmin,xmax,ymin,ymax,filename):
plt.clf() # initialization
plt.figure(figsize=(8, 6))
plt.axis([xmin,xmax,ymin,ymax])
plt.tick_params(direction="in")
plt.rcParams["font.family"] = "serif"
plt.rcParams["axes.linewidth"] = 1.5
plt.tick_params(direction="in")
plt.rcParams["xtick.major.size"] = 10
plt.rcParams["xtick.major.width"] = 1.5
plt.rcParams["ytick.major.size"] = 10
plt.rcParams["ytick.major.width"] = 1.5
plt.rcParams["font.size"] = 20
plt.ylabel(r"$I_{back}(I_{total})^{-1}$")
xlabel = "Time Steps"
if flag == 1:
xlabel = "Temperature, K"
plt.xlabel(xlabel)
#plt.tick_params(labelleft=False)
plt.plot(l_x, l_,marker="o",linestyle="-")
#plt.legend(loc='upper right')
plt.savefig(filename,bbox_inches="tight")
plt.show()
In [105]:
l_ = np.array(l_t54)+273.15
peak_ratio_cry_amo(1,l_[30:],li54,295,600,0.1,0.2,"XRD_analysis_AichiSR_20221214_peak_ratio_x04.jpg")
<Figure size 432x288 with 0 Axes>
In [107]:
l_ = np.array(l_t50)+273.15
peak_ratio_cry_amo(1,l_[38:],li50,295,600,0.1,0.2,"XRD_analysis_AichiSR_20221214_peak_ratio_x05.jpg")
<Figure size 432x288 with 0 Axes>
In [108]:
l_ = np.array(l_t53)+273.15
peak_ratio_cry_amo(1,l_[38:],li53,295,600,0.1,0.2,"XRD_analysis_AichiSR_20221214_peak_ratio_x06.jpg")
<Figure size 432x288 with 0 Axes>