from __future__ import division
f=2 #GHz(Frequency)
G=12 #dBi(Gain)
D=12 #dBi(Gain)
D=10**(D/10) #unitless(Directivity)
c=3*10**8 #m/s(speed of light)
lamda=c/(f*10**9) #m(wavelength)
Ap=D*lamda**2/7.5 #m²(capture area)
print "Required capture area = %0.4f m² "%Ap
from math import sqrt, atan, pi, log10
aEBYlamda=10 #(Aperture/wavelength)
del_EBYlamda=0.2 #in E-plane
del_HBYlamda=0.375 #in H-plane
LBYlamda=aEBYlamda**2/8/del_EBYlamda #(Length/wavelength)
print "Length of the horn is ",(LBYlamda),"*lamda"
aHBYlamda=sqrt(LBYlamda*8*del_HBYlamda) #(Aperture/wavelength)
print "H-plane aperture, aH is ",round(aHBYlamda,2),"*lamda"
theta_E=2*atan(aEBYlamda/2/LBYlamda)*180/pi #degree(Angle)
theta_H=2*atan(aHBYlamda/2/LBYlamda)*180/pi #degree(Angle)
print "Flare angles theta_E & theta_H = %0.2f & %0.2f degree "%(theta_E,theta_H)
HPBW_E=56/aEBYlamda #degree(HPBW for E-plane)
print "HPBW(E-plane) = %0.1f degree"%(HPBW_E)
HPBW_H=67/aHBYlamda #degree(HPBW for H-plane)
print "HPBW(H-plane) = %0.1f degree " %HPBW_H
FNBW_E=102/aEBYlamda #degree(FNBW for E-plane)
print "FNBW(E-plane) = %0.2f degree " %FNBW_E
FNBW_H=172/aHBYlamda #degree(FNBW for F-plane)
print "FNBW(H-plane) = %0.2f degree "%FNBW_H
D=10*log10(7.5*aEBYlamda*aHBYlamda) #(Directivity)
print "Directivity in dB : ", round(D,2)