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

switchyard from elegant to opal z value #47

Open
moellep opened this issue May 3, 2023 · 0 comments
Open

switchyard from elegant to opal z value #47

moellep opened this issue May 3, 2023 · 0 comments

Comments

@moellep
Copy link
Member

moellep commented May 3, 2023

When I use switchyard to convert output from an elegant sim to opal, it looks like the z value isn't what opal expects.

For example, using this elegant output file (from the Sirepo Los Alamos Proton Storage Ring example).
run_setup.output.sdds.gz

from rsbeams.rsdata import switchyard
sw = switchyard.Switchyard()
sw.read('run_setup.output.sdds', 'elegant')
sw.write('opal.dat', 'opal')

If I look at the first lines of opal.dat, the z value is around 139.36, rather than something closer to 0.

1000
-6.340713545584865688e-07 -8.766794044966910791e-05 -3.501193557502712281e-04 -8.219311411194487292e-05 1.393657565044637181e+02 8.494205066937067228e-01
-3.035502267016218497e-05 -8.404898146293522112e-05 3.509641817225703101e-04 2.626942294232129908e-06 1.393657075909387402e+02 8.494207845133487922e-01

If I try to run an opal sim with that input file, it fails silently almost immediately. If I subtract the mean(z) from that value, it works OK, but that probably isn't the right thing to do.

moellep added a commit that referenced this issue May 26, 2023
- when writing opal input distribution, center particles z at 0, for #47
- when extracting opal total_charge, get value from array, otherwise it
  appears in GENESIS file as "CHARGE = [...]"
- use abs(total_charge) for GENESIS input file, GENESIS doesn't seem to support negative values?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant