diffpy / diffpy.srreal Goto Github PK
View Code? Open in Web Editor NEWPython library for PDF calculation and assortment of real-space utilities.
License: Other
Python library for PDF calculation and assortment of real-space utilities.
License: Other
Required to support OPTIMIZED evaluation in Python-defined PairQuantity calculators.
update once we have the BNL-compatible license.
The following stanzas crash
ni=loadStructure('Ni.stru')
ni.occupancy = 1
createStructureAdapter(ni)
from diffpy.srreal.structureadapter import Atom
aa = Atom()
aa.occupancy = numpy.int64(1)
Design function for evaluating favg, favg**2, favg(Q) from StructureAdapter and ScatteringFactorTable. Useful for PDF conversion and for evaluation of content fractions from PDF scale ratios.
Also replace its call in srfit.
__version__
data in diffpy.srrealThis stanza gives much different PDF values although they should not depend on r-sampling. Find out what is going wrong with qmax cutoff and/or rstep interpolation.
pc = PDFCalculator(qmax=11, rstep=0.01)
ni = loadStructure('nickel.cif')
r0, g0 = pc(ni, rstep=0.01, qmax=11)
r1, g1 = pc(ni, rstep=numpy.pi / 11, qmax=11)
Write draft function that recovers a json-like configuration of calculator objects.
I was trying the parallel PDF calculator from the parallelPDF.py
included in example directory. The parallelizing was successful but the result from parallel calculator seems to be the different from single-pass one.
I only edited the plotting part of parallelPDF.py
as following so it shows the legend:
....
plot(r0, g0, label='single')
plot(r1, g1, label='parallel')
plot(r0, gd - 3, label='diff')
plt.legend()
show()
and the result obtained is:
package info:
diffpy-cmi 2.0.2 0 diffpy
diffpy.pdffit2 1.1 py27_0 diffpy
diffpy.srfit 1.2 py27_0 diffpy
diffpy.srreal 1.1.3 py27_0 diffpy
diffpy.structure 1.3.4 py27_0 diffpy
diffpy.utils 1.2.1 py27_0 diffpy
Any thought? Thanks :)
Hi @pavoljuhas @sbillinge @st3107,
When I generate PDF using diffpy.srreal.pdfcalculator.PDFCalculator with parameters as following:
rmin = 1.5
rmax = 30
rstep = np.pi / 23.0
qmin = 0.5
qmax = 23
qdamp = 0.04
qbroad = 0.01
adp = 0.008
Then for any structure loaded from CIF, the PDFs generated for this structure are identical for any qmax>23. I have included an example code for your convenience. If you change qmax for some number larger than 23 and use the same cif file, then you will find the output g's are the same.
from diffpy.structure import Structure, loadStructure
from diffpy.srreal.pdfcalculator import PDFCalculator
s = loadStructure(cif_dir)
s.Uisoequiv = 0.008
cfg = {'qmax': 23, 'qmin': 0.5, 'rmin': 1.5, 'rmax': 30, 'rstep': np.pi / 23.0, 'qdamp': 0.04, 'qbroad': 0.01}
pc = PDFCalculator(**cfg)
r, g = pc(s)
Thank you,
Ling
diffpy.srreal master is the default while dependency libdiffpy has develop as the default branch... and it's incompatible.
getEquivalentAtoms()
raises
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<diffpy::srreal::AtomicStructureAdapter>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.