def _sph_harm(order, degree, az, pol):
 from scipy.special import lpmv
 from .preprocessing.maxwell import _sph_harm_norm
 if (np.abs(order) > degree):
  raise ValueError('Absolute value of order must be <= degree')
 az = np.asarray(az)
 pol = np.asarray(pol)
 if (np.abs(az) > (2 * np.pi)).any():
  raise ValueError('Azimuth coords must lie in [-2*pi, 2*pi]')
 if ((pol < 0).any() or (pol > np.pi).any()):
  raise ValueError('Polar coords must lie in [0, pi]')
 sph = (lpmv(order, degree, np.cos(pol)) * np.exp(((1j * order) * az)))
 sph *= _sph_harm_norm(order, degree)
 return sph

def _sph_harm ( order , degree , az , pol ) : from scipy . special import lpmv from . preprocessing . maxwell import _sph_harm_norm if ( np . abs ( order ) > degree ) : raise ValueError ( 'Absolute value of order must be <= degree' ) az = np . asarray ( az ) pol = np . asarray ( pol ) if ( np . abs ( az ) > ( 2 * np . pi ) ) . any ( ) : raise ValueError ( 'Azimuth coords must lie in [-2*pi, 2*pi]' ) if ( ( pol < 0 ) . any ( ) or ( pol > np . pi ) . any ( ) ) : raise ValueError ( 'Polar coords must lie in [0, pi]' ) sph = ( lpmv ( order , degree , np . cos ( pol ) ) * np . exp ( ( ( 1j * order ) * az ) ) ) sph *= _sph_harm_norm ( order , degree ) return sph
evaluate point in specified multipolar moment .