Skip to content

Commit

Permalink
Set more sensibel values for parameter beam from twiss
Browse files Browse the repository at this point in the history
  • Loading branch information
jank324 committed Jan 7, 2024
1 parent 892206a commit b097bca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cheetah/particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,16 @@ def from_twiss(
), "Arguments must have the same shape."

# Set default values without function call in function signature
beta_x = beta_x if beta_x is not None else torch.full(shape, 0.0)
beta_x = beta_x if beta_x is not None else torch.full(shape, 1.0)
alpha_x = alpha_x if alpha_x is not None else torch.full(shape, 0.0)
emittance_x = emittance_x if emittance_x is not None else torch.full(shape, 0.0)
beta_y = beta_y if beta_y is not None else torch.full(shape, 0.0)
emittance_x = (
emittance_x if emittance_x is not None else torch.full(shape, 7.1971891e-13)
)
beta_y = beta_y if beta_y is not None else torch.full(shape, 1.0)
alpha_y = alpha_y if alpha_y is not None else torch.full(shape, 0.0)
emittance_y = emittance_y if emittance_y is not None else torch.full(shape, 0.0)
emittance_y = (
emittance_y if emittance_y is not None else torch.full(shape, 7.1971891e-13)
)
sigma_s = sigma_s if sigma_s is not None else torch.full(shape, 1e-6)
sigma_p = sigma_p if sigma_p is not None else torch.full(shape, 1e-6)
cor_s = cor_s if cor_s is not None else torch.full(shape, 0.0)
Expand Down

0 comments on commit b097bca

Please sign in to comment.