-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06347b3
commit 7e229f3
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .cos_profile import CosLongitudinalProfile | ||
from .gaussian_profile import GaussianLongitudinalProfile | ||
from .longitudinal_profile_from_data import LongitudinalProfileFromData | ||
|
||
__all__ = ["GaussianLongitudinalProfile", "LongitudinalProfileFromData"] | ||
__all__ = ["CosLongitudinalProfile","GaussianLongitudinalProfile", "LongitudinalProfileFromData"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import numpy as np | ||
|
||
from .longitudinal_profile import LongitudinalProfile | ||
|
||
|
||
class CosLongitudinalProfile(LongitudinalProfile): | ||
r""" | ||
Derived class for the analytic longitudinal truncated cosinus profile profile of a laser pulse. | ||
More precisely, the longitudinal envelope | ||
(to be used in the :class:CombinedLongitudinalTransverseProfile class) | ||
corresponds to: | ||
.. math:: | ||
\mathcal{L}(t) = \cos\left({ \frac{\pi}{2} \frac{t-t_peak}{tau_fwhm} }\right) | ||
\theta( \frac{t-t_peak}{tau_fwhm} + 1 ) \theta( 1 - \frac{t-t_peak}{tau_fwhm} ) | ||
\exp\left({ + i\omega_0t_{peak} }\right) | ||
Parameters | ||
---------- | ||
tau_fwhm : float (in second) | ||
The Full-Width-Half-Maximum duration of the intensity distribution of the pulse. | ||
t_peak : float (in second) | ||
The time at which the laser envelope reaches its maximum amplitude, | ||
i.e. :math:`t_{peak}` in the above formula. | ||
cep_phase : float (in radian), optional | ||
The Carrier Enveloppe Phase (CEP) :math:`\phi_{cep}` | ||
(i.e. the phase of the laser oscillation, at the time where the | ||
laser envelope is maximum) | ||
""" | ||
|
||
def __init__(self, wavelength, tau, t_peak, cep_phase=0): | ||
super().__init__(wavelength) | ||
self.tau = tau | ||
self.t_peak = t_peak | ||
self.cep_phase = cep_phase | ||
|
||
def evaluate(self, t): | ||
""" | ||
Return the longitudinal envelope. | ||
Parameters | ||
---------- | ||
t: ndarrays of floats | ||
Define points on which to evaluate the envelope | ||
Returns | ||
------- | ||
envelope: ndarray of complex numbers | ||
Contains the value of the longitudinal envelope at the | ||
specified points. This array has the same shape as the array t. | ||
""" | ||
|
||
tn = (t - t_peak)/self.tau | ||
|
||
envelope = np.cos(0.5*np.pi*tn)*np.theta(tn + 1)*np.theta(1 - tn)* | ||
np.exp(+ 1.0j * (self.cep_phase + self.omega0 * self.t_peak)) | ||
|
||
return envelope |