From d8b5baa0687e4c8abad66d65f0ca66da58d2666b Mon Sep 17 00:00:00 2001 From: Kale Weichman Date: Thu, 19 Dec 2024 16:06:26 -0500 Subject: [PATCH] fixed error that set field equal to constant --- lasy/utils/laser_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lasy/utils/laser_utils.py b/lasy/utils/laser_utils.py index 55be1d3c..7ed10b3f 100644 --- a/lasy/utils/laser_utils.py +++ b/lasy/utils/laser_utils.py @@ -130,7 +130,8 @@ def normalize_peak_intensity(peak_intensity, grid): if input_peak_intensity == 0.0: print("Field is zero everywhere, normalization will be skipped") else: - grid.set_temporal_field(np.sqrt(peak_intensity / input_peak_intensity)) + field *= np.sqrt(peak_intensity / input_peak_intensity)) + grid.set_temporal_field(field) def get_full_field(laser, theta=0, slice=0, slice_axis="x", Nt=None):