Comments (8)
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.
Thanks a lot.
from xrt.
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).
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.
Could it be the problem in incorrectly defined parameters in crystalHarmonics class or parameters in OE class?
Thank you in advance.
from xrt.
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.
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.
After that, I added 002 and 004 reflections in order to compare with the experiment.
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.
I forgot to mention that an X-ray tube is a source in the experiment.
from xrt.
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.
Ok, now I see. Thank you very much for your help!
from xrt.
Related Issues (20)
- New to xrt, don't see 3D glasses for starting xrtGlow HOT 5
- Simple geometrical source beam propagation monitoring HOT 10
- Working with fixed seed in XRayTracer HOT 2
- run python script created in xrtQook, get different result in Pycharm HOT 2
- image projection profile plot in xrt.plotter HOT 2
- Mosaic crystal in Laue geometry HOT 3
- Johannson focus beam plot HOT 3
- Modified zoneplate HOT 4
- Non-parallel rays for source broadening HOT 14
- numpy.long(): gives error with numpy>=1.24 (Expired deprecation) HOT 2
- Class bendingMagnet01 not initialized HOT 3
- xrtGlowScreen OE Surface bug HOT 16
- xrtGlow Help - drawtype issue? HOT 1
- No graphs in tutorial HOT 3
- X-ray diffraction ray tracing from mosaic crystals HOT 1
- Surface roughness on full-cylinder curved crystal HOT 4
- Coordinate system in examples\withRaycing\06_AnalyzerBent1D example HOT 2
- Mosaic diffraction line widths
- A bug with aperture exception handling block HOT 12
- plotter color change
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xrt.