Skip to content

Commit

Permalink
Merge pull request #727 from bmad-sim/devel/88
Browse files Browse the repository at this point in the history
Fix to sad quad to bmad sad_mult translation.
  • Loading branch information
DavidSagan authored Jan 11, 2024
2 parents 2af4e1b + 79ac573 commit 89648f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions util_programs/sad_to_bmad/DOC
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ There is an example parameter input file at:
To translate: Copy util_programs/sad_to_bmad/sad_to_bmad.params to your working directory and
edit. Documentation for editing this file and running the translation script is in the file itself.

To run use the command:
python <path-to-sad-to-bmad-dir>/sad_to_bmad.py <parameter-file> <sad-lattice-file>
Note: <sad-lattice-file> is optional. The default will be to take the sad lattice file name
set in the prameter file.

--------------------------------------------------------------------
--------------------------------------------------------------------
Notes:
Expand Down
6 changes: 3 additions & 3 deletions util_programs/sad_to_bmad/sad_to_bmad.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ def add_parens (str, operand):
'quad:k1': ['k1', ' / @l@'],
'sext:k2': ['k2', ' / @l@'],
'oct:k3': ['k3', ' / @l@'],
'sad_mult:k1': ['b1', ' / @l@'], # In case a SAD quad -> Bmad sad_mult
'sad_mult:k2': ['b2', ' / (2 * @l@)'], # In case a SAD sext -> Bmad sad_mult
'sad_mult:k3': ['b3', ' / (6 * @l@)'], # In case a SAD oct -> Bmad sad_mult
'sad_mult:k1': 'b1', # In case SAD quad -> Bmad sad_mult (when there is a solenoid field)
'sad_mult:k2': ['b2', ' / 2'], # In case SAD sext -> Bmad sad_mult
'sad_mult:k3': ['b3', ' / 6'], # In case SAD oct -> Bmad sad_mult
'bend:rotate': ['ref_tilt', ' * -1'],
'bend:drotate': ['roll', ' * -1'],
'l': 'l',
Expand Down

0 comments on commit 89648f6

Please sign in to comment.