Modeling array elements

API references

class doatools.model.array_elements.ArrayElement[source]

Bases: abc.ABC

Base class for array elements.

output_size

Retrieves the output size of this array element.

For scalar sensors, the output size is one. For vector sensors, the output size is greater than one.

is_scalar

Retrieves whether this array element has a scalar output.

is_isotropic

Retrieves whether this array element is isotropic.

is_polarized

Retrieves whether this array element measures polarized waves.

calc_spatial_response(r, az, el, polarization=None)[source]

Calculates the spatial response of for given sources configurations.

Parameters:
  • r (float or ndarray) – A single range value or an array of range values. Must have the same shape as az and el.
  • az (float or ndarray) – A single azimuth angle or an array of azimuth angles. Must have the same shape as az and el.
  • el (float or ndarray) – A single elevation angle or an array of elevation angles. Must have the same shape as az and el.
  • polarization (ndarray or None) – Polarization information. Suppose r, az, el share the same shape (d1, d2, ..., dn). Then polarization should have a shape of (d1, d2, ..., dn, l), where l is the number of polarization parameters for each source. Default value is None.
Returns:

A spatial response tensor. For a scalar element, the shape should be the same as that of r, az, or el. For a vector element (output_size > 1), the shape is given by (l, d1, d2, ..., dn), where l is equal to output_size and (d1, d2, ..., dn) is the shape of r, az, or el.

Return type:

ndarray

class doatools.model.array_elements.IsotropicScalarSensor[source]

Bases: doatools.model.array_elements.ArrayElement

Creates an isotropic scalar array element.

output_size

Retrieves the output size of this array element.

For scalar sensors, the output size is one. For vector sensors, the output size is greater than one.

is_isotropic

Retrieves whether this array element is isotropic.

is_polarized

Retrieves whether this array element measures polarized waves.

doatools.model.array_elements.ISOTROPIC_SCALAR_SENSOR = <doatools.model.array_elements.IsotropicScalarSensor object>

An isotropic scalar sensor.

class doatools.model.array_elements.CustomNonisotropicSensor(f_sr, output_size=1, polarized=False)[source]

Bases: doatools.model.array_elements.ArrayElement

Creates a customize non-isotropic sensor.

Parameters:
  • f_sr (Callable) – Custom spatial response function. It accepts four inputs: r, az, el, and polarization, and outputs the spatial response. See calc_spatial_response() for more details.
  • output_size (int) – Output size of the sensor. Must be consistent with the output of f_sr. Default value is 1.
  • polarized (bool) – Specifies whether the sensor measures polarized waves. Must be consistent with the implemention in f_sr. Default value is False.
output_size

Retrieves the output size of this array element.

For scalar sensors, the output size is one. For vector sensors, the output size is greater than one.

is_isotropic

Retrieves whether this array element is isotropic.

is_polarized

Retrieves whether this array element measures polarized waves.