sphere = Sphere(xyz=np.vstack((vertices, -vertices)))
// Asymmetric spherical function composed of a hemisphere with a radius
// of 1 and a hemisphere with a radius of 0.5
sf = np.ones(sphere.vertices.shape[0])sf[np.int(vertices.shape[0]):] *= 0.5
B, m, n = real_full_sh_basis(9, sphere.theta, sphere.phi)
invB = smooth_pinv(B, L=np.zeros_like(n))
sh_coefs = np.dot(invB, sf)
After Change
def test_real_full_sh_basis():
vertices = hemi_icosahedron.subdivide(2).vertices
mevals = np.array([[0.0015, 0.0003, 0.0003], [0.0015, 0.0003, 0.0003]])
angles = [(0, 0), (60, 0)]
odf = multi_tensor_odf(vertices, mevals, angles, [50, 50])
mevals = np.array([[0.0015, 0.0003, 0.0003]])
angles = [(0, 0)]
odf2 = multi_tensor_odf(-vertices, mevals, angles, [100])
sphere = Sphere(xyz=np.vstack((vertices, -vertices)))
// Asymmetric spherical function with 162 coefficients
sf = np.append(odf, odf2)
// In order for our approximation to be precise enough, we
// will use a SH basis of orders up to 10 (121 coefficients)
B, m, n = real_full_sh_basis(10, sphere.theta, sphere.phi)