Plot Helpers¶
A collection of functions to plot maps and points on circles and spheres.
- pyroomacoustics.doa.plotters.polar_plt_dirac(self, azimuth_ref=None, alpha_ref=None, save_fig=False, file_name=None, plt_dirty_img=True)¶
Generate polar plot of DoA results.
- Parameters
azimuth_ref (numpy array) – True direction of sources (in radians).
alpha_ref (numpy array) – Estimated amplitude of sources.
save_fig (bool) – Whether or not to save figure as pdf.
file_name (str) – Name of file (if saved). Default is ‘polar_recon_dirac.pdf’
plt_dirty_img (bool) – Whether or not to plot spatial spectrum or ‘dirty image’ in the case of FRI.
- pyroomacoustics.doa.plotters.sph_plot_diracs(colatitude_ref=None, azimuth_ref=None, colatitude=None, azimuth=None, dirty_img=None, colatitude_grid=None, azimuth_grid=None, file_name='sph_recon_2d_dirac.pdf', **kwargs)¶
This function plots the dirty image with sources locations on a flat projection of the sphere
- Parameters
colatitude_ref (ndarray, optional) – The colatitudes of a collection of reference points
azimuths_ref (ndarray, optional) – The azimuths of a collection of reference points for the Diracs
colatitude (ndarray, optional) – The colatitudes of the collection of points to visualize
azimuth (ndarray, optional) – The azimuths of the collection of points to visualize
dirty_img (ndarray) – A 2D map for displaying a pattern on the sphere under the points
azimuth_grid (ndarray) – The azimuths indexing the dirty_img 2D map
colatitude_grid (ndarray) – The colatitudes indexing the dirty_img 2D map
- pyroomacoustics.doa.plotters.sph_plot_diracs_plotly(colatitude_ref=None, azimuth_ref=None, colatitude=None, azimuth=None, dirty_img=None, azimuth_grid=None, colatitude_grid=None, surface_base=1, surface_height=0.0)¶
Plots a 2D map on a sphere as well as a collection of diracs using the plotly library
- Parameters
colatitude_ref (ndarray, optional) – The colatitudes of a collection of reference points
azimuths_ref (ndarray, optional) – The azimuths of a collection of reference points for the Diracs
colatitude (ndarray, optional) – The colatitudes of the collection of points to visualize
azimuth (ndarray, optional) – The azimuths of the collection of points to visualize
dirty_img (ndarray) – A 2D map for displaying a pattern on the sphere under the points
azimuth_grid (ndarray) – The azimuths indexing the dirty_img 2D map
colatitude_grid (ndarray) – The colatitudes indexing the dirty_img 2D map
surface_base – radius corresponding to lowest height on the map
sufrace_height – radius difference between the lowest and highest point on the map