From e396f5ae624d8dbe82bd4c80da5ef10caa066163 Mon Sep 17 00:00:00 2001 From: Xingjian Hui <151739545+huixingjian@users.noreply.github.com> Date: Sat, 11 Jan 2025 16:14:29 +0100 Subject: [PATCH 1/3] Update gaussian_profile.py --- lasy/profiles/gaussian_profile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lasy/profiles/gaussian_profile.py b/lasy/profiles/gaussian_profile.py index c428cd62..4c71779f 100644 --- a/lasy/profiles/gaussian_profile.py +++ b/lasy/profiles/gaussian_profile.py @@ -54,6 +54,9 @@ class GaussianProfile(Profile): The time at which the laser envelope reaches its maximum amplitude, i.e. :math:`t_{peak}` in the above formula. + x0 , y0: float (in meter) optional (default: '0') + Transverse centroid for the laser pulse + cep_phase : float (in radian), optional The Carrier Envelope Phase (CEP), i.e. :math:`\phi_{cep}` in the above formula (i.e. the phase of the laser @@ -126,6 +129,8 @@ def __init__( w0, tau, t_peak, + x0=0, + y0=0, cep_phase=0, z_foc=0, phi2=0, @@ -145,6 +150,8 @@ def __init__( self.beta = beta self.zeta = zeta self.stc_theta = stc_theta + self.x0= x0 + self.y0 = y0 def evaluate(self, x, y, t): """ @@ -197,7 +204,7 @@ def evaluate(self, x, y, t): # Term for wavefront curvature + Gouy phase diffract_factor = 1.0 - 1j * self.z_foc_over_zr # Calculate the argument of the complex exponential - exp_argument = -(x**2 + y**2) / (self.w0**2 * diffract_factor) + exp_argument = -((x-self.x0)**2 + (y-self.y0)**2) / (self.w0**2 * diffract_factor) # Get the profile envelope = ( np.exp( From e655a55e224c048b3029b27a329cf102bdab2e31 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:17:30 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lasy/profiles/gaussian_profile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lasy/profiles/gaussian_profile.py b/lasy/profiles/gaussian_profile.py index 4c71779f..cd5123d5 100644 --- a/lasy/profiles/gaussian_profile.py +++ b/lasy/profiles/gaussian_profile.py @@ -150,7 +150,7 @@ def __init__( self.beta = beta self.zeta = zeta self.stc_theta = stc_theta - self.x0= x0 + self.x0 = x0 self.y0 = y0 def evaluate(self, x, y, t): @@ -204,7 +204,9 @@ def evaluate(self, x, y, t): # Term for wavefront curvature + Gouy phase diffract_factor = 1.0 - 1j * self.z_foc_over_zr # Calculate the argument of the complex exponential - exp_argument = -((x-self.x0)**2 + (y-self.y0)**2) / (self.w0**2 * diffract_factor) + exp_argument = -((x - self.x0) ** 2 + (y - self.y0) ** 2) / ( + self.w0**2 * diffract_factor + ) # Get the profile envelope = ( np.exp( From c08a64d10774686c73c184b404f9764315931cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxence=20Th=C3=A9venet?= Date: Wed, 15 Jan 2025 09:51:27 +0100 Subject: [PATCH 3/3] Update lasy/profiles/gaussian_profile.py --- lasy/profiles/gaussian_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lasy/profiles/gaussian_profile.py b/lasy/profiles/gaussian_profile.py index cd5123d5..8c93b5e9 100644 --- a/lasy/profiles/gaussian_profile.py +++ b/lasy/profiles/gaussian_profile.py @@ -54,7 +54,7 @@ class GaussianProfile(Profile): The time at which the laser envelope reaches its maximum amplitude, i.e. :math:`t_{peak}` in the above formula. - x0 , y0: float (in meter) optional (default: '0') + x0 , y0 : float (in meter) optional (default: '0') Transverse centroid for the laser pulse cep_phase : float (in radian), optional