VCoeff

class pylayers.antprop.spharm.VCoeff(typ, fmin=0.6, fmax=6, data=array([], dtype=float64), ind=array([], dtype=float64), k=array([], dtype=float64))[source]

Bases: object

Spherical Harmonics Coefficient

d = np.array [Nf,N+1,M+1]

s1 shape 1 np.array [ Nf x (N+1) x (M+1) ] s2 shape 2 np.array [ Nf x (N+1)*(M+1) ] s3 shape 3 np.array [ Nf x K ] ind [ K x 2]

Methods Summary

delete(ind, typ)

delete coeff

delete3(ind)

delete coeff.s3

inits1(data)

initialize shape 1 format

inits2(data)

initialize shape 2 format

inits3(data, ind, k)

initialize shape 3 format

plot([typ, title, xl, yl, log, stem, color])

put(typ)

recover last deleted coeff

put3(i, i3)

function put 3

s1tos2([L2])

convert shape 1 –> shape 2

s3tos2()

transform shape3 to shape 2

show([typ, k, L, M, kmax, seuildb, titre, …])

show coeff

Methods Documentation

delete(ind, typ)[source]

delete coeff

ind : int typ : int

2 shape 2 (Nf , N*M ) 3 shape 3 (Nf , K ) T ( K x 2 )

delete3(ind)[source]

delete coeff.s3

ind : int

inits1(data)[source]

initialize shape 1 format

data : shape 1 data

inits2(data)[source]

initialize shape 2 format

data : shape 2 data

inits3(data, ind, k)[source]

initialize shape 3 format

data : shape 3 data ind : ishape 3 indexing k : k

plot(typ='s3', title='', xl=False, yl=False, log=False, stem=True, color='b')[source]
put(typ)[source]

recover last deleted coeff

typint

2 : shape 2 (Nf , N*M ) 3 : shape 3 (Nf , K ) T ( K x 2 )

put3(i, i3)[source]

function put 3

i : int i3 : int

s1tos2(L2=-1)[source]

convert shape 1 –> shape 2

shape 1 array [ Nf , (L+1) , (M+1) ] shape 2 array [ Nf , (L+1) * (M+1) ]

l = 0…L2 m = 0…M2

L2int <= L1

shape 1 has 3 axis - shape 2 has 2 axis by default all s1 coefficients are kept L2=-1 means L2=min(L1,M1) because M2 must be equal to L2

index_vsh

s3tos2()[source]

transform shape3 to shape 2

s2 shape 2 array [ Nf x (L+1)*(M+1) ] s3 shape 3 array [ Nf x K ] ind [ K x 2]

The shape of s2 is (Lmax+1)*(Lmax+2)/2

k2 : is the list of conserved indices in shape 3 ind3 : np.array (K3, 2) are the conserved (l,m) indices

ind3 and k2 have one common dimension

show(typ='s1', k=0, L=-1, M=-1, kmax=1000, seuildb=50, titre='SHC', xl=True, yl=True, fontsize=14, dB=True, cmap=<matplotlib.colors.LinearSegmentedColormap object>, anim=True)[source]

show coeff

typstring

default (‘s1’) ‘s1’ shape 1 (Nf , N , M ) ‘s2’ shape 2 (Nf , N*M ) ‘s3’ shape 3 (Nf , K ) T ( K x 2 )

kinteger

frequency index default 0

N, M = maximal value for degree, mode respectively (not to be defined if ‘s2’ or ‘s3’)