Grid Objects

Routines to perform grid search on the sphere

class pyroomacoustics.doa.grid.Grid(n_points)

Bases: object

This is an abstract class with attributes and methods for grids

Parameters:

n_points (int) – the number of points on the grid

abstractmethod apply(func, spherical=False)
abstractmethod find_peaks(k=1)
set_values(vals)
class pyroomacoustics.doa.grid.GridCircle(n_points=360, azimuth=None)

Bases: Grid

Creates a grid on the circle.

Parameters:
  • n_points (int, optional) – The number of uniformly spaced points in the grid.

  • azimuth (ndarray, optional) – An array of azimuth (in radians) to use for grid locations. Overrides n_points.

apply(func, spherical=False)
find_peaks(k=1)
plot(mark_peaks=0)
class pyroomacoustics.doa.grid.GridSphere(n_points=1000, spherical_points=None, cartesian_points=None, precompute_neighbors=False)

Bases: Grid

This object represents a grid of points of the sphere.

If the points are not provided, pseudo-uniform points computed according to the Fibonnaci method are used.

Parameters:
  • n_points (int) – The number of points to sample

  • spherical_points (ndarray, optional) – A 2 x n_points array of spherical coordinates with azimuth in the top row and colatitude in the second row. Overrides n_points and cartesian_points.

  • cartesian_points (ndarray, optional) – A 3 x n_points array of Cartesian coordinates with x, y, z coordinates in the rows. The vectors are normalized to unit-norm in the constructor. Overrides n_points.

  • precompute_neighbors (bool, optional) – If True, the convex hull algorithm is used to find all the neighbors of the grid points. This is used for the peak finding algorithm.

References

http://lgdv.cs.fau.de/uploads/publications/spherical_fibonacci_mapping.pdf http://stackoverflow.com/questions/9600801/evenly-distributing-n-points-on-a-sphere

apply(func, spherical=False)

Apply a function to every grid point

find_peaks(k=1)

Find the largest peaks on the grid

min_max_distance()

Compute some statistics on the distribution of the points

property neighbors
plot(colatitude_ref=None, azimuth_ref=None, colatitude_recon=None, azimuth_recon=None, plotly=True, projection=True, points_only=False)
plot_old(plot_points=False, mark_peaks=0)

Plot the points on the sphere with their values

regrid()

Regrid the non-uniform data on a regular mesh