original_docstring: 
      Calculate the integral used in the far field calculation.
      :param k: The wavenumber (rad/m).
      :param r: The distance to the field point (m).
      :param theta: The theta angle to the field point (rad).
      :param phi: The phi angle to the field point (rad).
      :param horn_width: The width of the horn (m).
      :param guide_height: The height of the waveguide feed (m).
      :param horn_effective_length: The effective length of the horn (m).
      :return: The integral used in far field calculations.
      
docstring: Calculate the integral used in the far field calculation.
docstring_tokens: Calculate the integral used in the far field calculation .
code: def I(k, r, theta, phi, horn_width, guide_height, horn_effective_length):
      """
      Calculate the integral used in the far field calculation.
      :param k: The wavenumber (rad/m).
      :param r: The distance to the field point (m).
      :param theta: The theta angle to the field point (rad).
      :param phi: The phi angle to the field point (rad).
      :param horn_width: The width of the horn (m).
      :param guide_height: The height of the waveguide feed (m).
      :param horn_effective_length: The effective length of the horn (m).
      :return: The integral used in far field calculations.
      """
      # Calculate the wavenumber prime and double prime terms
      kx_p = k * sin(theta) * cos(phi) + pi / horn_width
      kx_m = k * sin(theta) * cos(phi) - pi / horn_width
  
      # Phase terms for prime and double prime terms
      f1 = kx_p * kx_p * horn_effective_length / (2.0 * k)
      f2 = kx_m * kx_m * horn_effective_length / (2.0 * k)
  
      # Arguments of the Fresnel integrals for prime and double prime terms
      t1_p = sqrt(1.0 / (pi * k * horn_effective_length)) * (-k * horn_width * 0.5 - kx_p * horn_effective_length)
      t2_p = sqrt(1.0 / (pi * k * horn_effective_length)) * ( k * horn_width * 0.5 - kx_p * horn_effective_length)
  
      t1_m = sqrt(1.0 / (pi * k * horn_effective_length)) * (-k * horn_width * 0.5 - kx_m * horn_effective_length)
      t2_m = sqrt(1.0 / (pi * k * horn_effective_length)) * ( k * horn_width * 0.5 - kx_m * horn_effective_length)
  
      # Calculate the Fresnel sin and cos integrals
      s1p, c1p = fresnel(t1_p)
      s2p, c2p = fresnel(t2_p)
  
      s1m, c1m = fresnel(t1_m)
      s2m, c2m = fresnel(t2_m)
  
      return 1j * guide_height * sqrt(k * horn_effective_length / pi) / (8.0 * r) * exp(-1j * k * r) * \
             (((c2p - c1p) - 1j * (s2p - s1p)) * exp(1j * f1) + ((c2m - c1m) - 1j * (s2m - s1m)) * exp(1j * f2))
code_tokens: def I ( k , r , theta , phi , horn_width , guide_height , horn_effective_length ) : kx_p = k * sin ( theta ) * cos ( phi ) + pi / horn_width kx_m = k * sin ( theta ) * cos ( phi ) - pi / horn_width f1 = kx_p * kx_p * horn_effective_length / ( 2.0 * k ) f2 = kx_m * kx_m * horn_effective_length / ( 2.0 * k ) t1_p = sqrt ( 1.0 / ( pi * k * horn_effective_length ) ) * ( - k * horn_width * 0.5 - kx_p * horn_effective_length ) t2_p = sqrt ( 1.0 / ( pi * k * horn_effective_length ) ) * ( k * horn_width * 0.5 - kx_p * horn_effective_length ) t1_m = sqrt ( 1.0 / ( pi * k * horn_effective_length ) ) * ( - k * horn_width * 0.5 - kx_m * horn_effective_length ) t2_m = sqrt ( 1.0 / ( pi * k * horn_effective_length ) ) * ( k * horn_width * 0.5 - kx_m * horn_effective_length ) s1p , c1p = fresnel ( t1_p ) s2p , c2p = fresnel ( t2_p ) s1m , c1m = fresnel ( t1_m ) s2m , c2m = fresnel ( t2_m ) return 1j * guide_height * sqrt ( k * horn_effective_length / pi ) / ( 8.0 * r ) * exp ( - 1j * k * r ) * ( ( ( c2p - c1p ) - 1j * ( s2p - s1p ) ) * exp ( 1j * f1 ) + ( ( c2m - c1m ) - 1j * ( s2m - s1m ) ) * exp ( 1j * f2 ) )
short_docstring: Calculate the integral used in the far field calculation.
short_docstring_tokens: Calculate the integral used in the far field calculation .
comment: """
      Calculate the integral used in the far field calculation.
      :param k: The wavenumber (rad/m).
      :param r: The distance to the field point (m).
      :param theta: The theta angle to the field point (rad).
      :param phi: The phi angle to the field point (rad).
      :param horn_width: The width of the horn (m).
      :param guide_height: The height of the waveguide feed (m).
      :param horn_effective_length: The effective length of the horn (m).
      :return: The integral used in far field calculations.
      """$SEP$# Calculate the wavenumber prime and double prime terms$SEP$# Phase terms for prime and double prime terms$SEP$# Arguments of the Fresnel integrals for prime and double prime terms$SEP$# Calculate the Fresnel sin and cos integrals