#===============================================================================
-# Recuperation donn�es utilisateurs - User data
+# Recuperation donnees utilisateurs - User data
#===============================================================================
+# Lecture du fichier PSENConfig - > sauvegarde avec le nom en du
- #extract laws from Eficas Output
+ #extract laws from Eficas Output PSENconfig est le fichier qui continent le dico
Paths = PSENconfig.Dico['DIRECTORY']
SimuParams = PSENconfig.Dico['SIMULATION']
if PSENconfig.Dico.has_key('CORRELATION'):
NonActiveIndices.append(LawNames.index(shortkey))
+ # Travail sur la Matrice de correlatin
+ # remplit CorrMatrix
+ # --> creation d un dictionnaire
+ # clef = matrice = la matrice entree par l utilisateur mois les laws non actives, et si timeserie on a juste 1 dans la diagonale
+
if PSENconfig.Dico.has_key('CORRELATION'):
#Treat Correlation Matrix - eliminate non-activated laws
CorrMatrix0 = {}
CorrMatrix0['laws'] = LawNames2
else: #acceptable only if all active distributions are time series or if only 1 active distribution
+ # a supprimer
if len(Laws)==1: #create correlation matrix of 1 x 1
CorrMatrix0 = {}
#CorrMaxtrix0['matrix'][i][i] = 1
#retreat CorrelationMatrix
- if isDuplicateLaws:
- CorrMatrix = {}
- CorrMatrix['laws']=Laws.keys()
- CorrMatrix['matrix']=np.eye(len(Laws.keys()))
- for x,lawname1 in enumerate(Laws.keys()):
- for i,lawname1_0 in enumerate(CorrMatrix0['laws']):
- if lawname1_0 in lawname1:
- break
- for y, lawname2 in enumerate(Laws.keys()):
- for j,lawname2_0 in enumerate(CorrMatrix0['laws']):
- if lawname2_0 in lawname2:
- break
- if x!=y:
- CorrMatrix['matrix'][x][y] = CorrMatrix0['matrix'][i][j]
- CorrMatrix['matrix'][y][x] = CorrMatrix0['matrix'][j][i]
+ #if isDuplicateLaws:
+ # CorrMatrix = {}
+ # CorrMatrix['laws']=Laws.keys()
+ # CorrMatrix['matrix']=np.eye(len(Laws.keys()))
+ # for x,lawname1 in enumerate(Laws.keys()):
+ # for i,lawname1_0 in enumerate(CorrMatrix0['laws']):
+ # if lawname1_0 in lawname1:
+ # break
+ # for y, lawname2 in enumerate(Laws.keys()):
+ # for j,lawname2_0 in enumerate(CorrMatrix0['laws']):
+ # if lawname2_0 in lawname2:
+ # break
+ # if x!=y:
+ # CorrMatrix['matrix'][x][y] = CorrMatrix0['matrix'][i][j]
+ # CorrMatrix['matrix'][y][x] = CorrMatrix0['matrix'][j][i]
## if i==j:
## CorrMatrix['matrix'][x][y] = 0
## CorrMatrix['matrix'][y][x] = 0
## else:
## CorrMatrix['matrix'][x][y] = CorrMatrix0['matrix'][i][j]
## CorrMatrix['matrix'][y][x] = CorrMatrix0['matrix'][j][i]
- else:
- CorrMatrix = CorrMatrix0
+ #else:
+ # CorrMatrix = CorrMatrix0
+
+ CorrMatrix = CorrMatrix0
#retest for positive definiteness
- if not np.all(np.linalg.eigvals(CorrMatrix['matrix'])>0):
- print 'Error: Correlation matrix is not positive definite.'
- sys.exit(1)
+ #if not np.all(np.linalg.eigvals(CorrMatrix['matrix'])>0):
+ # print 'Error: Correlation matrix is not positive definite.'
+ # sys.exit(1)
#execution file name