On the peak broadening of simulated PDF

123 views
Skip to first unread message

Marco Vandone

unread,
Jul 7, 2023, 8:49:51 PM7/7/23
to diffpy-users
Hi
I was working on some PDF data trying to obtain a "simulated" PDF from a .cif file and I obtained a very broad signal.
I was wondering if it is possible to modulate the broadening of the signals with some parameters.
After looking around for some piece of code in some repos in github and here in the forum i found that these parameter of the PDFcalculator

pc = PDFCalculator(rmax=rmax)
pc.delta1 =
pc.delta2 =
pc.qbroad =

act on the broadening of the final PDF by increasing it.
Is it possible to reduce the broadening of the signal with some parameter in the code or it's something strictly related to the cif model used to generate the PDF?
In that case I also played with U of the atoms inside the model not seeing big changes.
I'm pretty new in this field and I'm just trying to understand the effect of the parameters.

Does anyone have any info on this topic? What can I touch to obtain thinner signals?
I'm sorry if I haven't attached any piece of code/structure but it's a more general question this one.
Thanks a lot!

Kenny Marshall

unread,
Aug 28, 2023, 8:44:31 AM8/28/23
to diffpy-users
Hi Marco,
I think the best way is with the Bisoequiv attribute in the structure object. e.g.
cif = 'blablabla.cif'
struc = loadStructure(cif)
struc.Bisoequiv = 0.1

Kenny

Mikkel Juelsholt

unread,
Aug 28, 2023, 8:54:51 PM8/28/23
to diffpy-users
Hi Marco 

Sorry for the slow response

Here is a Diffpy code that should be able to do any PDF calculation you need. The most important broadening parameter is usually the atomic vibrations U or B. PDFgui uses U, while Diffpy can use both. 
You might get in trouble with your input file. I just found an error that PDFgui generated cif-files will not be read properly by Diffpy's loadStructure. That might be what messed with you. I will have to report this to Simon. 

Cheers Mikkel 

from diffpy.Structure import loadStructure
from diffpy.srreal.pdfcalculator import DebyePDFCalculator, PDFCalculator
from matplotlib.pyplot import plot, show
import numpy as np
import matplotlib.pyplot as plt
from diffpy.Structure.atom import Atom
from diffpy.Structure import Structure, Atom, Lattice


#Load in structure to calculate PDF from
structure = loadStructure('Ni.cif' )
#Set the correlated motion parameter. You can also use delta1, but only use one of them!
#They are almost identical, so in practice, which one you use is not important
structure.delta2 = 2.0

# Set the U value of the different atoms below. 0.005 is a good room temperature starting value.


structure[structure.element == 'Ni'].U = 0.005

#structure[structure.element == 'Li'].U = 0.005

#structure[structure.element == 'O'].U = 0.005

#Or we can just set 1 Uiso for all elements
#structure.Uisoequiv = 0.005


#Set the instrumental parameters to something resonable

dpc = PDFCalculator()
dpc.qmin = 0.4
dpc.qmax = 25.0
dpc.rmax = 100
dpc.qdamp = 0.04
dpc.qbroad = 0.001
r, g = dpc(structure)

%matplotlib notebook
plot(r, g)

plt.ylabel('G(r)')
plt.xlabel('r ($\AA$)')

pdf = np.column_stack([r,g])

#np.savetxt('test.cgr', pdf)

Marco Vandone

unread,
Aug 29, 2023, 12:00:46 PM8/29/23
to diffpy-users
Hi
Thank you for the help.
I was trying to modify U parameters directly from the cif files but the generated signals was independent on that ... I'll try to use those commands.
I was also suspecting some problems with the loading of the cif files due to this fact.
For the moment I'll try these suggestions.
Reply all
Reply to author
Forward
0 new messages