Skip to content

Commit

Permalink
fix bug in IO
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxThevenet committed Aug 4, 2023
1 parent 03af413 commit f9b4dfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lasy/utils/laser_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def field_to_a0(grid, omega0):
# Here, we neglect the time derivative of the envelope of E, the first RHS
# term in: E = -dA/dt + 1j * omega0 * A where E and A are the field and
# vector potential envelopes, respectively
omega, _ = get_frequency(grid.field, grid.axes, is_envelope=True, omega0=omega0)
omega, _ = get_frequency(grid, is_envelope=True, omega0=omega0)
return -1j * e * grid.field / (m_e * omega * c)


Expand Down Expand Up @@ -359,5 +359,5 @@ def a0_to_field(grid, omega0, direct=True):
)
return m_e * c / e * A
else:
omega, _ = get_frequency(grid.field, grid.axes, is_envelope=True, omega0=omega0)
omega, _ = get_frequency(grid, is_envelope=True, omega0=omega0)
return 1j * m_e * omega * c * grid.field / e
2 changes: 1 addition & 1 deletion lasy/utils/openpmd_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def write_to_openpmd_file(
m.set_attribute("isLaserEnvelope", True)

if use_a0:
array = field_to_a0(array, grid.axes, 2 * np.pi * c / wavelength)
array = field_to_a0(grid, 2 * np.pi * c / wavelength)

# Pick the correct field
if dim == "xyt":
Expand Down

0 comments on commit f9b4dfd

Please sign in to comment.