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

Elemrnt rotations #519

Merged
merged 10 commits into from
Nov 28, 2022
Merged

Elemrnt rotations #519

merged 10 commits into from
Nov 28, 2022

Conversation

swhite2401
Copy link
Contributor

This PR is a follow-up of #512. It was pointed out that there was no function to provide pitch and yaw in python. The proposed solution was using the wrong coordinate system and needed to be improved.

The change of coordinate from angle (input argument) to momentum is done using the R1 and R2 matrices.

relative option is still available but a bit tricky because some of the transformations are not commutative.
This implementation is a at the stage of a proposal, ideas and suggestions welcome!

If we are happy with this, it can easily be ported to matlab.

pyat/at/lattice/utils.py Outdated Show resolved Hide resolved
@swhite2401
Copy link
Contributor Author

@elafmusa, I could not add you as reviewer but could you please check this is doing what you expected? Thanks!

@lfarv
Copy link
Contributor

lfarv commented Nov 17, 2022

@swhite2401 : Just for my understanding: why is it necessary to round the rotation values?

@swhite2401
Copy link
Contributor Author

@swhite2401 : Just for my understanding: why is it necessary to round the rotation values?

I had rounding errors of ~1e-19 when applying a transformation and then reverting if with -angle and was not getting exactly identity and zero translation.... I got annoyed by this so I am rounding the angles.
I suppose this comes from the calculation of the previous angles a shift.

It is not necessary, more of a cosmetic measure

@simoneliuzzo simoneliuzzo removed their request for review November 18, 2022 15:09
@simoneliuzzo
Copy link
Contributor

I think this is a nice addition. I do not have time to review, so I removed myself from reviewers.

@lfarv lfarv added enhancement Python For python AT code labels Nov 20, 2022
@elafmusa
Copy link

@swhite2401 I tested the implemented functions, and it works as expected thanks!

@swhite2401
Copy link
Contributor Author

@swhite2401 I tested the implemented functions, and it works as expected thanks!

Ok I merge, you may switch back to the master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants