Pulse Class¶
-
class
pynlo.light.
Pulse
(frep_MHz=None, n=None)[source]¶ Class which carried all information about the light field. This class is a base upon which various cases are built (eg analytic pulses, CW fields, or pulses generated from experimental data.)
-
AT
¶ Property: time-domain electric field grid
Returns: AT – Complex electric field in time domain. Return type: ndarray, shape NPTS
-
AW
¶ Property: frequency-domain electric field grid
Returns: AW – Complex electric field in frequency domain. Return type: ndarray, shape NPTS
-
T_mks
¶ Property: time grid
Returns: T_mks – Time grid corresponding to AT [s] Return type: ndarray, shape NPTS
-
T_ps
¶ Property: time grid
Returns: T_ps – Time grid corresponding to AT [ps] Return type: ndarray, shape NPTS
-
V_THz
¶ Property: relative angular frequency grid
Returns: V_THz – Relative angular frequency grid corresponding to AW [THz] Return type: ndarray, shape NPTS
-
V_mks
¶ Property: relative angular frequency grid
Returns: V_mks – Relative angular frequency grid corresponding to AW [Hz] Return type: ndarray, shape NPTS
-
W_THz
¶ Property: angular frequency grid
Returns: W_THz – Angular frequency grid corresponding to AW [THz] Return type: ndarray, shape NPTS
-
W_mks
¶ Property: angular frequency grid
Returns: W_mks – Angular frequency grid corresponding to AW [Hz] Return type: ndarray, shape NPTS
-
add_time_offset
(offset_ps)[source]¶ Shift field in time domain by offset_ps picoseconds. A positive offset moves the pulse forward in time.
-
calc_epp
()[source]¶ Calculate and return energy per pulse via numerical integration of \(A^2 dt\)
Returns: x – Pulse energy [J] Return type: float
-
calculate_intensity_autocorrelation
()[source]¶ Calculates and returns the intensity autocorrelation, \(\int P(t)P(t+\tau) dt\)
Returns: x – Intensity autocorrelation. The grid is the same as the pulse class’ time grid. Return type: ndarray, shape N_pts
-
center_frequency_THz
¶ Property: center frequency
Returns: center_frequency_THz – Frequency of center point in AW grid [THz] Return type: float
-
center_frequency_mks
¶ Property: center frequency
Returns: center_frequency_mks – Frequency of center point in AW grid [Hz] Return type: float
-
center_wavelength_mks
¶ Property: center wavelength
Returns: center_wavelength_mks – Wavelength of center point in AW grid [m] Return type: float
-
center_wavelength_nm
¶ Property: center wavelength
Returns: center_wavelength_nm – Wavelength of center point in AW grid [nm] Return type: float
-
chirp_pulse_W
(GDD, TOD=0, FOD=0.0, w0_THz=None)[source]¶ Alter the phase of the pulse
Apply the dispersion coefficients \(\beta_2, \beta_3, \beta_4\) expanded around frequency \(\omega_0\).
Parameters: - GDD (float) – Group delay dispersion (\(\beta_2\)) [ps^2]
- TOD (float, optional) – Group delay dispersion (\(\beta_3\)) [ps^3], defaults to 0.
- FOD (float, optional) – Group delay dispersion (\(\beta_4\)) [ps^4], defaults to 0.
- w0_THz (float, optional) – Center frequency of dispersion expansion, defaults to grid center frequency.
Notes
The convention used for dispersion is
\[E_{new} (\omega) = \exp\left(i \left( \frac{1}{2} GDD\, \omega^2 + \frac{1}{6}\, TOD \omega^3 + \frac{1}{24} FOD\, \omega^4 \right)\right) E(\omega)\]
-
create_subset_pulse
(center_wl_nm, NPTS)[source]¶ Create new pulse with smaller frequency span, centered at closest grid point to center_wl_nm, with NPTS grid points and frequency-grid values from this pulse.
-
dF_THz
¶ Property: frequency grid spacing
Returns: dF_ps – Frequency grid spacing [ps] Return type: float
-
dF_mks
¶ Property: frequency grid spacing
Returns: dF_mks – Frequency grid spacing [s] Return type: float
-
frep_MHz
¶ Property: Repetition rate. Used for calculating average beam power.
Returns: frep_MHz – Pulse repetition frequency [MHz] Return type: float
-
frep_mks
¶ Property: Repetition rate. Used for calculating average beam power.
Returns: frep_mks – Pulse repetition frequency [Hz] Return type: float
-
rotate_spectrum_to_new_center_wl
(new_center_wl_nm)[source]¶ Change center wavelength of pulse by rotating the electric field in the frequency domain. Designed for creating multiple pulses with same gridding but of different colors. Rotations is by integer and to the closest omega.
-
set_AT
(AT_new)[source]¶ Set the value of the time-domain electric field.
Parameters: AW_new (array_like) – New electric field values.
-
set_AW
(AW_new)[source]¶ Set the value of the frequency-domain electric field.
Parameters: AW_new (array_like) – New electric field values.
-
set_NPTS
(NPTS)[source]¶ Set the grid size.
The actual grid arrays are not altered automatically to reflect a change.
Parameters: NPTS (int) – Number of points in grid
-
set_center_wavelength_m
(wl)[source]¶ Set the center wavelength of the grid in units of meters.
Parameters: wl (float) – New center wavelength [m]
-
set_center_wavelength_nm
(wl)[source]¶ Set the center wavelength of the grid in units of nanometers.
Parameters: wl (float) – New center wavelength [nm]
-
set_epp
(desired_epp_J)[source]¶ Set the energy per pulse (in Joules)
Parameters: desired_epp_J (float) – the value to set the pulse energy [J] Returns: Return type: nothing
-
set_frep_MHz
(fr_MHz)[source]¶ Set the pulse repetition frequency.
This parameter used internally to convert between pulse energy and average power.
Parameters: fr_MHz (float) – New repetition frequency [MHz]
-
set_frequency_window_THz
(DF)[source]¶ Set the total frequency window of the grid.
This sets the grid dF, and implicitly changes the temporal span (~1/dF).
Parameters: DF (float) – New grid time span [THz]
-
set_frequency_window_mks
(DF)[source]¶ Set the total frequency window of the grid.
This sets the grid dF, and implicitly changes the temporal span (~1/dF).
Parameters: DF (float) – New grid time span [Hz]
-
set_time_window_ps
(T)[source]¶ Set the total time window of the grid.
This sets the grid dT, and implicitly changes the frequency span (~1/dT).
Parameters: T (float) – New grid time span [ps]
-
set_time_window_s
(T)[source]¶ Set the total time window of the grid.
This sets the grid dT, and implicitly changes the frequency span (~1/dT).
Parameters: T (float) – New grid time span [s]
-
time_window_mks
¶ Property: time grid span
Returns: time_window_mks – Time grid span [ps] Return type: float
-
time_window_ps
¶ Property: time grid span
Returns: time_window_ps – Time grid span [ps] Return type: float
-
wl_mks
¶ Property: Wavelength grid
Returns: wl_mks – Wavelength grid corresponding to AW [m] Return type: ndarray, shape NPTS
-
wl_nm
¶ Property: Wavelength grid
Returns: wl_nm – Wavelength grid corresponding to AW [nm] Return type: ndarray, shape NPTS
-
write_frog
(fileloc='broadened_er_pulse.dat', flip_phase=True)[source]¶ Save pulse in FROG data format. Grid is centered at wavelength center_wavelength (nm), but pulse properties are loaded from data file. If flip_phase is true, all phase is multiplied by -1 [useful for correcting direction of time ambiguity]. time_window (ps) sets temporal grid size.
power sets the pulse energy: if power_is_epp is True then the number is pulse energy [J] if power_is_epp is False then the power is average power [W], and is multiplied by frep to calculate pulse energy
-