-
Notifications
You must be signed in to change notification settings - Fork 32
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
Momentum offset for 6d orbit #540
Conversation
Hello @swhite2401 Moving the decorator to Or alternatively keep find_orbit6 non-decorated (with a warning or error, as you like), but modify Then we would decorate Or go for the brute force solution: decorate everything. The penalty does not look so tremendous. Much less than the one for using a 6d lattice when it's not useful. We are just leaving out the pedagogic aspect: one should not use a 6d lattice to compute the chromaticity… |
The changes that have been made have fixed the chromaticity function.
|
So we have to choose between 3 possibilities:
Any preference ? |
Hello, @lfarv is correct , I have overlooked However, if we are allowing |
Not exactly: in all 3 options, the idea is to decorate all high level 6d functions ( So I finally agree that option 1 is the easiest solution… |
So now, if we continue with this branch, we must decorate:
It looks useless for |
Do we expect others? In I can see 2 options:
Since the second option is what we add in the past and was not popular I would suggest to continue with this branch. |
Is it possible to decorate function in matlab? |
Yes, you are right!
The decorator syntax does not exist, but there is a wrapper which does the equivalent: see |
Everything is correctly decorated with |
@lfarv, can I leave this to you? (I can do the python if needed but the matlab I am not comfortable with...) |
@lfarv I think I have decorate everything that needs decoration, could you check that I did not forget anything? |
@swhite2401: that looks ok for PyAT. I have Matlab similar corrections ready. Should we put them together or in another PR (cleaner way; I think)?. The failure in Matlab tests has been corrected by Lee in the master branch, so no worry. I'll look at the conflicting files if you allow me. |
I merge the master and fixed conflicts, I think this is ready for merge. Better keep matlab and python separated on this one |
It's not the 1st time this strange thing occurs. It's worrying because we don't understand why results are changing without any reason, even if the 1e-10 threshold instead of 1e-12 is still perfectly acceptable. Question about your last commit: why don't you rebase instead of merging ? |
I have had some bad experience with rebase in the past and ended up merging in any case, so I took the habit (maybe bad?) of merging straight away. |
No, it just probably increase the number of commits, but no consequence on the result |
This PR is proposal to answer #528 and other similar problems related to 6D optics/orbit calculations with input momentum offset.
The
frequency_control
decorator is moved toorbit.py
and applied onfind_orbit6
allowing to inputdp
,dct
ordf
and shift the ring frequency internally, This is done n a copy ofring
and does not modify the input lattice.Drawback: the
dp
,dct
ordf
offset are applied w.r.t to the NOMINAL lattice and therefore overwrite existing frequency shifts, this is safer as it prevents applying these offsets several times.The help was modified to explain this behavior.
The behavior of
find_orbit6
withdp
argument is now identical to the one offind_orbit4
with the same input arguments, which is convenient for codes having to handle lattices without or without radiations.I know this has been a controversial question and we may decide to discard this proposal, however the present situation raising errors all the time is not satisfactory and needs to be improved. Any comments or ideas welcome!