Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mini] Enable offset initialisation of Gaussianprofile #342

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lasy/profiles/gaussian_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
MaxThevenet marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down Expand Up @@ -126,6 +129,8 @@ def __init__(
w0,
tau,
t_peak,
x0=0,
y0=0,
cep_phase=0,
z_foc=0,
phi2=0,
Expand All @@ -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):
"""
Expand Down Expand Up @@ -197,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**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(
Expand Down
Loading