Search code examples
pythonnumpymeshspherical-coordinate

How to get Lebedev and Gaussian spherical grid


I am being reading some works on HRTF interpolation and spherical harmonics. In such works regular spherical grids are often used, e.g., in this work, but I am missing how to compute them:
Hence, how to compute the Lebedev and the Gaussian spherical grids?

Is there a python package that easily return the list of points for a specific grid?


Solution

  • Foe Lebedev grids, you could try qc-grid package.

    pip install qc-grid
    

    Then you can ask some points for Spherical Harmonics (sh) numerical integration:

    from grid.angular import AngularGrid
    
    sh_degree = 6
    lebedev_grid = AngularGrid(degree = sh_degree)
    
    print(f"3D points in Cartesian: {lebedev_grid.points}"
    

    Alternatively, you could give AngularGrid the number of points you want. It seems to return the point in Cartesian coordinates.