#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function
import matplotlib.pyplot as plt
from diffpy.Structure import loadStructure
from diffpy.srreal.pdfcalculator import PDFCalculator
from rectangleprofile import RectangleProfile

ni = loadStructure('ni.cif')
# The CIF file had no displacement data so we supply them here:
ni.Uisoequiv = 0.005

# Calculate PDF with default profile function
pc1 = PDFCalculator()
r1, g1 = pc1(ni)
print("standard peakprofile:\n    " + repr(pc1.peakprofile))

# Create new calculator that uses the custom profile function
pc2 = PDFCalculator()
pc2.peakprofile = RectangleProfile()
# Note:  pc2.peakprofile = 'rectangleprofile'
# would do the same, because RectangleProfile class was registered
# under its 'rectangleprofile' identifier.
print("custom peakprofile:\n    " + repr(pc1.peakprofile))
r2, g2 = pc2(ni)

# compare both simulated curves
plt.plot(r1, g1, r2, g2)
plt.draw()
plt.show()

c80479214351dada92b90d33eef5de7eb5d6cf36
<mask token>

<mask token>
print('standard peakprofile:\n    ' + repr(pc1.peakprofile))
<mask token>
print('custom peakprofile:\n    ' + repr(pc1.peakprofile))
<mask token>
plt.plot(r1, g1, r2, g2)
plt.draw()
plt.show()

<mask token>
ni = loadStructure('ni.cif')
ni.Uisoequiv = 0.005
pc1 = PDFCalculator()
r1, g1 = pc1(ni)
print('standard peakprofile:\n    ' + repr(pc1.peakprofile))
pc2 = PDFCalculator()
pc2.peakprofile = RectangleProfile()
print('custom peakprofile:\n    ' + repr(pc1.peakprofile))
r2, g2 = pc2(ni)
plt.plot(r1, g1, r2, g2)
plt.draw()
plt.show()

from __future__ import print_function
import matplotlib.pyplot as plt
from diffpy.Structure import loadStructure
from diffpy.srreal.pdfcalculator import PDFCalculator
from rectangleprofile import RectangleProfile
ni = loadStructure('ni.cif')
ni.Uisoequiv = 0.005
pc1 = PDFCalculator()
r1, g1 = pc1(ni)
print('standard peakprofile:\n    ' + repr(pc1.peakprofile))
pc2 = PDFCalculator()
pc2.peakprofile = RectangleProfile()
print('custom peakprofile:\n    ' + repr(pc1.peakprofile))
r2, g2 = pc2(ni)
plt.plot(r1, g1, r2, g2)
plt.draw()
plt.show()

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function
import matplotlib.pyplot as plt
from diffpy.Structure import loadStructure
from diffpy.srreal.pdfcalculator import PDFCalculator
from rectangleprofile import RectangleProfile

ni = loadStructure('ni.cif')
# The CIF file had no displacement data so we supply them here:
ni.Uisoequiv = 0.005

# Calculate PDF with default profile function
pc1 = PDFCalculator()
r1, g1 = pc1(ni)
print("standard peakprofile:\n    " + repr(pc1.peakprofile))

# Create new calculator that uses the custom profile function
pc2 = PDFCalculator()
pc2.peakprofile = RectangleProfile()
# Note:  pc2.peakprofile = 'rectangleprofile'
# would do the same, because RectangleProfile class was registered
# under its 'rectangleprofile' identifier.
print("custom peakprofile:\n    " + repr(pc1.peakprofile))
r2, g2 = pc2(ni)

# compare both simulated curves
plt.plot(r1, g1, r2, g2)
plt.draw()
plt.show()
