xrt icon indicating copy to clipboard operation
xrt copied to clipboard

Possible error in CRL calculation

Open bjkoz opened this issue 3 years ago • 6 comments

Hello, I was working with mis-aligned CRLs and I think I came across a problem. It looks like the rotation of the second surface is mirrored compared to the expected direction. I plotted the case where I added an extraPitch (in addition to the Pi/2), which shows the two lens curved surfaces pitched in opposite directions. I then made a case where I adjust the pitch to 1.67 R, which shows the correct orientation of the curved surfaces, but it looks like the centers are not correctly displaced relative to the center of the lens. The two lens surfaces are not behaving as though they are rotating as a single rigid body.

The net result is that if it pitch the geometric source by an angle, move the lenses to that new line and pitch them as well, I end up with aberrations that should not be present because the lenses should be aligned to the pitched beam.

ExtraPitch = 0.3 radians case CRLWithExtraPitch

ExtraPitch = 0, pitch = 1.67 radians CRLWithPitch=1 67

Here's a test of a ParabolicFlat lens with extra pitch. The entrance and exit surfaces are pitched in different directions. SingleFlatLens_ExtraPitch=0 3

Finally, if I flip the ParabolicFlat lens by -Pi/2, so that the flat surface is intersected first, it doesn't not let the rays through the optic.

Thanks as always, Bernie

bjkoz avatar May 22 '21 20:05 bjkoz

Hi, I've now done the same: source pitch = 0.3, lens center = [0, 25000, auto], lens pitch = np.pi/2+0.3. And I get this view that looks as expected: The exported xml file: _lens1.zip

Please try it with your xrt version and with the current GitHub version.

kklmn avatar May 23 '21 15:05 kklmn

_lens_1_Yaw.zip Thanks. That's interesting, when I run your script I get a similar plot. I am using the 1.3.5 version. I noticed that I had not set the lens size limits, and also do not have it auto locate the position. I attached the script here.

If I change your example to use extraPitch, I do get the same pointing error as in the first example image. Similarly, if I add a Yaw error to your example, the result looks like the two sides are rotated differently. LensTest.zip

bjkoz avatar May 23 '21 20:05 bjkoz

Similarly, if I add a Yaw error to your example, the result looks like the two sides are rotated differently.

Yes, this I can see. Thank you for reporting on it!

kklmn avatar May 24 '21 13:05 kklmn

Hi, Before I push it to GitHub, I need more tests. Please replace oes_base.py (but keep the old one for a while) with this one and apply your rotations. oes_base.zip

kklmn avatar May 25 '21 22:05 kklmn

I was able to perform some testing today. The case with adding a Yaw to the lens and beam looks good (_lens1_Yaw_02.xml). Changing to extraYaw is still broken though (_lens1_Yaw_03.xml).

Also, I noticed that when the position of the lens and screen is set to auto, there is an error generated in auto_alignment, it doesn't find the correct position for the screen. LensTest02.zip

Thanks.

bjkoz avatar Jun 02 '21 15:06 bjkoz

Hi, thanks for the tests!

Yes, indeed, extra rotations (those after the 3 main rotations) have never been correctly implemented for two-surface optics (also including DCM). Now I've fixed this and your test cases look correct. Please again replace this module: oes_base.zip

I tried auto positioning for 'x' (the first item in the 'center' list) and I cannot make it fail. Maybe it has to do with the corrections I've made but maybe this example is too simple for this. If you have a reproducible example, please send it.

kklmn avatar Jun 03 '21 13:06 kklmn