Skip to content

Commit

Permalink
Close #142: Automatically normalize laser energy (#147)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
RemiLehe and pre-commit-ci[bot] authored May 31, 2023
1 parent 19a1f39 commit 06347b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lasy/laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def __init__(self, dim, lo, hi, npoints, profile, n_azimuthal_modes=1):
# Perform the azimuthal decomposition
self.field.field[...] = np.fft.ifft(envelope, axis=0)

# For profiles that define the energy, normalize the amplitude
if hasattr(profile, "laser_energy"):
self.normalize(profile.laser_energy, kind="energy")

def normalize(self, value, kind="energy"):
"""
Normalize the pulse either to the energy, peak field amplitude or peak intensity.
Expand Down

0 comments on commit 06347b3

Please sign in to comment.