On Mon, May 14, 2018 at 01:51:54PM -0700, Robert Koch wrote:
...
> I am doing r-range fits for 36-atom structures. I can plot e.g. the lattice
> parameter, atomic position, or occupancy as a function of fit index easily.
> What I cannot seem to do is dump all the refined structures with a few
> clicks. As far as I can tell, I need to do this fit by fit, and with 6 data
> sets and 20 fits for each, this seems overly cumbersome.
Hi Robert, This is possible with the diffpy.pdfgui.tui module
which has function to load and manipulate PDFgui project file.
See the short examples at
http://www.diffpy.org/doc/pdfgui/index.html#Advanced-post_002dprocessing-of-sequential-refinement
and
https://github.com/diffpy/diffpy.pdfgui/blob/master/doc/tutorial/tui_mno_bond_lengths.py
Assuming `phase` is one of the items in the `project.getPhases()`
list, you can export the refined structure using the
`phase.refined.write(filename, format)` function.
...
> Accessing refined parameter uncertainties in a similar manner, even
> if their absolute value is meaningless, would also be useful, as
> I could propagate these relative values through a tunnel volume
> calculation to give some idea of reliability as a function of
> fitting window.
Unfortunately, there is no Python interface to access parameter
uncertainties. The only workaround is to parse the results
summary text which is in the `res` attribute of each fit object.
Example:
import re
from diffpy.pdfgui import tui
project = tui.LoadProject("SomeProject.ddp")
restext = project.getFits()[0].res
idxuncpairs = re.findall(r'\b(\d+): \S+ [(](\S*\d\S*)[)]', restext)
uncertainties = dict((int(i), float(u)) for i, u in idxuncpairs)
Hope this helps,
Pavol
--
Dr. Pavol Juhas
Computational Science Initiative
Brookhaven National Laboratory
P.O. Box 5000
Upton, NY 11973-5000
tel:
+1-631-344-3594
fax:
+1-631-344-5751