Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculating crystal reflectivity without constructing a beamline #181

Open
zhangyujun08 opened this issue Jun 24, 2024 · 7 comments
Open

Comments

@zhangyujun08
Copy link

I hope to calculate energy spectra of multi-bounce monochromators with xrt. Since I only care about the spectrum and do not need real space information, I am trying to calculate without constructing a beamline. I tried racing.materials.crystal.get_amplitude and it worked well. When I input the array of incident angle, it returns the array of reflectivity. But one problem I encounter is that this function does not allow me to define an angle of asymmetry (alpha) for the crystal. I found in the documentation that there is a get_amplitude_pytte function, which allows to do this, but when I define alpha, the output seems to be always exactly the same as alpha=0, no matter how I change the alpha. Could you please provide some solutions? Thanks a lot!

@kklmn
Copy link
Owner

kklmn commented Jun 24, 2024

On the documentation page Tests for Materials one can see reflectivity curves for various asymmetry angles (alphas). The script that makes these curves is tests/raycing/test_materials.py. Look for compare_rocking_curves() in it for flat crystals and compare_rocking_curves_bent() for bent ones.

@zhangyujun08
Copy link
Author

zhangyujun08 commented Jun 25, 2024 via email

@zhangyujun08
Copy link
Author

Another related question.
Now I understand that by using get_amplitude(E, beamInDotNormal, beamOutDotNormal, beamInDotHNormal), reflectivity can be calculated for asymmetrically cut crystals. However, here beamInDotNormal, beamOutDotNormal, and beamInDotHNormal all correspond to the angles within the crystal. Is there any way to calculate the angles outside the crystal (the angle of incidence and emergence)?
Thank you very much!

@kklmn
Copy link
Owner

kklmn commented Jun 26, 2024

beamInDotNormal is cosine of the angle of incidence counted from the normal. Subtract it from π/2 to have it relative to the surface.

The emergence direction for a general asymmetric case is given by the grating equation as explained in the docs with a reference to Sánchez del Río and Cerrina.

@zhangyujun08
Copy link
Author

Thanks for your instruction.
So does it mean that I need to implement these following formula into the code by myself? Or is there an easier way to do it?
1719481123270

@kklmn
Copy link
Owner

kklmn commented Jun 27, 2024

I thought you didn't want any optical element, did you? The method reflect() does the job: it finds a new propagation direction for each ray and applies material reflectivity/transmittivity. As you don't want it, you need to implement these formulas yourself.

@zhangyujun08
Copy link
Author

zhangyujun08 commented Jun 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants