Comments (11)
Hi,
As I understand you want a lateral grading, not depth grading, so don't mix them. In your implementation, even for one ray the thickness variation is averaged out as it propagates through the layers. Then also many rays are averaged over the footprint.
I would go in a more deterministic way. For example, make the 4 quadrants different in t and b thickness (but not vary with depth) and see the results. A linear gradient is may be a next trial.
If you don't see any change, please send me your script.
from xrt.
I've tried to follow where get_t_thickness is used in the Multilayer class. I've realized that it only appears in get_amplitude but there I'm not able to use is since "if ucl is None" gives False. What is ucl and how do I change it to None?
from xrt.
you don't need to modify get_amplitude. You only need to specify get_t_thickness
and get_b_thickness
accordingly to your lateral grading. If you need some user parameters that you pass to your formulas, you also need to modify __init__
.
from xrt.
Following your advice I've split the Multilayer into 4 segments each with different t and b thickness. It's now clear that this works, I get steps in reflectivity as a function of beam height. Thanks for your suggestion. This however only works if I do not use targetOpenCL=r"auto" for my OE.
from xrt.
Hi, could you clarify what happens if you do calculate the ML amplitudes with OpenCL?
from xrt.
Then get_t_thickness or get_b_thickness are never called in the get_amplitude function of the Multilayer class. This mean there is no lateral grading.
from xrt.
Oh, I see what you mean now, I thought it stops with errors. Now there's no way to expose custom user functions to OpenCL, but if you are interested it's not hard to implement.
from xrt.
It would be great if you could implement that.
from xrt.
I hope you understand that OpenCL is only for acceleration of reflectivity calculations. And by the way, this acceleration is not as dramatic as for other heavy calculations: undulator source and wave propagation. You can do lateral grading already now, no reason for waiting for custom functions in OpenCL Multilayer. Just remove targetOpenCL
from the constructor options of your optical element and implement your own get_t_thickness
and get_b_thickness
in a Multilayer subclass.
To write these methods in OpenCL (basically C language) is possible, as Roman has said, but one needs these functions in hands. "Implement that" -- what is "that"? Give it. Or you want an automatic translation of python functions to OpenCL? We don't have it.
from xrt.
Wait for it, the plan is to pass the get_t and get_b functions as multiline text varialbe, similar to OpenGL shaders (if you know what this is). I'll explain the rules and give an example.
from xrt.
Ok, but there is no rush. As Konstantin pointed out this already works without OpenCL and the calculations are not that heavy. I simply did not know the scope of this problem.
from xrt.
Related Issues (20)
- Python created from XRTGlow show different results HOT 6
- simulation of VLS HOT 6
- build spherical mirror from elliptical optic HOT 4
- simulation of Hyperboloid mirror HOT 3
- Question about plotting energy spectrum HOT 6
- How to change the screen size or resolution when viewing a small focus image? HOT 2
- problem with xrtBentXtal in Laue geometry HOT 5
- plot error with matplotlib 3.8.2 HOT 6
- ParabolicalMirrorParam optics with figure error HOT 3
- Some doubts about custom faceted lenses HOT 4
- xyz_to_param and param_to_xyz for class ParabolicalMirrorParam HOT 2
- How to simulate nested shells HOT 9
- Problems encountered while running trace examples HOT 5
- Error when run xrtQook on Nvidia V100 GPU node
- How to add a caliber setting!
- Some doubts about the energy setting of X-ray sources HOT 18
- Absorbing wall along the beam propagation direction?
- Help needed! Clarification on the Meaning and Origin of eAxesFlat Values in 07_AnalyzerBent2D.py HOT 2
- Rocking curve theta and energy range converter HOT 3
- Problems generating code from materials HOT 7
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.