GithubHelp home page GithubHelp logo

Comments (2)

wholden avatar wholden commented on May 22, 2024

I have since understood that perhaps the intended method of controlling this is by setting the [powder.emission] setting in the xrayutilities.conf file.

I can use it that way, but it seems like the 'en' kwarg was getting passed through and should have worked, and also having the ability to control it through kwargs permits easy comparison of patterns at different incident energies. I'm also slightly confused since now I see that manually changing the pm.pdiff[0].energy=10000 doesn't affect the pm.pdiff[0].settings attribute, which still contains the value from the conf file. Not sure what to make of that.

from xrayutilities.

dkriegner avatar dkriegner commented on May 22, 2024

@wholden: this is indeed a bug/inconvenience in the latest release which was since then fixed. Please look at issue #42 which shows how it can be done and should also work for PowderModel when you use the newest GIT version. I will make an release in the next weeks which will contain this and lots of more improvements

Using the latest GIT code the output for your example is:
`In [13]: import numpy
...: import xrayutilities as xu
...: tt = numpy.arange(5, 120, 0.01)
...: Fe_powder = xu.simpack.Powder(xu.materials.Fe, 1,
...: crystallite_size_gauss=100e-9)
...: Co_powder = xu.simpack.Powder(xu.materials.Co, 5, # 5 times more Co
...: crystallite_size_gauss=200e-9)
...: pm = xu.simpack.PowderModel(Fe_powder, Co_powder, I0=100)
...: inte = pm.simulate(tt)
...:

In [14]: pm = xu.simpack.PowderModel(Fe_powder, Co_powder, I0=100, en=10000)

In [15]: pm.pdiff[0].energy
Out[15]: 10000.000000000002
`

from xrayutilities.

Related Issues (20)

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.