Pattern

class pylayers.antprop.antenna.Pattern[source]

Bases: pylayers.util.project.PyLayers

Class Pattern

MetaClass of Antenna

A pattern is evaluated with the 3 np.array parameters

theta phi fGHz

This class implements pattern methods. The name of a pattern method starts by p. Each pattern method has a unique dictionnary argument ‘param’

If self.grid dimensions are

Nt x Np x Nf

else:

Ndir x Nf

Methods Summary

eval(**kwargs)

evaluate pattern functions

gain()

calculates antenna gain

plotG(**kwargs)

antenna plot gain in 2D

radF()

evaluate radiation fonction w.r.t polarization

ssh([L, dsf])

vsh([threshold])

Methods Documentation

eval(**kwargs)[source]

evaluate pattern functions

th: np.array

if this array is present it means grid = False

ph: np.array pt : np.array (3,N) pr : np.array (3,N) azoffset : int (0) Rfloor:bool

if true add gain value to reflected ray on the floor. values are append at the end of sqG.

fGHz:list

[]

nth: int

90

nph: int

181

first: boolean

True if first call (to define self.param)

th0float

theta initial value

th1float

theta finale value

ph0float

phi initial value

ph1float

phi final value

>>> from pylayers.antprop.aarray import *
>>> A0=Antenna('Omni', param={'pol':'t','GmaxdB':0})
>>> A1=Antenna('Gauss')
>>> A2=Antenna('3gpp')
>>> A3=ULArray()
>>> A0.eval()
>>> A1.eval()
>>> A2.eval()
>>> #A3.eval()
gain()[source]

calculates antenna gain

This function updates the following attributes

  • self.Gnp.array(Nt,Np,Nf) dtype:float
    linear gain

    or np.array(Nr,Nf)

  • self.sqGnp.array(Nt,Np,Nf) dtype:float
    linear sqare root of gain

    or np.array(Nr,Nf)

  • self.efficiencynp.array (,Nf) dtype:float

    efficiency

  • self.hpsternp.array (,Nf) dtype:float

    half power solid angle : 1 ~ 4pi steradian

  • self.ehpbwnp.array (,Nf) dtyp:float

    equivalent half power beamwidth (radians)

\[G(\theta,\phi) = |F_{\theta}|^2 + |F_{\phi}|^2\]
plotG(**kwargs)[source]

antenna plot gain in 2D

fGHz : frequency plan : ‘theta’ | ‘phi’ depending on the selected plan to be displayed angdeg : phi or theta in degrees, if plan==’phi’ it corresponds to theta GmaxdB : max gain to be displayed (20) polar : boolean dyn : 8 , legend : True, polar : boolean

linear or polar representation

topos : False, source :satimo, show : True, mode : string

‘index’ |

color: string

‘black’

fig ax

self.nth and self.nph has to be correctly set

>>> import matplotlib.pyplot as plt
>>> from pylayers.antprop.antenna import *
>>> A = Antenna('defant.vsh3')
>>> fig,ax = A.plotG(fGHz=[2,3,4],plan='theta',angdeg=0)
>>> fig,ax = A.plotG(fGHz=[2,3,4],plan='phi',angdeg=90)

(Source code)

radF()[source]

evaluate radiation fonction w.r.t polarization

self.pol : ‘t’ : theta , ‘p’ : phi n, ‘c’ : circular

ssh(L=89, dsf=1)[source]
vsh(threshold=-1)[source]