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

Wrong laser wavelength when reading FBPIC output #358

Open
delaossa opened this issue Feb 14, 2025 · 0 comments
Open

Wrong laser wavelength when reading FBPIC output #358

delaossa opened this issue Feb 14, 2025 · 0 comments
Assignees

Comments

@delaossa
Copy link
Contributor

When reading a laser profile from an FBPIC OpenPMD file, a wrong central laser frequency is extracted by the field_to_envelope function.

This code snippet should reproduce the issue:

from lasy.profiles.from_openpmd_profile import FromOpenPMDProfile
from lasy.laser import Laser
from lasy.utils.laser_utils import compute_laser_energy

laser_profile = FromOpenPMDProfile(path='.',
                   iteration=1,
                   pol=(1, 0),
                   field='E',
                   coord='x',
                   theta=0,
                   )
print(f'lambda0 = {laser_profile.lambda0:.3e} m')

dimensions = "rt"
r = laser_profile.axes["r"]
t = laser_profile.axes["t"]
lo = (r.min(), t.min())
hi = (r.max(), t.max())
num_points = (len(r), len(t))
laser = Laser(dimensions, lo, hi, num_points, laser_profile)
energy = compute_laser_energy('rt', laser.grid)
print(f'Energy = {energy :.2f} J')
laser.show()

which reads this file (I needed to zip it because github does not allow uploading h5 files):
fbpic_data.zip

This FBPIC data has been obtained with this example -> https://fbpic.github.io/example_input/boosted_frame_script.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants