Skip to content

odak.wave.calculate_intensity

Definition to calculate intensity 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

Intensity or intensities of electric field(s).

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

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

    Returns
    -------
    intensity    : float
                   Intensity or intensities of electric field(s).
    """
    intensity = np.abs(field)**2
    return intensity

See also