Skip to content

odak.wave.calculate_amplitude

Definition to calculate amplitude of a single or multiple given electric field(s).

Parameters:

Name Type Description Default
field ndarray.complex or complex

Electric fields or an electric field.

required

Returns:

Type Description
float

Amplitude or amplitudes of electric field(s).

Source code in odak/wave/utils.py
def calculate_amplitude(field):
    """ 
    Definition to calculate amplitude of a single or multiple given electric field(s).

    Parameters
    ----------
    field        : ndarray.complex or complex
                   Electric fields or an electric field.

    Returns
    -------
    amplitude    : float
                   Amplitude or amplitudes of electric field(s).
    """
    amplitude = np.abs(field)
    return amplitude

See also