two_rays_curvedearthold

pylayers.antprop.loss.two_rays_curvedearthold(P, h0, h1, fGHz=2.4, **kwargs)[source]

P : float |list

if len(P) == 1 => P is a distance if len(P) == 4 => P is a list of [lon0,lat0,lon1,lat1]

where : lat0 : float |string

latitude first point (decimal |deg min sec Direction)

lat1float |string

latitude second point (decimal |deg min sec Direction)

lon0float |string

longitude first point (decimal |deg min sec Direction)

lon1float |string

longitude second point (decimal |deg min sec Direction)

h0float:

height of 1st point

h1float:

height of 2nd point

fGHzfloat

frequency (GHz)

kfloat

electromagnetic earth factor

GtdBfloat

Transmitter Antenna Gain (dB)

GrdBfloat

Receiver Antenna Gain (dB)

gammacomplex (-1.+0.j)

Reflexion coeff if eps and sig are not precised

‘pol’: string (‘v’)

polarization (‘v’|’h’)

‘eps’float ([])

lossless relative permittivity [],

‘sig’: float (0.)

conductivity

dBboolean (True)

return result in dB

P :

received power

>>> from pylayers.antprop.loss import *
>>> import matplotlib.pyplot as plt
>>> fGHz=2.4
>>> p0=np.array(([0,0,20]))
>>> p1=np.array(([0,1,20]))
>>> p0=p0.reshape(3,1)
>>> p1=p1.reshape(3,1)
>>> TRF = [] #Two Ray model on flat earth
>>> TRC = [] #Two Ray model on curved earth
>>> PLoss=[]
>>> for d in np.arange(1,10000,1):
>>>     p1[1,:]=d
>>>     TRF.append(two_rays_flatearth(p0[:,0],p1[:,0],fGHz,GtdB=0.,GrdB=0.,))
>>>     TRC.append(two_rays_curvedearth(d,p0[2,:],p1[2,:],fGHz))
>>>     PLoss.append(PL(fGHz, p0[:,0],p1[:,0], n=2.0, dB=True, d0=np.array([1])))
>>> PLoss=np.array(PLoss)[:,0,0]
>>> plt.semilogx(TRF,label='two-rays model flat earth')
>>> plt.semilogx(TRC,label='two-rays model curved earth')
>>> plt.semilogx(-PLoss,label='Path Loss')
>>> plt.legend()
>>> plt.show()

(Source code)