@@ -855,11 +855,12 @@ def get_laser_spectral_intensity(self, t=None, iteration=None, pol=None, m='all'
855855 plot = False , ** kw ):
856856 """
857857 Calculate the spectral intensity of the laser pulse, defined as:
858- $$ I(k) = \epsilon_0 c \int d\b oldsymbol{x}_\perp | \hat{E}(\b oldsymbol{x}_\perp, k) |^2$$
858+ $$ I(k) = \epsilon_0 \int d\b oldsymbol{x}_\perp | \hat{E}(\b oldsymbol{x}_\perp, k) |^2$$
859859 with
860860 $$ \hat{E}(\b oldsymbol{x}_\perp, k) = \f rac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty} E(\b oldsymbol{x}_\perp, z) \exp(-i k z) dz $$
861861
862- TODO: discuss sum to get total laser energy
862+ The electromagetic energy associated with the electric field can be obtained by:
863+
863864
864865 TODO: Add option to return as a function of lambda
865866
@@ -891,18 +892,18 @@ def get_laser_spectral_intensity(self, t=None, iteration=None, pol=None, m='all'
891892 Returns
892893 -------
893894 A tuple with:
894- - The 1D spectral intensity (TODO: dicuss units )
895+ - The 1D spectral intensity (in J.m for 3D and thetaMode, in J for 2D )
895896 - A FieldMetaInformation object
896897 """
897898 # Extract electric field data
898899 field , info = self .get_field (t = t , iteration = iteration , field = 'E' , coord = pol , m = m )
899900
900901 # Perform FFT along the 'z' axis
901902 inverted_axes_dict = {info .axes [key ]: key for key in info .axes .keys ()}
902- fft_field = np .fft .fft (field , axis = inverted_axes_dict ['z' ])
903+ fft_field = np .fft .fft (field , axis = inverted_axes_dict ['z' ]) * info . dz / np . sqrt ( 2 * np . pi )
903904
904905 # Compute spectral intensity by squaring the FFT and integrating over the transverse plane
905- spectral_intensity = const .epsilon_0 * const . c * np .abs (fft_field )** 2
906+ spectral_intensity = const .epsilon_0 * np .abs (fft_field )** 2
906907 geometry = self .fields_metadata ['E' ]['geometry' ]
907908 if geometry == '3dcartesian' :
908909 spectral_intensity = np .sum (spectral_intensity ,
0 commit comments