Compute complex spherical harmonics of spherical coordinates.
(order, az, pol)
| 936 | |
| 937 | |
| 938 | def _compute_sph_harm(order, az, pol): |
| 939 | """Compute complex spherical harmonics of spherical coordinates.""" |
| 940 | out = np.empty((len(az), _get_n_moments(order) + 1)) |
| 941 | # _deg_ord_idx(0, 0) = -1 so we're actually okay to use it here |
| 942 | for degree in range(order + 1): |
| 943 | for order_ in range(degree + 1): |
| 944 | sph = sph_harm_y(degree, order_, pol, az) |
| 945 | out[:, _deg_ord_idx(degree, order_)] = _sh_complex_to_real(sph, order_) |
| 946 | if order_ > 0: |
| 947 | out[:, _deg_ord_idx(degree, -order_)] = _sh_complex_to_real( |
| 948 | _sh_negate(sph, order_), -order_ |
| 949 | ) |
| 950 | return out |
| 951 | |
| 952 | |
| 953 | ############################################################################### |
no test coverage detected