Open n01r opened 4 months ago
Hi @n01r,
I have a question: you constructed the laser pulse using spectral information, is it possible to get the temporal information of the pulse directly from LASY and vice versa ?
Hi @koesterf,
Since spectral information is often what is directly measured in experiments I was playing around with the method to construct a pulse from such information. Are you asking if, in general, one can extract temporal information of a laser pulse from a LASY Laser
object?
I was pointing out here in this issue that one could run into parameter combinations that create only NaNs and the user might not know why.
Hi @n01r
Are you asking if, in general, one can extract temporal information of a laser pulse from a LASY Laser object?
Yes, I want to know if one make a longitudinal profile using spectral method, then is it possible to get the temporal information after full pulse construction directly from LASY internal utility. And similarly, if the laser pulse longitudinal profile is constructed with temporal information is it possible to get spectral information directly using LASY internal utility.
I saw something like "get_spectral_field()" unitility spectral and "get_temporal_field" utility temporal
@koesterf, I'd suggest we move this over to the issue you already opened #286
I was playing around with the laser creation to check something about the noise level / lowest intensity based on wavelength bandwidth and number of samples in time. I found that specific combinations just give warnings and produce
NaN
values. A proper check with a user-facing error message would probably be helpful to avoid that someone accidentally hits such a combination.(Click tab below to expand function definition)
create_laser
```Python3 import lasy from lasy.laser import Laser from lasy.profiles import CombinedLongitudinalTransverseProfile from lasy.profiles.longitudinal import LongitudinalProfileFromData, GaussianLongitudinalProfile from lasy.profiles.transverse import GaussianTransverseProfile import numpy as np from scipy.constants import c def create_laser(third_order_dispersion_kfs3,lambda_bw_nm=200,time_window_fs=1000,time_points=3000): """ """ wavelength = 815e-9 # Laser wavelength in meters pol = (1,0) # Linearly polarized in the x direction laser_energy = 20 # Energy of the laser pulse in joules waist = 2.12e-6 # Waist of the laser pulse in meters tau = 29.8e-15 # Pulse duration of the laser in seconds (i.e. 35 fs FWHM, tau=FWHM_I/1.1741) t_peak = 0.0 # Location of the peak of the laser pulse in time TOD = third_order_dispersion_kfs3*1e3*(1e-15)**3 # 80k fs^3 dimensions = 'rt' # Use cylindrical geometry #lo = (0,-15*tau) # Lower bounds of the simulation box #hi = (5*waist,15*tau) # Upper bounds of the simulation box lo = (0,-time_window_fs/2*1e-15) # Lower bounds of the simulation box hi = (5*waist,time_window_fs/2*1e-15) # Upper bounds of the simulation box num_points = (300,time_points) # Number of points in each dimension # Generate laser spectral intensity, including TOD, with numpy #lambd = np.linspace(765e-9, 865e-9, num_points[-1]) lambda_half_bw = lambda_bw_nm*1e-9/2 lambd = np.linspace(wavelength-lambda_half_bw, wavelength+lambda_half_bw, num_points[-1]) omega = 2*np.pi*c/lambd omega0 = 2*np.pi*c/wavelength intensity = np.exp( -(omega-omega0)**2*tau**2/2 ) phase = TOD*(omega-omega0)**3/6 # From the definition of the TOD # Create corresponding laser profile, by combining # a longitudinal defined by the above spectral info # and a transverse Gaussian profile long_profile = LongitudinalProfileFromData( {'datatype': 'spectral', 'axis': lambd, 'intensity': intensity, 'phase': phase, 'dt': (hi[-1] - lo[-1])/num_points[-1]}, lo=lo[-1], hi=hi[-1]) # focal distance from calculation below #trans_profile = GaussianTransverseProfile(waist, wavelength=wavelength, z_foc=22.205039999826518e-6) trans_profile = GaussianTransverseProfile(waist, wavelength=wavelength, z_foc=0) laser_profile = CombinedLongitudinalTransverseProfile(wavelength, pol, laser_energy, long_profile, trans_profile) # Define laser on a grid laser = Laser(dimensions,lo,hi,num_points,laser_profile) return laser ```The orange line with 1500 sample points is missing
https://github.com/LASY-org/lasy/blob/71c893ad1c473dc1b184148b2e43e2481ca0b913/lasy/profiles/longitudinal/longitudinal_profile_from_data.py#L90