pyLaserPulse.grid

Created on Mon Nov 23 15:50:35 2020

@author: james feehan

Grid class

Classes

grid(points, lambda_c, lambda_max)

Time-frequency grid class.

grid_from_pyLaserPulse_simulation(data_directory)

Time-frequency grid class.

class pyLaserPulse.grid.grid(points, lambda_c, lambda_max)

Time-frequency grid class.

__init__(points, lambda_c, lambda_max)
Parameters:
  • points (int) – Number of points in the time-frequency grid. Must be an integer power of 2.

  • lambda_c (float) – Central wavelength of the frequency grid in m.

  • lambda_max (float) – Maximum wavelength of the frequency grid in m.

points

Number of points in the time-frequency grid. Integer power of 2.

Type:

int

midpoint

int(points / 2) – The central point of the time-frequency grid.

Type:

int

lambda_c

The central wavelength of the frequency grid in m

Type:

float

lambda_max

The maximum wavelength of the frequency grid in m.

Type:

float

omega_c

The central angular frequency of the angular frequency grid in rad Hz.

Type:

float

f_range

The range (or span) of the frequency grid in Hz

Type:

float

df

The resolution of the frequency grid in Hz

Type:

float

f_c

The central frequency of the frequency grid in Hz.

Type:

float

dOmega

The resolution of the angular frequency grid in rad Hz

Type:

float

t_range

The range (or span) of the time grid in s

Type:

float

dt

The resolution of the time grid in s

Type:

float

time_window

The time grid in s

Type:

numpy array

omega

The angular frequency grid in rad Hz centred at 0 rad Hz

Type:

numpy array

omega_window

The angular frequency grid in rad Hz

Type:

numpy array

omega_window_shift

The FFTshifted angular frequency grid in rad Hx

Type:

numpy array

f_window

The frequency grid in Hz

Type:

numpy array

lambda_window

The wavelength window in m

Type:

numpy array

d_wl

The resolution of the wavelength window. See notes; the wavelength window is not evenly spaced.

Type:

numpy array

energy_window

The energy window in J, given by Planck’s constant * f_window

Type:

numpy array

energy_window_shift

The FFTshifted energy window in J.

Type:

numpy array

FFT_scale

Scaling multiplier or divider for FFTs and IFFts, respectively. FFT_scale = sqrt(2 * pi) / dt

Type:

float

Notes

The grids are calculated as follows:

f_range = 2 (c / lambda_c - c / lambda_max), where c = 299792457 m/s df = f_range / points t_range = 1 / df dt = t_range / points time_window = dt * linspace(-1*midpoint, midpoint-1, points) dOmega = 2 * pi * df omega_window = dOmega * linspace(-1*midpoint, midpoint-1, points) lambda_window = 2 * pi * c / omega_window, where c = 299792458 m/s

save(directory)

Save the grid information to a file in directory.

Parameters:

directory (string) – directory to which the data will be saved.

Notes

Only information required to recreate the grid object is saved.

Data is saved using the numpy.savez method. Data can be accessed using the numpy.load method, which will return a dictionary with the following keys: points : Number of data points in the time-frequency grid lambda_c : Central wavelength in m lambda_max : Maximum grid wavelength in m.

class pyLaserPulse.grid.grid_from_pyLaserPulse_simulation(data_directory)

Time-frequency grid class.

__init__(data_directory)
Parameters:

data_direcotry (str) – Absolute path of directory containing grid.npz data file produced by a previous pyLaserPulse simulation.

points

Number of points in the time-frequency grid. Integer power of 2.

Type:

int

midpoint

int(points / 2) – The central point of the time-frequency grid.

Type:

int

lambda_c

The central wavelength of the frequency grid in m

Type:

float

lambda_max

The maximum wavelength of the frequency grid in m.

Type:

float

omega_c

The central angular frequency of the angular frequency grid in rad Hz.

Type:

float

f_range

The range (or span) of the frequency grid in Hz

Type:

float

df

The resolution of the frequency grid in Hz

Type:

float

dOmega

The resolution of the angular frequency grid in rad Hz

Type:

float

t_range

The range (or span) of the time grid in s

Type:

float

dt

The resolution of the time grid in s

Type:

float

time_window

The time grid in s

Type:

numpy array

omega

The angular frequency grid in rad Hz centred at 0 rad Hz

Type:

numpy array

omega_window

The angular frequency grid in rad Hz

Type:

numpy array

omega_window_shift

The FFTshifted angular frequency grid in rad Hx

Type:

numpy array

f_window

The frequency grid in Hz

Type:

numpy array

lambda_window

The wavelength window in m

Type:

numpy array

d_wl

The resolution of the wavelength window. See notes; the wavelength window is not evenly spaced.

Type:

numpy array

energy_window

The energy window in J, given by Planck’s constant * f_window

Type:

numpy array

energy_window_shift

The FFTshifted energy window in J.

Type:

numpy array

FFT_scale

Scaling multiplier or divider for FFTs and IFFts, respectively. FFT_scale = sqrt(2 * pi) / dt

Type:

float

Notes

The grids are calculated as follows:

f_range = 2 (c / lambda_c - c / lambda_max), where c = 299792457 m/s df = f_range / points t_range = 1 / df dt = t_range / points time_window = dt * linspace(-1*midpoint, midpoint-1, points) dOmega = 2 * pi * df omega_window = dOmega * linspace(-1*midpoint, midpoint-1, points) lambda_window = 2 * pi * c / omega_window, where c = 299792458 m/s