Coder Social home page Coder Social logo

Multiple order reflections about xrt HOT 8 OPEN

kklmn avatar kklmn commented on May 26, 2024
Multiple order reflections

from xrt.

Comments (8)

yxrmz avatar yxrmz commented on May 26, 2024

Hi, have a look a the CrystalHarmonics class here. Definition is pretty straightforward, make sure you have pyopencl set up properly.
Same class is used in our of our xrtQook examples, BioXAS_Main.xml, you could try generate the script and play with harmonics.

from xrt.

ts8guest avatar ts8guest commented on May 26, 2024

Thanks a lot.

from xrt.

ts8guest avatar ts8guest commented on May 26, 2024

Dear developers,
We are interested in the calculation of several order reflections from a mosaic crystal in one simulation run.
Initially, we had calculated the first and the second order reflections separately.
We summed results and compared with the experiment. Some misalignment is observed (see figure).
image
The first question is: Is it correct to sum the results of two orders?

Afterward, we installed properly pyopencl, calculared with CrystalHarmonics class (Nmax=2) and also compared with the experiment. Unfortunately, the result is unsatisfactoty.
image
Could it be the problem in incorrectly defined parameters in crystalHarmonics class or parameters in OE class?
Thank you in advance.

from xrt.

kklmn avatar kklmn commented on May 26, 2024

In the present implementation, CrystalHarmonics doesn't work with the mosaic model. We should probably rename it to SingleCrystalHarmonics or PerfectCrystalHarmonics.

Some misalignment is observed (see figure).

What do you mean?

The first question is: Is it correct to sum the results of two orders?

This depends on what and how you do. What are "the results" that you sum? Do you correctly model the polarization properties of your experiment? You may want to attach a script.

from xrt.

ts8guest avatar ts8guest commented on May 26, 2024

Thanks for your reply.
Now, that's clear about CrystalHarmonics.

Conserning the sum of first and secnd order reflections, I have to clarify. I've calculated the first order 002 reflection and the second order 004 reflection of HOPG crystal (please see figure) for the same source, OE and screen position in both cases.
image

After that, I added 002 and 004 reflections in order to compare with the experiment.
image

The souce definition is the next:

    beamLine.geometricSource01 = rsources.GeometricSource(
    bl=beamLine,
    center=[0, 0, 0],
    dx=4,
    dz=4,
    dxprime=Rm/D, #Rm - OE radius; D - source-OE distance
    dzprime=Rm/D,
    distE=r"lines",
    energies=energy,
    energyWeights=weight)

And OE definition:

beamLine.cylinder = Cylinder(
    bl=beamLine,
    center=[0, D, 0],
    Rm=Rm,
    limPhysY=[0, L],
    material=hopg)

from xrt.

ts8guest avatar ts8guest commented on May 26, 2024

I forgot to mention that an X-ray tube is a source in the experiment.

from xrt.

kklmn avatar kklmn commented on May 26, 2024

To me, the calculations beautifully reproduce the experiment, except a slight deviation at the left of the main sharp peak.

Yes, you can sum together the total flux from the two reflections. I would do it with the same beam from the source. Like this:

def run_process(beamLine):
    source = beamLine.source.shine()

    beamOrder1global, beamOrfder1local = beamLine.cylinderOrder1.reflect(source)
    beamOrder2global, beamOrfder2local = beamLine.cylinderOrder2.reflect(source)
    # beamLine.cylinderOrder1 and 2 are OEs that differ by the used material:
    # crystals with different hkl's.
    
    # add components of the intensity matrix (aka coherency matrix):
    beamOrder2global.Jss += beamOrder1global.Jss
    beamOrder2global.Jpp += beamOrder1global.Jpp
    # Jsp = 0 in your case
    # same for the local beams if you use them
    
    # work with beamOrder2global for further propagation

Add to your definition of the source:

    GeometricSource(....    polarization=None, .....)

By default, polarization is horizontal, but your source is unpolarized.

from xrt.

ts8guest avatar ts8guest commented on May 26, 2024

Ok, now I see. Thank you very much for your help!

from xrt.

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.