Convert real spherical harmonic pair to complex. Parameters ---------- shs : ndarray, shape (2, ...) The real spherical harmonics at ``[order, -order]``. order : int Order (usually 'm') of multipolar moment. Returns ------- sh : array-like, shape (...)
(shs, order)
| 915 | |
| 916 | |
| 917 | def _sh_real_to_complex(shs, order): |
| 918 | """Convert real spherical harmonic pair to complex. |
| 919 | |
| 920 | Parameters |
| 921 | ---------- |
| 922 | shs : ndarray, shape (2, ...) |
| 923 | The real spherical harmonics at ``[order, -order]``. |
| 924 | order : int |
| 925 | Order (usually 'm') of multipolar moment. |
| 926 | |
| 927 | Returns |
| 928 | ------- |
| 929 | sh : array-like, shape (...) |
| 930 | The complex version of the spherical harmonics. |
| 931 | """ |
| 932 | if order == 0: |
| 933 | return shs[0] |
| 934 | else: |
| 935 | return (shs[0] + 1j * np.sign(order) * shs[1]) / np.sqrt(2.0) |
| 936 | |
| 937 | |
| 938 | def _compute_sph_harm(order, az, pol): |