import math
#Variable Declaration
El=50 #Elevation Angle(degrees)
h0=0.6 #Earth station altitude(km)
hr=3 #Rain height(km)
R01=10 #Point Rain Rate(mm/hr)
f=12 #frequency(GHz)
ah=0.0188
bh=1.217
av=0.0168
bv=1.2
#Calculation
Ls=(hr-h0)/math.sin(El*3.142/180) #Slant path length(km)
LG=Ls*math.cos(El*3.142/180) #Horizontal projection(km)
r01=90/(90+4*LG) #Reduction factor
L=Ls*r01 #Effective path length(km)
alphah=ah*R01**bh #Specific Attenuation
AdBh=round(alphah*L,2)#Rain Attenuation for horizontal polarization
alphav=av*R01**bv #Specific Attenuation
AdBv=round(alphav*L,2)#Rain Attenuation for vertical polarization
#Results
print"Rain Attenuation for given conditions and horizontal polarization is",AdBh,"dB"
print"Rain Attenuation for given conditions and vertical polarization is",AdBv,"dB"
import math
#Variable Declaration
ah=0.0188
bh=1.217
av=0.0168
bv=1.2
R01=10 #Point Rain Rate(mm/hr)
L=2.8753812 #Effective path length calculated in Example 4.1(km)
#Calculation
#Factors depending on frequency and polarization
ac=(ah+av)/2 #a for circular polarization
bc=(ah*bh+av*bv)/(2*ac) #b for circular polarization
alpha=ac*R01**bc #Specific Attenuation(dB)
AdB=round(alpha*L,2) #Rain Attenuation(dB)
#Results
print "The Rain Attenuation for circular polarization is",AdB,"dB"