Exemplo n.º 1
0
def iter_bond(x_min, x_max, step=5):
    import numpy as np
    import matplotlib.pyplot as plt
    #from matplotlib.pyplot import plot

    from diffpy.Structure import Structure, Atom, Lattice
    from diffpy.srreal.pdfcalculator import DebyePDFCalculator

    dbc = DebyePDFCalculator()
    dbc.qmax = 20
    dbc.qmin = 0.5
    dbc.rmax = 20
    
    iter_range = np.linspace(x_min, x_max, step)
    fig_dim = len(iter_range)
    
    acs = Atom('Cs', [0, 0, 0])
    acl = Atom('Cl', [0.5, 0.5, 0.5])
    plt.figure()
    for ind, val in enumerate(iter_range):
        cscl = Structure(atoms=[acs, acl],
			lattice=Lattice(val, val, val, 90, 90, 90))
        dbc.setStructure(cscl)
        (r,g) = dbc()
        print(val)
        plt.subplot(fig_dim, 1, ind+1)
        plt.plot(r,g)
        plt.title('bond length = %s' % str(val))
Exemplo n.º 2
0
def dbc_iter(struc_f, iter_range):
    '''change different range'''
    
    import numpy as np
    import matplotlib.pyplot as plt
    from diffpy.srreal.pdfcalculator import DebyePDFCalculator
    from diffpy.Structure import loadStructure
    
    struc = loadStructure(struc_f)
    dbc = DebyePDFCalculator()
    dbc.setStructure(struc)
    dbc.qmax = 20
    dbc.qmin = 0.5
    dbc.rmax = 20
    #par = eval(para)
    #print(dbc.par)
    for step in iter_range:
        (r,g) = dbc(delta2 = step)
        plt.plot(r,g)
Exemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from diffpy.Structure import loadStructure
from diffpy.srreal.pdfcalculator import DebyePDFCalculator
from matplotlib.pyplot import plot, show

c60 = loadStructure('c60.stru')
dpc = DebyePDFCalculator()
dpc.qmax = 20
dpc.rmax = 20
r3, g3 = dpc(c60, qmin=0)
r4, g4 = dpc(c60, qmin=1)

plot(r3, g3, r4, g4)
show()