kklmn / xrt

Package xrt (XRayTracer) is a python software library for ray tracing and wave propagation in x-ray regime. It is primarily meant for modeling synchrotron sources, beamlines and beamline elements.
MIT License
84 stars 30 forks source link

Diffuse / Compton scattering #72

Open krediet opened 3 years ago

krediet commented 3 years ago

Good evening,

is there a way implemented / envisioned / possible to simulate diffuse scattering phenomena, where a given incident distribution of rays is (stochastically) scattered into an outgoing distribution? I would be curious to check for some Compton-scattering background, but the issue could likewise apply to thermal diffuse scattering or fluorescence.

Alternatively, is there a way to implement a custom 'source' with arbitrary emission characteristics? Then, I could perform the Compton calculation externally and plug the result back in for propagation to the detector.

Thank you very much in advance.

yxrmz commented 3 years ago

Hi, I started implementing the scattering a while ago, check out the scatter branch. There's an example script as well. Fluorescence calculation works predictably and sums up to the tabulated values, inelastic (Compton) and elastic (Rayleigh) look fine qualitatively, but numbers need to be verified. You are more than welcome to try it. All machinery is inside the oes_base.py OE.scatter() and OE.reflect_local() lines 1038 and 2114

krediet commented 3 years ago

Hello, thank you very much for your reply and pointing me to the scatter-branch. I will experiment with this functionality and let you know, if I encounter problems or arrive at a confirmation of Compton scattering behavior. Best wishes.