Two-phase refinement with aperiodic structures from .xyz files

56 views
Skip to first unread message

Dimitry Grebenyuk

unread,
Dec 26, 2022, 10:49:14 AM12/26/22
to diffpy-users
Dear all,

I am trying to set up a two-phase refinement of my PDF data using two aperiodic structures from .xyz files. I tried adopting the crystalpdftwophase.py example from GitHub which worked well for me in case of periodic structures from .cif files. 

This time, I encountered a problem. Usually, for aperiodic structure, I woud use 

cdsePDF = PDFContribution("CdSe")
cdsePDF.loadData(dataFile)
cdseStructure = loadStructure(structureFile)
cdsePDF.addStructure("CdSe", cdseStructure, periodic=False)
cdseFit = FitRecipe()
cdseFit.addContribution(cdsePDF)

to set up the refinement. However, the example script crystalpdftwophase.py uses .setStructure() method of PDFGenerator() object instead of .addStructure() method of PDFContribution() object. Trying to simply replace one for another gives TypeError: Unadaptable structure format. 

I would very much appreciate if anyone could give me a hint on how to use .xyz models for a two-phase refinement.

Thanks,
Dimitry


Mikkel Juelsholt

unread,
Dec 26, 2022, 1:34:30 PM12/26/22
to diffpy-users
Hi Dimitry

I have attached a script here that does a 2 phase refinement with XYZ files. 

I hope that should solve your problems!

Cheers Mikkel

2x_Cluster.ipynb

Dimitry Grebenyuk

unread,
Dec 27, 2022, 9:25:29 AM12/27/22
to diffpy-users
Hi Mikkel,

Your script works perfectly for me. Thanks a lot!


Best,
Dimitry

Reply all
Reply to author
Forward
0 new messages