From b097bcac1912d7d5d28a1d0c4594709d9fe91bec Mon Sep 17 00:00:00 2001 From: Jan Kaiser Date: Sun, 7 Jan 2024 21:18:58 +0100 Subject: [PATCH] Set more sensibel values for parameter beam from twiss --- cheetah/particles.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cheetah/particles.py b/cheetah/particles.py index ef08f469..d312f733 100644 --- a/cheetah/particles.py +++ b/cheetah/particles.py @@ -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)