PyREx

pyrex.internal_functions.complex_interp

pyrex.internal_functions.complex_interp(x, xp, fp, method='cartesian', outer=None)

Perform interpolation on complex values.

Calculates the linear interpolation of an array of complex values fp. Interpolates in real and imaginary parts for the Cartesian method, and interpolates in gain and (unwrapped) phase for the Euler method.

Parameters
xarray_like

The x-coordinates at which to evaluate the interpolated values.

xparray_like

The x-coordinates of the data points, must be increasing.

fparray_like

The (complex-valued) y-coordinates of the data points, same length as xp.

method{‘cartesian’, ‘euler’}, optional

The interpolation method to use between data points. ‘Cartesian’ will interpolate linearly in the real/imaginary plane. ‘Euler’ will interpolate linearly in the gain and (unwrapped) phase values.

outerNone or float, optional

The value to use for values of x outside of the range of xp. In the ‘Cartesian’ method it will be applied as a complex value. In the ‘Euler’ method it will be applied to the gain, but phases will always retain their value at the closest edge of xp.

Returns
yndarray

The (complex-valued) interpolated values, same shape as x.

Raises
ValueError

If an unspecified interpolation method is given. Or if xp and fp have different length. Or if xp and fp are not 1-D sequences.

PyREx

A Python package for simulation of neutrinos and radio antennas in ice. Version 1.10.0

Navigation