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
83 stars 30 forks source link

Bragg magnifier #70

Open gx4419 opened 3 years ago

gx4419 commented 3 years ago

Dear developers,

I would like to simulate a system of two Bragg-reflecting crystals, that broadens the original beam. Two crystals are located like in the DCM, but have different (positive) asymmetry angle: first crystal has larger asymmetry, and the reflected beam becomes broader, and the second crystal - with little asymmetry - returns the beam to its initial direction. Hence, by setting the asymmetry and 'pitch' angles, one can choose the width of the beam on the exit of this 'beam magnifier' system. I tried to use two 'Plate' elements to simulate these two crystals (first Plate is turned 3.14 rad in 'roll', second Plate stays in its initial position - 0 rad in 'roll'). But I never could make the rays reflect from the first Plate and go towards the second Plate (I also used Glow to observe the system). Another way would be to create the DCM object with appropriately set 'cryst2pitch' parameter. But the DCM has only one 'alpha' parameter, which seems to be applied to both of its crystals - and it means, that it is impossible to build my system like that, as I need the two crystals to have different asymmetry..

Could you please give me an advice - how should such double crystal system be implemented?

Untitled

kklmn commented 3 years ago

Hi,

But I never could make the rays reflect from the first Plate and go towards the second Plate (I also used Glow to observe the system)

The picture shows that the rays do reflect from both surfaces. Please explain.

Plate is designed for the transmitted beam that will refract at both surfaces. Use a plain vanilla OE and its reflect() method.

gx4419 commented 3 years ago

Oh yes, it is a DCM on the picture. The story when the rays didn't go to the second Plate was about the scheme with two separate plates.

The DCM is quite close to the device which I want, but I would need to play with asymmetry angles and Pitch angles of two crystals separately.. Is there no way to set different asymmetries to the crystals of a DCM?

kklmn commented 3 years ago

Is there no way to set different asymmetries to the crystals of a DCM?

No. Then use two crystals (OE's) separately. The only small convenience of DCM is its slightly simpler alignment. With two separate optics, you have to think which one gets a roll of π and what is the correct sign of pitch. Glow can help you to see the local coordinate axes and decide on the signs.