original_docstring: 
      Y = SphericalHarmonic_pOnly(n, m, alpha, sinbeta, cosbeta)
      	
      Computes a Spherical Harmonic function of order (m,n).
      Identical to SphericalHarmonic but does not compute the derivatives.
      	
      Arguments - these should all be scalars:
      r is radius
      alpha is azimuth angle (angle in radians from the positive x axis, with
      rotation around the positive z axis according to the right-hand screw rule)
      beta is polar angle, but it is specified as two arrays of its cos and sin values. 
      m and n should be integer scalars; n should be non-negative and m should be in the range -n<=m<=n
      	
      Returned data will be a vector of length (Order+1)^2.
      
      Associated Legendre function its derivatives for |m|:
      
docstring: Y = SphericalHarmonic_pOnly(n, m, alpha, sinbeta, cosbeta)
  Computes a Spherical Harmonic function of order (m,n).
  Identical to SphericalHarmonic but does not compute the derivatives.
  
  these should all be scalars:
  r is radius
  alpha is azimuth angle (angle in radians from the positive x axis, with
  rotation around the positive z axis according to the right-hand screw rule)
  beta is polar angle, but it is specified as two arrays of its cos and sin values.
  m and n should be integer scalars; n should be non-negative and m should be in the range -n<=m<=n
  
  Returned data will be a vector of length (Order+1)^2.
  
  Associated Legendre function its derivatives for |m|.
docstring_tokens: Y = SphericalHarmonic_pOnly ( n m alpha sinbeta cosbeta ) Computes a Spherical Harmonic function of order ( m n ) . Identical to SphericalHarmonic but does not compute the derivatives . these should all be scalars : r is radius alpha is azimuth angle ( angle in radians from the positive x axis with rotation around the positive z axis according to the right - hand screw rule ) beta is polar angle but it is specified as two arrays of its cos and sin values . m and n should be integer scalars ; n should be non - negative and m should be in the range - n< = m< = n Returned data will be a vector of length ( Order + 1 ) ^2 . Associated Legendre function its derivatives for |m| .
code: def spherical_harmonic_p0_only(n, m, alpha, sinbeta, cosbeta):
      '''
      Y = SphericalHarmonic_pOnly(n, m, alpha, sinbeta, cosbeta)
      	
      Computes a Spherical Harmonic function of order (m,n).
      Identical to SphericalHarmonic but does not compute the derivatives.
      	
      Arguments - these should all be scalars:
      r is radius
      alpha is azimuth angle (angle in radians from the positive x axis, with
      rotation around the positive z axis according to the right-hand screw rule)
      beta is polar angle, but it is specified as two arrays of its cos and sin values. 
      m and n should be integer scalars; n should be non-negative and m should be in the range -n<=m<=n
      	
      Returned data will be a vector of length (Order+1)^2.
      
      Associated Legendre function its derivatives for |m|:
      '''
      
      p_nm = lpmv(abs(m), n, cosbeta)
  
      # Compute scaling term, including sign factor:
      scaling_term = ((-1)**m) * np.sqrt((2 * n + 1) / (4 * np.pi * np.prod(np.float64(range(n-abs(m)+1, n+abs(m)+1)))))
  
      # Compute exponential term:
      exp_term = np.exp(1j*m*alpha)
      
      # Put it all together:
      y = scaling_term * exp_term * p_nm
  
      return y
code_tokens: def spherical_harmonic_p0_only ( n , m , alpha , sinbeta , cosbeta ) : p_nm = lpmv ( abs ( m ) , n , cosbeta ) scaling_term = ( ( - 1 ) ** m ) * np . sqrt ( ( 2 * n + 1 ) / ( 4 * np . pi * np . prod ( np . float64 ( range ( n - abs ( m ) + 1 , n + abs ( m ) + 1 ) ) ) ) ) exp_term = np . exp ( 1j * m * alpha ) y = scaling_term * exp_term * p_nm return y
short_docstring: Y = SphericalHarmonic_pOnly(n, m, alpha, sinbeta, cosbeta)
  Computes a Spherical Harmonic function of order (m,n).
short_docstring_tokens: Y = SphericalHarmonic_pOnly ( n m alpha sinbeta cosbeta ) Computes a Spherical Harmonic function of order ( m n ) .
comment: '''
      Y = SphericalHarmonic_pOnly(n, m, alpha, sinbeta, cosbeta)
      	
      Computes a Spherical Harmonic function of order (m,n).
      Identical to SphericalHarmonic but does not compute the derivatives.
      	
      Arguments - these should all be scalars:
      r is radius
      alpha is azimuth angle (angle in radians from the positive x axis, with
      rotation around the positive z axis according to the right-hand screw rule)
      beta is polar angle, but it is specified as two arrays of its cos and sin values. 
      m and n should be integer scalars; n should be non-negative and m should be in the range -n<=m<=n
      	
      Returned data will be a vector of length (Order+1)^2.
      
      Associated Legendre function its derivatives for |m|:
      '''$SEP$# Compute scaling term, including sign factor:$SEP$# Compute exponential term:$SEP$# Put it all together: