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

Misalignments of elliptical mirror #2952

Open
bnash opened this issue Sep 15, 2020 · 4 comments
Open

Misalignments of elliptical mirror #2952

bnash opened this issue Sep 15, 2020 · 4 comments
Labels

Comments

@bnash
Copy link
Contributor

bnash commented Sep 15, 2020

I am working with misalignments and rotations of mirrors and I find something confusing regarding misaligning an elliptical mirror. My simulation for a KB mirror system is here:
https://www.sirepo.com/srw#/beamline/PmyIQM72
The first mirror M1 is horizontally focusing and the second mirror M2 is vertically focusing.
Consider M2. I expect that horizontally misaligning M2 will produce a horizontal offset at the watch-point, and indeed it does.
See the first image below for the result of misaligning by 50microns.
However, I do not expect a vertical misalignment of M2 to create a vertical offset, since it is a cynlindrical mirror. Removing one mirror at a time confirms that the first focuses horizontally and the second vertically.
Adding a 50micron vertical misalignment to M2 does create a vertical offset as seen in the second attached image.
I created a similar simulation in Shadow and confirmed that only one direction of misalignment would produce offsets.
Am I thinking about this wrong, or is this a bug?
We found this issue by running python scripts with our machine learning calculations, so I don't think it's just Sirepo. But I'm confused and a suggestion or bug fix would be appreciated.

Intensity-Watchpoint-37-5m
Intensity-Watchpoint-37-5m-1

@bnash
Copy link
Contributor Author

bnash commented Sep 15, 2020

Also, note that the elliptical mirror is set to horizontal or vertical focusing by changing the normal vector. In the first mirror, "auto-compute vector" is set to "horizontal" whereas in the second mirror, it is set to "vertical". "Orientation of reflection plane" is set to "horizontal" in both cases. I tried to set up the mirrors by using the same normal vector and switching "Orientation of reflection plane" to vertical for the second mirror, but this didn't seem to give the expected results with the correct focus in both planes at 37.5 m.

@moellep
Copy link
Member

moellep commented Sep 15, 2020

One thing I know is the "Orientation of reflection plane" only affects the separate srwl_opt_setup_surf_height_2d() call (which is turned off unless the file is given to the height profile. It doesn't affect the SRWLOptMirEl() which is generated separately. So setting that value will have no effect.

I don't know if it is helpful, but the WPG software creates the SRWLOptMirEl() with roll and yaw errors:

https://github.com/samoylv/WPG/blob/develop/wpg/optical_elements.py#L329

For roll, it adjusts the _nvy (horizontal mirror) or _nvx (vertical mirror) value to rotate the results. The yaw value affects the _x (horizontal mirror) or _y (vertical mirror) multiplied by some value "distance" which isn't document. WPG doesn't allow giving an error to the tilt: _tvy (horizontal mirror) or _tvx (vertical mirror) is always set to 0.

@bnash
Copy link
Contributor Author

bnash commented Sep 16, 2020

Thanks, @moellep. This WPG reference looks like it will be useful to understand the mirror rotations. I've been implementing rotations by applying a rotation matrix to the (_nvx,_nvy,_nvz) normal vector.

However, I don't see any misalignments in Mirror_elliptical (unless yaw is non-zero, as you say).

Can you comment on this misalignment issue, @ochubar ?

@bnash
Copy link
Contributor Author

bnash commented Sep 16, 2020

I see this potentially related issue, but it's written in Russian...
samoylv/WPG#123
(google translate tells me:
for a real angle of incidence on an elliptical mirror other than design angle, the image should be projected onto the screen perpendicular to the real and not ideal optical axis)
So, maybe important, but not exactly the same issue.

@robnagler robnagler changed the title SRW: Misalignments of elliptical mirror Misalignments of elliptical mirror Feb 22, 2022
@robnagler robnagler added the srw label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants