OpenPMDPulse#

class wake_t.physics_models.laser.laser_pulse.OpenPMDPulse(file_name, envelope_name=None, iteration=None, t_start=0.0, smooth_edges=False, apply_gaussian_filter=False, gaussian_filter_sigma=(5, 0))[source]#

Read a laser pulse from an openPMD file.

This class requires lasy to be installed.

Parameters:
file_namestring

Name of openPMD file, including path, to read the laser field or envelope from. Either specify the exact file name (e.g. file_name="/path/data_00001.h5") or a file pattern + iteration (e.g. file_name="/path/data%T.h5", iteration=1).

envelope_namestring (optional)

The name of the envelope field (this is not prescribed by the openPMD standard for the envelope). If specified, an envelope field is expected from the openPMD file. Otherwise, a full electric field is assumed.

iterationint (optional)

The iteration to read from the openPMD file. If not specified, the last iteration is used.

t_startfloat, optional

The initialization of this class aligns the right (spatial) edge of the Wake-T grid with the left (temporal) edge of the Lasy grid, regardless of the actual time values in the lasy file. The t_start parameter introduces a time delay to the initialized laser, allowing for precise adjustment of the pulse position in the Wake-T grid.

smooth_edgesbool, optional

Whether to smooth the edges of the laser profile along r using a super-Gaussian function of power 8. This is useful when the laser profile in the openPMD file has a sharp edge (e.g., due to the finite width of the domain in r). Smoothing this edge can help reduce noise in the simulation. By default False.

apply_gaussian_filterbool, optional

Whether to apply a Gaussian filter to the laser profile. This is useful, for example, when the openpmd laser pulse comes from a noisy simulation. In this case, applying the filter can improve the stability of the simulation. By default False.

gaussian_filter_sigmascalar or sequence of scalars

Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes. By default (5, 0), which only smooths along the radial direction.

Notes

When the grid of the openPMD laser pulse and the grid of the Wake-T simulation have a different extent or resolution, the original pulse will be linearly interpolated into the Wake-T grid. This is can sometimes lead to numerical issues that manifest as a radial oscillation of the laser pulse (and, as a result, of the plasma wake). To mitigate this, it is important to avoid interpolating along the radial direction. This can be achieved if the ratios between the original and the Wake-T resolution and extent are an integer.

Methods

envelope_function(xi, r, z_pos)

Return the complex envelope of the laser pulse.

evolve(chi, n_p)

Evolve laser envelope to next time step.

get_envelope()

Get the current laser envelope array.

get_group_velocity(n_p)

Get group velocity of the laser pulse for a given plasma density.

initialize_envelope()

Initialize laser envelope arrays.

set_envelope_solver_params(xi_min, xi_max, ...)

Set the parameters for the laser envelope solver.