Mathematical Core Routines

In this submodule we place all the mathematical and general core routines which are used throughout the package. These are not intended for direct use, but are still documented in order to allow new developers who are unfamiliar with the code base to get used to the internal structure.

eadf.core.calcBlockSize(muCoEle: numpy.ndarray, muAzi: numpy.ndarray, arrData: numpy.ndarray, blockSizeMax: int, lowMem: bool) → int

Calculate an optimized block size

This function steadily increases the blockSize during the pattern transform in order to optimze it for execution time. We only use a very crude metric and a very naive measurement for execution time. However, it is a starting point.

Parameters:
  • muCoEle (np.ndarray) – co-elevation DFT frequencies
  • muAzi (np.ndarray) – azimuth DFT frequencies
  • arrData (np.ndarray) – Fourier coefficients of the array
  • blockSizeMax (int) – Maximum block Size
  • lowMem (bool) – Is it the low memory mode?
Returns:

block size

Return type:

int

eadf.core.inversePatternTransform(arrCoEle: numpy.ndarray, arrAzi: numpy.ndarray, arrData: numpy.ndarray, blockSize: int) → numpy.ndarray

Samples the Pattern by using the Fourier Coefficients

This function does the heavy lifting in the EADF evaluation process. It is used to sample the beampattern and the derivative itself, by evaluating d_phi * Gamma * d_theta^t as stated in (6) in the EADF paper by Landmann and delGaldo. It broadcasts this product over the last three coordinates of the fourier data, so across all wave frequency bins, polarisations and array elements.

By changing d_theta(arrCoEle) and d_phi (arrAzi) acordingly in the arguments one can calculate either the derivative or the pattern itself.

Parameters:
  • arrCoEle (np.ndarray) – array of fourier kernels in co-elevation direction
  • arrAzi (np.ndarray) – array of fourier kernels in azimuth direction
  • arrData (np.ndarray) – the Fourier coefficients to use
  • blockSize (int) – number of angles to process at once
Returns:

beam pattern values at arrCoEle, arrAzi

Return type:

np.ndarray

eadf.core.inversePatternTransformLowMem(arrCoEle: numpy.ndarray, arrAzi: numpy.ndarray, funCoEle: Callable[[numpy.ndarray], numpy.ndarray], funAzi: Callable[[numpy.ndarray], numpy.ndarray], arrData: numpy.ndarray, blockSize: int) → numpy.ndarray

Samples the Pattern by using the Fourier Coefficients

This function does the heavy lifting in the EADF evaluation process. It is used to sample the beampattern and the derivative itself, by evaluating d_phi * Gamma * d_theta^t as stated in (6) in the EADF paper by Landmann and delGaldo. It broadcasts this product over the last three coordinates of the fourier data, so across all polarisations, wave frequency bins and array elements.

However, the matrices containing the complex exponentials are calculated block wise and on the fly.

By changing d_theta(arrCoEle) and d_phi (arrAzi) acordingly in the arguments one can calculate either the derivative or the pattern itself.

Parameters:
  • arrCoEle (np.ndarray) – array of fourier kernels in co-elevation direction
  • arrAzi (np.ndarray) – array of fourier kernels in azimuth direction
  • funAzi (method) – function that generates transform matrix in azimuth direction
  • funCoEle (method) – function that generates transform matrix in frequency direction
  • arrData (np.ndarray) – the Fourier coefficients to use
  • blockSize (int) – number of blocks to transform at once
Returns:

beam pattern values at arrCoEle, arrAzi

Return type:

np.ndarray

eadf.core.evaluatePattern(arrCoEle: numpy.ndarray, arrAzi: numpy.ndarray, muCoEle: numpy.ndarray, muAzi: numpy.ndarray, arrData: numpy.ndarray, blockSize: int, lowMem: bool) → numpy.ndarray

Sample the Beampattern at Arbitrary Angles

Parameters:
  • arrCoEle (np.ndarray) – co-elevation angles to sample at in radians
  • arrAzi (np.ndarray) – azimuth angles to sample at in radians
  • muCoEle (np.ndarray) – spatial frequency bins in co-elevation direction
  • muAzi (np.ndarray) – spatial frequency bins in azimuth direction
  • arrData (np.ndarray) – fourier coefficients
  • blockSize (int) – number of angles / frequencies to process at once
  • lowMem (bool) – should we save memory?
Returns:

sampled values

Return type:

np.ndarray

eadf.core.evaluateGradient(arrCoEle: numpy.ndarray, arrAzi: numpy.ndarray, muCoEle: numpy.ndarray, muAzi: numpy.ndarray, arrData: numpy.ndarray, blockSize: int, lowMem: bool) → numpy.ndarray

Sample the Beampattern Gradients at Arbitrary Angles

Parameters:
  • arrCoEle (np.ndarray) – co-elevation angles to sample at in radians
  • arrAzi (np.ndarray) – azimuth angles to sample at in radians
  • muCoEle (np.ndarray) – spatial frequency bins in co-elevation direction
  • muAzi (np.ndarray) – spatial frequency bins in azimuth direction
  • arrData (np.ndarray) – fourier coefficients
  • blockSize (int) – number of angles / frequencies to process at once
  • lowMem (bool) – should we save memory?
Returns:

Return type:

np.ndarray

eadf.core.evaluateHessian(arrCoEle: numpy.ndarray, arrAzi: numpy.ndarray, muCoEle: numpy.ndarray, muAzi: numpy.ndarray, arrData: numpy.ndarray, blockSize: int, lowMem: bool) → numpy.ndarray

Sample the Beampattern Hessian Matrix at Arbitrary Angles

Parameters:
  • arrCoEle (np.ndarray) – co-elevation angles to sample at in radians
  • arrAzi (np.ndarray) – azimuth angles to sample at in radians
  • muCoEle (np.ndarray) – spatial frequency bins in co-elevation direction
  • muAzi (np.ndarray) – spatial frequency bins in azimuth direction
  • arrData (np.ndarray) – fourier coefficients
  • blockSize (int) – number of angles to process at once
  • lowMem (bool) – should we save memory?
Returns:

Return type:

np.ndarray