Signatures

class pylayers.antprop.signature.Signatures(L, source, target, cutoff=3, threshold=0.6)[source]

Bases: pylayers.util.project.PyLayers, dict

set of Signature given 2 Gt cycle (convex) indices

L : gis.Layout source : int

source convex cycle

targetint

target convex cycle

Methods Summary

backtrace(tx, rx, M)

backtracing betwen tx and rx

calsig(G[, dia, cutoff])

calculates signature

check()

check signature

compl(lint, L)

completion from lint

exist(seq)

verifies if seq exists in signatures

image([tx])

Warning :

image2(tx)

determine rays from images (second implementation)

info()

load([filename])

load signatures

loadh5([filename])

load signatures hdf5 format

num()

determine the number of signatures

plot_cones(L[, i, s, fig, ax, figsize])

display cones of an unfolded signature

pltunfold(L[, i, s])

rays([ptx, prx])

from signatures dict to 2D rays

raysv([ptx, prx])

transform dict of signatures into 2D rays - default vectorized version

run(**kwargs)

evaluate signatures between cycle of tx and cycle of rx

save()

save signatures

saveh5()

save signatures in hdf5 format

show(L, **kwargs)

plot signatures in the simulated environment

showi([uni, us])

interactive show

sig2inter(L[, lsi])

convert signature to corresponding list of interactions in Gi

sig2prob(L, lsi)

get signatures probability

sp(G, source, target[, cutoff])

algorithm for signature determination

unfold(L[, i, s])

unfold a given signature

Methods Documentation

backtrace(tx, rx, M)[source]

backtracing betwen tx and rx

txndarray

position of tx (2,)

rxndarray

position of tx (2,)

Mdict

position of intermediate points obtained from self.image()

rayp : dict key = number_of_interactions value =ndarray positions of interactions for creating rays

dictionnary of intermediate coordinated : key = number_of_interactions value = nd array M with shape : (2,nb_signatures,nb_interactions) and 2 represent x and y coordinates

pylayers.antprop.signature.image

calsig(G, dia={}, cutoff=None)[source]

calculates signature

G : graph dia : dictionnary of interactions cutoff : integer

check()[source]

check signature

OK : np.array KO : np.array

compl(lint, L)[source]

completion from lint

lintlist

list of interactions

>>> Si.compl([(6220,3),(6262,3),(6241,3)],DL.L)
exist(seq)[source]

verifies if seq exists in signatures

seqlist of tuple

[(2,2),(5,3),(7,2)]

1 : Diffraction 2 : Reflexion 3 : Diffraction

>>> DL=DLink()
>>> DL.eval()
>>> seq = [(2,3)] # transmission through segment 2
>>> DL.Si.exist(seq)
image(tx=array([ 2.7, 12.5]))[source]

Warning :

txndarray

position of tx (2,)

M : dictionnary

dictionnary of intermediate coordinates key = number_of_interactions value = nd array M with shape : (2,nb_signatures,nb_interactions) and 2 represent x and y coordinates

image2(tx)[source]

determine rays from images (second implementation)

tx : point

info()[source]
load(filename=[])[source]

load signatures

loadh5(filename=[])[source]

load signatures hdf5 format

num()[source]

determine the number of signatures

plot_cones(L, i=0, s=0, fig=[], ax=[], figsize=(10, 10))[source]

display cones of an unfolded signature

L : Layout i : int

the interaction block

sint

the signature number in the block

fig : ax : figsize :

pltunfold(L, i=0, s=0)[source]
rays(ptx=0, prx=1)[source]

from signatures dict to 2D rays

ptxnumpy.array or int

Tx coordinates is the center of gravity of the cycle number if type(tx)=int

prxnumpy.array or int

Rx coordinates is the center of gravity of the cycle number if sigtype(rx)=int

rays : Rays

In the same time the signature of the ray is stored in the Rays object

Todo : Find the best memory implementation

Signature.sig2ray Signature.raysv

raysv(ptx=0, prx=1)[source]

transform dict of signatures into 2D rays - default vectorized version

ptxnumpy.array or int

Tx coordinates is the center of gravity of the cycle ptx if type(ptx)=int

prxnumpy.array or int

Rx coordinates is the center of gravity of the cycle prx if type(prx)=int

rays : Rays

This is a vectorized version of Signatures.rays. This implementation takes advantage of the np.ndarray and calculates images and backtrace for block of signatures. A block of signatures gathers all signatures with the same number of interactions.

For mathematical details see :

@phdthesis{amiot:tel-00971809,

TITLE = {{Design of simulation platform joigning site specific radio propagation and human mobility for localization applications}}, AUTHOR = {Amiot, Nicolas}, URL = {https://tel.archives-ouvertes.fr/tel-00971809}, NUMBER = {2013REN1S125}, SCHOOL = {{Universit{‘e} Rennes 1}}, YEAR = {2013}, MONTH = Dec, TYPE = {Theses}, HAL_ID = {tel-00971809}, HAL_VERSION = {v1},

}

Signatures.image Signatures.backtrace

run(**kwargs)[source]

evaluate signatures between cycle of tx and cycle of rx

cutoffint

limit the exploration of all_simple_path

btboolean

backtrace (allow to visit already visited nodes in simple path algorithm)

progressboolean

display the time passed in the loop

diffractionboolean

activate diffraction

thresholdfloat

for reducing calculation time

animations : boolean nD : int

maximum number of diffraction

nRint

maximum number of reflection

nTint

maximum number of transmission

pylayers.simul.link.Dlink.eval

save()[source]

save signatures

saveh5()[source]

save signatures in hdf5 format

show(L, **kwargs)[source]

plot signatures in the simulated environment

L : Layout i : list or -1 (default = all groups)

list of interaction group numbers

slist or -1 (default = all sig)

list of indices of signature in interaction group

ctx : cycle of tx (optional) crx : cycle of rx (optional) graph : type of graph to be displayed color : string alphasig : float widthsig : float colsig : string ms : int ctx : int crx :int

showi(uni=0, us=0)[source]

interactive show

press n to visit signatures sequentially

uni : index of interaction dictionnary keys us : signature index

sig2inter(L, lsi=[])[source]

convert signature to corresponding list of interactions in Gi

L : Layout lsi : nd.array

signature (2xnb_sig,sig_length)

>>> lsi = DL.Si[3]
>>> DL.Si.sig2inter(DL.L,lsi)
sig2prob(L, lsi)[source]

get signatures probability

L : Layout lsi : nd.array

signature (2xnb_sig,sig_length)

tlprobalist (nb_sig,sig_length-2)

output proba of each triplet of interaction

sp(G, source, target, cutoff=None)[source]

algorithm for signature determination

G : Graph source : tuple or int target : tuple or int cutoff : int

pylayers.antprop.signature.run3

unfold(L, i=0, s=0)[source]

unfold a given signature

return 2 np.ndarray of pta and phe “aligned” (reflexion interaction are mirrored)

L : Layout i : int

the interaction block

sint

the signature number in the block

pta,phe

Signature.unfold