-
Notifications
You must be signed in to change notification settings - Fork 31
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
pyat: atpass error #70
Comments
Hi, Thanks for trying pyat, I'd be keen to help you. You could try renaming the file to Cheers, |
Here's the example |
Ok, thanks @willrogers ... |
I cannot reproduce the bug, but the |
I added the We've got a fix for this, should get a pull request in today. |
The pull request #71 should fix the segfault. However, there is still difficulty loading the @lfarv @carmignani what do you think is the correct behaviour? Do you think we should require the 'Class' field on every element? |
Hi @ZeusMarti, The changes from #71 should resolve your original problem. However, as Will mentioned, your a25.mat file still will not load a valid ring, as some of your elements that do not have classes set have pass methods other than 'DriftPass' or 'IdentityPass'. To fix this set the 'Class' field to 'Corrector' on your correctors and to 'Quadrupole'* on your element with FamName of 'QS'. *I have assumed that 'Quadrupole' is the correct class for your 'QS' elements, however with the attributes they have once loaded in pyat they could equally be Sextupoles. I hope this helps, |
The 'Class' field has been introduced recently and is not required to give a valid AT structure, it has been set as a help for selecting elements. It would be a constraint for a lot of existing lattices to impose it. A better way (but more work) would be to reproduce the function Otherwise I noticed that the a25 lattice also crashes the |
Thanks everyone. 'QS' stands for skew quadrupole, I guess, in this case it should be a Multipole, right? |
Yes, Multipole is fine. |
@T-Nicholls, I should better remove those elements, they are just markers of each quadrupole family. I don't even remember when we introduced them or why... Actually I thought about removing them in the past, but up to now, they where not generating any problem. In case of many turns tracking I generally remove those kind elements. For the python scrip, elements with IdentityPass not being Monitor should be guessed to be Marker, what dou you think? |
@ZeusMarti thanks for clarifying. |
@ZeusMarti |
@T-Nicholls |
@ZeusMarti |
After further investigation and discussion with Will, there is no way to correctly identify your Monitor elements that have a K field; this is a guessing function after all and will not ever be perfect. On the note of the twiss data in Python, I have found all fields of the twiss data from your original file (after QS and Corrector changes) to be identical to the twiss data from my file with the classes guessed. However, they differ from the MML twiss data values from the same files; I am unsure why this is the case as they are identical for our ring at Diamond, but I am looking into it. |
@T-Nicholls |
I was waiting on full feedback from Will before I made a pull request, and he is away this week, but I will make a change that he suggested on Friday and create the pull request today. |
@ZeusMarti I finally got to the bottom of the difference in the twiss data for your lattice. The length of all Corrector elements was accidentally being set to 0, this only caused a discrepancy if the element should have had a non-zero length. Thus the divergence in your twiss data only occurring from element 1460 onwards. It is worth noting that this bug caused a difference regardless of whether the Corrector was set or not. The fix for this is on pull request #78. I believe that all the problems you have raised on this issue should now have been addressed. |
Thanks!! |
@ZeusMarti have you looked at this? |
Sorry I just forgot about this issue. Indeed, it works pretty well now! Thanks guys. |
Hi all,
I just tried a simple code:
It runs well if I use the example "dba.mat", but with our lattice "a25.mat" I get the following error:
Simulating 1 particles for 1 turns through 1469 elements.
Segmentation fault (core dumped)
It seems I can't attach matlab files, so if anyone is willing to help I can send the file.
Thanks,
Zeus
The text was updated successfully, but these errors were encountered: