Compute normalization factor for spherical harmonics.
(order, degree)
| 1524 | |
| 1525 | |
| 1526 | def _sph_harm_norm(order, degree): |
| 1527 | """Compute normalization factor for spherical harmonics.""" |
| 1528 | # we could use scipy.special.poch(degree + order + 1, -2 * order) |
| 1529 | # here, but it's slower for our fairly small degree |
| 1530 | norm = np.sqrt((2 * degree + 1.0) / (4 * np.pi)) |
| 1531 | if order != 0: |
| 1532 | norm *= np.sqrt(factorial(degree - order) / float(factorial(degree + order))) |
| 1533 | return norm |
| 1534 | |
| 1535 | |
| 1536 | def _concatenate_sph_coils(coils): |
no test coverage detected