chris-hld / spaudiopy

Spatial Audio Python Package
https://spaudiopy.readthedocs.io/
MIT License
138 stars 13 forks source link

Problem with `spaudiopy.grids.load_lebedev` #11

Closed pklaus closed 4 years ago

pklaus commented 4 years ago

Hi! Great library, I found it because of your nice interface to the Lebedev Quadrature. https://spaudiopy.readthedocs.io/en/latest/spaudiopy.grids.html#spaudiopy.grids.load_lebedev

Unfortunately, I have the impression something is wrong. In my opinion and according to the source you cited for your values, https://people.sc.fsu.edu/~jburkardt/datasets/sphere_lebedev_rule/lebedev_003.txt the Lebedev grid of precision 3 should consist of six vectors. In your code, it only returns four of them:

>>> import spaudiopy as spa
fatal: not a git repository (or any of the parent directories): .git
>>> vecs, weights = spa.grids.load_lebedev(degree=3)
>>> len(vecs)
4

This seems to be a problem with the .mat file added in 4242e89 not containing the right data:

>>> from scipy.io import loadmat
>>> data = loadmat("/home/philipp/spaudiopy/lebedevQuadratures_3_131.mat")
>>> len(data['lebedev_003'])
4
chris-hld commented 4 years ago

Hi! Thank you for pointing this out. There must have been some parsing error that I missed. I fixed the file and it should work as intended now.

https://spaudiopy.readthedocs.io/en/latest/spaudiopy.grids.html#spaudiopy.grids.load_lebedev

pklaus commented 4 years ago

That was a quick fix. Thumbs up!