oasys-elettra-kit / OASYS1-Wiser

The implementation of WISER into OASYS
MIT License
0 stars 1 forks source link

Issue from Users: Rotations #75

Closed capitanevs closed 2 years ago

capitanevs commented 2 years ago

A user just complained that "rotation", "transverse displacemente" within the displacement tab are no longer working.

We should not have changed them, and for sure they were working (as these people made a paper using these very old-dated features, so I guess they know what are talking about :-)

Can we check that they are properly linked from the GUI for ALL the elements (e.g. source, plane mirror, ellipsoidal mirror, detector)? Lately, we had some "GUI-link" issues, even if they were on new stuff (not old one). I guess.... it could be better to have a look.

At the same time, I will check that everything is ok on the library.

aljosahafner commented 2 years ago

I haven't changed anything at all. If I remember correctly, these were checked just a few months ago and they were working. Can you specify a bit better what is not working, which widget, etc.

capitanevs commented 2 years ago

We still have no all infos, but I guess the problem is on the "plane mirror". so in ow_optical_element.py.

Looking at the code, does it seems all ok to you?

aljosahafner commented 2 years ago

The code for elements seems all ok for me, the question is whether everything works well in the library using setting:

All the optical elements widgets inherit from OWOpticalElement (ow_optical_element.py)

capitanevs commented 2 years ago

Note1:

Design error: while writing "Slits" in LibWiser, the code was re-written from the Mirror Class (instead of using subclassing, inheritance).

Features which are present in Mirror but were not are not in slits

Features of Mirrors which would not make sense into slits, but are not dangerous

immagine

immagine

capitanevs commented 2 years ago

Temporary solution: I just short-linked the twofunctions immagine

capitanevs commented 2 years ago

Error Found in LibWiser (shame on me)

immagine

xLab appears instead of xNew (the same for y)

capitanevs commented 2 years ago

After fixing the previous bug, I see that

immagine

capitanevs commented 2 years ago

The rotation angle affects somehow the computation (even if not as I would like to). If the angle is too high, aliasian occurs

immagine

capitanevs commented 2 years ago

Remember: now we have the two kind of output rays: nominal and real (it is not a problem, but I just point it out for me) immagine

capitanevs commented 2 years ago

In the previous computations I used Rotation angles which were too big: angle * distance = displacement which was much greater than the size of the target element (the slits). Displacement was about 8 meters ( it should me mm).

In principle, what I expected to see was: flat or noisy field. ButI still could see the beam => why? strange aliasing effect?

Using meaningful Rotation angles I get correct results:

immagine

This is good

Below:

I see what I expected, with Rotation angle "slightly" greater than the angular acceptance of the target (brown)

immagine

Below:

for angles over 10,I see again the peak

Insight: probably it is because we are seeing the "higher" orders of the simulations. I.E. the plane mirror is sampled with a certain number of points, which make it act as a grating if we put the detector at proper angles! immagine

It works!

immagine

aljosahafner commented 2 years ago

Is it ready to be implemented in OasysWiser?

capitanevs commented 2 years ago

I close the issue. I will reopen it if something is wrong.

aljosahafner commented 2 years ago

Can I update LibWiser on PyPI and therefore in OasysWiser?