コード例 #1
0
ファイル: plot_A0_ang_bdimer.py プロジェクト: mehese/scripts
        for nb in nbs:
            print '    ', nb
            vec = np.array([nb.at.x, nb.at.y, nb.at.z]) - np.array([at_x.x, at_x.y, at_x.z])
            #print vec, ln.norm(vec)
            vecs.append(vec)
        
        val = []
        for i, j in (0,1), (1,2), (0,2):
            #print vecs[i], vecs[j]
            angle = np.degrees(np.arccos( np.dot(vecs[i], vecs[j])  / (ln.norm(vecs[i]) * ln.norm(vecs[j]))) )
            val.append( angle)
            print '   angle = ', angle
        
        val = sum(val)/3.
        angs.append(val)
        A0 = get_A0(bdimer, c)
        As.append(fabs(A0))


plt.scatter(angs, As, edgecolor='0.1', linewidths=2, s=250, facecolor='none')

plt.gca().xaxis.set_minor_locator(MultipleLocator(5))
plt.gca().yaxis.set_tick_params(which='major', length=10, width=2)

plt.gca().xaxis.set_tick_params(which='major', length=10, width=2, labelsize=15)
plt.gca().xaxis.set_tick_params(which='minor', length=5, width=2, labelsize=15)

#plt.gca().tick_params(width=2, labelsize=15)
for tick in plt.gca().xaxis.get_major_ticks()+plt.gca().yaxis.get_major_ticks():
    tick.label1.set_fontweight('bold')
for x in ['top', 'bottom', 'left', 'right']:
コード例 #2
0
ファイル: plot_A0_corr_dimer.py プロジェクト: mehese/scripts
for c, dimers in dimer_dict.items():
    s = ReadStruct('../crystal_files/INPUT_'+c) 
    for dimer in dimers:
        #at_x = s.atoms[dimer-1]

        nbs = neighbours_from_file(dimer, c)
        print c, dimer, len([n  for n in nbs if (n.length < 2.5 and n.atom_type=='Si')])
        nb2 = [n.length  for n in nbs if (n.length < 2.5 and n.atom_type=='Si')]
        print nb2
        #d = sum(nb2)/len(nb2)
        d = max(nb2)
        Ds.append(d)
        for nb in nbs:
            print '    ', nb.atom_type, nb.length

        A0 = get_A0(dimer, c)
        As.append(fabs(A0))
    
        #epr ,= plt.plot(fabs(A0), 0.5, 'yo', markersize=12, label="$E'$")

print Ds, As
plt.scatter(Ds, As, edgecolor='0.1', linewidths=2, s=250, facecolor='none')

plt.gca().xaxis.set_minor_locator(MultipleLocator(5))
plt.gca().yaxis.set_tick_params(which='major', length=10, width=2)

plt.gca().xaxis.set_tick_params(which='major', length=10, width=2, labelsize=15)
plt.gca().xaxis.set_tick_params(which='minor', length=5, width=2, labelsize=15)

#plt.gca().tick_params(width=2, labelsize=15)
for tick in plt.gca().xaxis.get_major_ticks()+plt.gca().yaxis.get_major_ticks():
コード例 #3
0
ファイル: plot_A0_corr_epr.py プロジェクト: mehese/scripts
print 'Eprimes'
Ds, As = [], []
for c, eprimes in eprime_dict.items():
    s = ReadStruct('../crystal_files/INPUT_'+c) 
    for eprime in eprimes:
        at_x = s.atoms[eprime-1]


        nbs = neighbours_from_file(eprime, c)
        print c, eprime
        Ds.append((nbs[0].length + nbs[1].length + nbs[2].length)/3)
        for nb in nbs:
            print '    ', nb.atom_type, nb.length

        A0 = get_A0(eprime, c)
        As.append(fabs(A0))
    
        #epr ,= plt.plot(fabs(A0), 0.5, 'yo', markersize=12, label="$E'$")

plt.scatter(Ds, As, edgecolor='0.1', linewidths=2, s=100, facecolor='none')

plt.gca().xaxis.set_minor_locator(MultipleLocator(5))
plt.gca().yaxis.set_tick_params(which='major', length=10, width=2)

plt.gca().xaxis.set_tick_params(which='major', length=10, width=2, labelsize=15)
plt.gca().xaxis.set_tick_params(which='minor', length=5, width=2, labelsize=15)

#plt.gca().tick_params(width=2, labelsize=15)
for tick in plt.gca().xaxis.get_major_ticks()+plt.gca().yaxis.get_major_ticks():
    tick.label1.set_fontweight('bold')
コード例 #4
0
ファイル: plot_spin_momentum.py プロジェクト: mehese/scripts
               'c4': [65, 119],
               'c5': [82, 102],
               'c6': [66, 101, 119],
               'c2ox': [72],
               'c3ox': [65],
               'c5ox': [65],
              }

print 'Eprimes'
for c, eprimes in eprime_dict.items():
    print c 
    for eprime in eprimes:
        print '\t', eprime,
        s_m = get_spin_mom(eprime, c)
        #print '(s = ', s_m,
        A0 = get_A0(eprime, c)
        #print 'A ', A0, ')'

        epr ,= plt.plot(s_m, 0.5, 'g.', label="$E'$")

print 'Dimers'
for c, dimers in dimer_dict.items():
    print c 
    for dimer in dimers:
        print '\t', dimer,
        s_m = get_spin_mom(dimer, c)
        #print '(s = ', s_m,
        A0 = get_A0(dimer, c)
        #print 'A ', A0, ')'

        dim_,= plt.plot(s_m, 0.0, 'b.', label="dimer")
コード例 #5
0
ファイル: A0_Hf_hfo2si.py プロジェクト: mehese/scripts
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator

c1 = ReadStruct('../crystal_files/INPUT_hfo2si_c1')
c1ox = ReadStruct('../crystal_files/INPUT_hfo2si_c1ox')
c2ox = ReadStruct('../crystal_files/INPUT_hfo2si_c2ox')
c3ox = ReadStruct('../crystal_files/INPUT_hfo2si_c3ox')

pos_graph = {'Hf':0.5, 'Si':-0.5, 'O':0.}
scatter = {'Hf':[], 'O':[], 'Si':[]}

x, y = [], []

print 'cell 1'
for no, at in enumerate(c1.atoms):
    A0 = get_A0(no+1, 'hfo2si_c1')
    if math.fabs(A0) > 10:
        print no+1, at, A0
    y.append(pos_graph[at.species])
    scatter[at.species].append(A0)
    x.append(A0)

print 'cell 1 ox'
for no, at in enumerate(c1ox.atoms):
    A0 = get_A0(no+1, 'hfo2si_c1ox')
    if math.fabs(A0) > 10:
        print no+1, at, A0
    y.append(pos_graph[at.species])
    scatter[at.species].append(A0)
    x.append(A0)