original_docstring: 
      Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
  
      The CDF covers scattered (exit) angles ranging from 180 to 0 degrees.
      (The cosines are uniformly distributed over -1 to 1.) Because the angles
      are uniformly distributed in cos(theta), the scattering function is not
      sampled uniformly and therefore huge array sizes are needed to adequately
      sample highly anisotropic phase functions.
  
      Since this is a cumulative distribution function, the maximum value
      should be 1.
  
      Args:
          m: the complex index of refraction of the sphere
          x: the size parameter of the sphere
          num: length of desired CDF array
  
      Returns:
          mu: array of cosines of angles
          cdf: array of cumulative distribution function values
      
docstring: Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
  The CDF covers scattered (exit) angles ranging from 180 to 0 degrees.
  (The cosines are uniformly distributed over -1 to 1.) Because the angles
  are uniformly distributed in cos(theta), the scattering function is not
  sampled uniformly and therefore huge array sizes are needed to adequately
  sample highly anisotropic phase functions.
  
  Since this is a cumulative distribution function, the maximum value
  should be 1.
docstring_tokens: Create a CDF for unpolarized scattering uniformly spaced in cos ( theta ) . The CDF covers scattered ( exit ) angles ranging from 180 to 0 degrees . ( The cosines are uniformly distributed over - 1 to 1 . ) Because the angles are uniformly distributed in cos ( theta ) the scattering function is not sampled uniformly and therefore huge array sizes are needed to adequately sample highly anisotropic phase functions . Since this is a cumulative distribution function the maximum value should be 1 .
code: def mie_cdf(m, x, num):
      """
      Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
  
      The CDF covers scattered (exit) angles ranging from 180 to 0 degrees.
      (The cosines are uniformly distributed over -1 to 1.) Because the angles
      are uniformly distributed in cos(theta), the scattering function is not
      sampled uniformly and therefore huge array sizes are needed to adequately
      sample highly anisotropic phase functions.
  
      Since this is a cumulative distribution function, the maximum value
      should be 1.
  
      Args:
          m: the complex index of refraction of the sphere
          x: the size parameter of the sphere
          num: length of desired CDF array
  
      Returns:
          mu: array of cosines of angles
          cdf: array of cumulative distribution function values
      """
      mu = np.linspace(-1, 1, num)
      s1, s2 = mie_S1_S2(m, x, mu)
  
      s = (abs(s1)**2 + abs(s2)**2) / 2
  
      cdf = np.zeros(num)
      total = 0
      for i in range(num):
          # need the extra 2pi because scattering normalized over 4pi steradians
          total += s[i] * 2 * np.pi * (2 / num)
          cdf[i] = total
  
      return mu, cdf
code_tokens: def mie_cdf ( m , x , num ) : mu = np . linspace ( - 1 , 1 , num ) s1 , s2 = mie_S1_S2 ( m , x , mu ) s = ( abs ( s1 ) ** 2 + abs ( s2 ) ** 2 ) / 2 cdf = np . zeros ( num ) total = 0 for i in range ( num ) : total += s [ i ] * 2 * np . pi * ( 2 / num ) cdf [ i ] = total return mu , cdf
short_docstring: Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
short_docstring_tokens: Create a CDF for unpolarized scattering uniformly spaced in cos ( theta ) .
comment: """
      Create a CDF for unpolarized scattering uniformly spaced in cos(theta).
  
      The CDF covers scattered (exit) angles ranging from 180 to 0 degrees.
      (The cosines are uniformly distributed over -1 to 1.) Because the angles
      are uniformly distributed in cos(theta), the scattering function is not
      sampled uniformly and therefore huge array sizes are needed to adequately
      sample highly anisotropic phase functions.
  
      Since this is a cumulative distribution function, the maximum value
      should be 1.
  
      Args:
          m: the complex index of refraction of the sphere
          x: the size parameter of the sphere
          num: length of desired CDF array
  
      Returns:
          mu: array of cosines of angles
          cdf: array of cumulative distribution function values
      """$SEP$# need the extra 2pi because scattering normalized over 4pi steradians