Skip to content

Commit

Permalink
Update test_STC.py
Browse files Browse the repository at this point in the history
  • Loading branch information
huixingjian authored Dec 17, 2024
1 parent 2b5eb39 commit de7c26a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_STC.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,33 @@
t_peak=t_peak,
z_foc=z_foc,
)

laser_2d_combined = Laser(
dim="rt",
lo=(0e-6, -10e-14),
hi=(50e-6, +10e-14),
npoints=(60, 200),
profile=combined_profile,
)

laser_2d_gaussian = Laser(
dim="rt",
lo=(0e-6, -10e-14),
hi=(50e-6, +10e-14),
npoints=(60, 200),
profile=profile_gaussian,
)

env_combined = laser_2d_combined.grid.get_temporal_field()
env_gaussian = laser_2d_gaussian.grid.get_temporal_field()

err_real = np.average(
(np.array(env_combined.real) - np.array(env_gaussian.real))
/ np.array(env_combined.real)
)
err_imag = np.average(
err_imag = np.average((
np.array(env_combined.imag)
- np.array(env_gaussian.imag) / np.array(env_combined.imag)
- np.array(env_gaussian.imag)) / np.array(env_combined.imag)
)

Phi2_3d, phi2_3d = get_phi2(laser_3d.dim, laser_3d.grid)
Expand Down

0 comments on commit de7c26a

Please sign in to comment.