Code Monkey home page Code Monkey logo

diffpy.srreal's People

Contributors

cfarrow avatar pavoljuhas avatar xiaohaoyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diffpy.srreal's Issues

Atom attributes crash when assigned numpy.int64

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)

support evaluation of average scattering factors

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.

add micro field to libdiffpy_version_info

  • require sufficient version of libdiffpy library
  • convert libdiffpy_version_info to named tuple as in pyobjcryst
  • split version.py into a Python only part that does not import srreal_ext. Use for __version__ data in diffpy.srreal

increased PDFCalculator.rstep gives very different PDF

This 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)

Parallel calculator example doesn't yield consistent result as single calculator

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:

srreal_parallel_cal_error

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 :)

Identical PDF outputs with large Qmax

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.