MCPcopy
hub / github.com/mne-tools/mne-python / _compute_sph_harm

Function _compute_sph_harm

mne/transforms.py:938–950  ·  view source on GitHub ↗

Compute complex spherical harmonics of spherical coordinates.

(order, az, pol)

Source from the content-addressed store, hash-verified

936
937
938def _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###############################################################################

Callers 1

fitMethod · 0.85

Calls 5

_get_n_momentsFunction · 0.85
sph_harm_yFunction · 0.85
_deg_ord_idxFunction · 0.85
_sh_complex_to_realFunction · 0.85
_sh_negateFunction · 0.85

Tested by

no test coverage detected