Skip to content

odak.wave.propagate_field

Definition to propagate a field from points to an another points in space: propagate a given array of spherical sources to given set of points in space.

Parameters:

Name Type Description Default
points0 ndarray

Start points (i.e. odak.tools.grid_sample).

required
points1 ndarray

End points (ie. odak.tools.grid_sample).

required
field0 ndarray

Field for given starting points.

required
wave_number float

Wave number of a wave, see odak.wave.wavenumber for more.

required
direction float

For propagating in forward direction set as 1, otherwise -1.

1

Returns:

Type Description
ndarray

Field for given end points.

Source code in odak/wave/vector.py
def propagate_field(points0, points1, field0, wave_number, direction=1):
    """
    Definition to propagate a field from points to an another points in space: propagate a given array of spherical sources to given set of points in space.

    Parameters
    ----------
    points0       : ndarray
                    Start points (i.e. odak.tools.grid_sample).
    points1       : ndarray
                    End points (ie. odak.tools.grid_sample).
    field0        : ndarray
                    Field for given starting points.
    wave_number   : float
                    Wave number of a wave, see odak.wave.wavenumber for more.
    direction     : float
                    For propagating in forward direction set as 1, otherwise -1.

    Returns
    -------
    field1        : ndarray
                    Field for given end points.
    """
    field1 = np.zeros(points1.shape[0], dtype=np.complex64)
    for point_id in range(points0.shape[0]):
        point = points0[point_id]
        distances = distance_between_two_points(
            point,
            points1
        )
        field1 += electric_field_per_plane_wave(
            calculate_amplitude(field0[point_id]),
            distances*direction,
            wave_number,
            phase=calculate_phase(field0[point_id])
        )
    return field1

See also