def test_spherical_conversions():
 (az, pol) = np.meshgrid(np.linspace(0, (2 * np.pi), 30), np.linspace(0, np.pi, 20))
 for degree in range(1, int_order):
  for order in range(0, (degree + 1)):
   sph = _get_sph_harm()(order, degree, az, pol)
   assert_allclose(_sh_negate(sph, order), _get_sph_harm()((- order), degree, az, pol))
   sph_real_pos = _sh_complex_to_real(sph, order)
   sph_real_neg = _sh_complex_to_real(sph, (- order))
   sph_2 = _sh_real_to_complex([sph_real_pos, sph_real_neg], order)
   assert_allclose(sph, sph_2, atol=1e-07)

def test_spherical_conversions ( ) : ( az , pol ) = np . meshgrid ( np . linspace ( 0 , ( 2 * np . pi ) , 30 ) , np . linspace ( 0 , np . pi , 20 ) ) for degree in range ( 1 , int_order ) : for order in range ( 0 , ( degree + 1 ) ) : sph = _get_sph_harm ( ) ( order , degree , az , pol ) assert_allclose ( _sh_negate ( sph , order ) , _get_sph_harm ( ) ( ( - order ) , degree , az , pol ) ) sph_real_pos = _sh_complex_to_real ( sph , order ) sph_real_neg = _sh_complex_to_real ( sph , ( - order ) ) sph_2 = _sh_real_to_complex ( [ sph_real_pos , sph_real_neg ] , order ) assert_allclose ( sph , sph_2 , atol = 1e-07 )
test spherical harmonic conversions .