1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
Tous ses dictionnaires dans stockés dans le script "pm3.py" que j'importe bien sur.
alpha = {1 :3.356386, 6:2.707807, 7:2.830545, 8:3.217102}
K = {
1: [ 1.128750,-1.060329, 0.000000, 0.000000],
6: [ 0.050107,0.050733, 0.000000, 0.000000],
7: [ 1.501674,-1.505772, 0.000000, 0.000000],
8: [-1.131128, 1.137891, 0.000000, 0.000000],
}
L = {
1: [5.096282, 6.003788, 0.000000, 0.000000],
6: [6.003165, 6.002979, 0.000000, 0.000000],
7: [5.901148, 6.004658, 0.000000, 0.000000],
8: [6.002477, 5.950512, 0.000000, 0.000000],
}
M = {
1: [1.537465, 1.570189, 0.000000, 0.000000],
6: [1.642214, 0.892488, 0.000000, 0.000000],
7: [1.710740, 1.716149, 0.000000, 0.000000],
8: [1.607311, 1.598395, 0.000000, 0.000000],
}
def dictToArray(alpha,K, L, M):
tableau = []
for cle in [1,6,7,8]:
tableau.append(alpha[cle])
for cle in [1,6,7,8]:
tableau += K[cle]
for cle in [1,6,7,8]:
tableau += L[cle]
for cle in [1,6,7,8]:
tableau += M[cle]
tableau = numpy.array(tableau)
return tableau
def arrayToDict(tableau):
counter = 0
alpha = {}
for cle in [1,6,7,8]:
K[cle] = tableau[counter : counter + len( (pm3.K)[cle] ) ]
print K |
Partager