Skip to content

Commit

Permalink
Corretly convert hgap in dipole from bmad
Browse files Browse the repository at this point in the history
  • Loading branch information
cr-xu committed Sep 26, 2024
1 parent 3038c7b commit 2a0e662
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Add `TransverseDeflectingCavity` element (following the Bmad-X implementation) (see #240) (@jp-ga)
- `Dipole` and `RBend` now take a focusing moment `k1` (see #235, #247) (@hespe)
- Implement a converter for lattice files imported from Elegant (see #222) (@hespe)
- Implement a converter to read bmad lattices (see #196, #261)

### 🐛 Bug fixes

Expand Down
2 changes: 1 addition & 1 deletion cheetah/converters/bmad.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def convert_element(
)
return cheetah.Dipole(
length=torch.tensor([bmad_parsed["l"]]),
gap=torch.tensor([bmad_parsed.get("hgap", 0.0)]),
gap=torch.tensor([2 * bmad_parsed.get("hgap", 0.0)]),
angle=torch.tensor([bmad_parsed.get("angle", 0.0)]),
e1=torch.tensor([bmad_parsed["e1"]]),
e2=torch.tensor([bmad_parsed.get("e2", 0.0)]),
Expand Down

0 comments on commit 2a0e662

Please sign in to comment.