def CostFunction(x):
_X = numpy.asmatrix(numpy.ravel( x )).T
if self._parameters["StoreInternalVariables"] or \
- "CurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CurrentState") or \
+ self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentState"].store( _X )
_HX = Hm( _X )
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
_Innovation = Y - _HX
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
- if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("InnovationAtCurrentState"):
self.StoredVariables["InnovationAtCurrentState"].store( _Innovation )
#
Jb = float( 0.5 * (_X - Xb).T * BI * (_X - Xb) )
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum") or \
+ self._toStore("CurrentOptimum") or \
+ self._toStore("CostFunctionJAtCurrentOptimum") or \
+ self._toStore("CostFunctionJbAtCurrentOptimum") or \
+ self._toStore("CostFunctionJoAtCurrentOptimum") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
IndexMin = numpy.argmin( self.StoredVariables["CostFunctionJ"][nbPreviousSteps:] ) + nbPreviousSteps
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum"):
self.StoredVariables["IndexOfOptimum"].store( IndexMin )
- if "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentOptimum"].store( self.StoredVariables["CurrentState"][IndexMin] )
- if "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentOptimum"].store( self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin] )
- if "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJAtCurrentOptimum"):
self.StoredVariables["CostFunctionJAtCurrentOptimum" ].store( self.StoredVariables["CostFunctionJ" ][IndexMin] )
- if "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJbAtCurrentOptimum"):
self.StoredVariables["CostFunctionJbAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJb"][IndexMin] )
- if "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJoAtCurrentOptimum"):
self.StoredVariables["CostFunctionJoAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJo"][IndexMin] )
return J
#
#
# Correction pour pallier a un bug de TNC sur le retour du Minimum
# ----------------------------------------------------------------
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
Minimum = self.StoredVariables["CurrentState"][IndexMin]
#
# Obtention de l'analyse
#
self.StoredVariables["Analysis"].store( Xa.A1 )
#
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA") or \
+ self._toStore("SigmaObs2") or \
+ self._toStore("SimulationQuantiles") or \
+ self._toStore("SimulatedObservationAtOptimum"):
+ if self._toStore("SimulatedObservationAtCurrentState"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin]
- elif "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ elif self._toStore("SimulatedObservationAtCurrentOptimum"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
else:
HXa = Hm(Xa)
#
# Calcul de la covariance d'analyse
# ---------------------------------
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance") or \
+ self._toStore("SimulationQuantiles"):
HtM = HO["Tangent"].asMatrix(ValueForMethodForm = Xa)
HtM = HtM.reshape(Y.size,Xa.size) # ADAO & check shape
HaM = HO["Adjoint"].asMatrix(ValueForMethodForm = Xa)
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"] or \
- "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \
- "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation") or \
+ self._toStore("SigmaObs2") or \
+ self._toStore("MahalanobisConsistency") or \
+ self._toStore("OMB"):
d = Y - HXb
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y) - numpy.ravel(HXa) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SigmaObs2"):
TraceR = R.trace(Y.size)
self.StoredVariables["SigmaObs2"].store( float( (d.T * (numpy.asmatrix(numpy.ravel(Y)).T-numpy.asmatrix(numpy.ravel(HXa)).T)) ) / TraceR )
- if "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("MahalanobisConsistency"):
self.StoredVariables["MahalanobisConsistency"].store( float( 2.*MinJ/d.size ) )
- if "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulationQuantiles"):
nech = self._parameters["NumberOfSamplesForQuantiles"]
HXa = numpy.matrix(numpy.ravel( HXa )).T
YfQ = None
if YQ is None: YQ = YfQ[:,indice]
else: YQ = numpy.hstack((YQ,YfQ[:,indice]))
self.StoredVariables["SimulationQuantiles"].store( YQ )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
def CostFunction(x):
_X = numpy.asmatrix(numpy.ravel( x )).T
if self._parameters["StoreInternalVariables"] or \
- "CurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CurrentState") or \
+ self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentState"].store( _X )
Jb = 0.5 * (_X - Xb).T * BI * (_X - Xb)
self.DirectCalculation = [None,]
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum") or \
+ self._toStore("CurrentOptimum") or \
+ self._toStore("CostFunctionJAtCurrentOptimum") or \
+ self._toStore("CostFunctionJbAtCurrentOptimum") or \
+ self._toStore("CostFunctionJoAtCurrentOptimum"):
IndexMin = numpy.argmin( self.StoredVariables["CostFunctionJ"][nbPreviousSteps:] ) + nbPreviousSteps
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum"):
self.StoredVariables["IndexOfOptimum"].store( IndexMin )
- if "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentOptimum"].store( self.StoredVariables["CurrentState"][IndexMin] )
- if "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJAtCurrentOptimum"):
self.StoredVariables["CostFunctionJAtCurrentOptimum" ].store( self.StoredVariables["CostFunctionJ" ][IndexMin] )
- if "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJbAtCurrentOptimum"):
self.StoredVariables["CostFunctionJbAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJb"][IndexMin] )
- if "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJoAtCurrentOptimum"):
self.StoredVariables["CostFunctionJoAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJo"][IndexMin] )
return J
#
#
# Correction pour pallier a un bug de TNC sur le retour du Minimum
# ----------------------------------------------------------------
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
Minimum = self.StoredVariables["CurrentState"][IndexMin]
#
# Obtention de l'analyse
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
#
self._post_run(HO)
Y = numpy.asmatrix(numpy.ravel( Hm( X ) )).T
Y = numpy.asmatrix(numpy.ravel( Y )).T
NormeY = numpy.linalg.norm( Y )
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(X) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(Y) )
#
if len(self._parameters["InitialDirection"]) == 0:
# Calcul de la fonction coût
# --------------------------
if self._parameters["StoreInternalVariables"] or \
- "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \
- "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CostFunctionJ") or \
+ self._toStore("OMA") or \
+ self._toStore("SigmaObs2") or \
+ self._toStore("MahalanobisConsistency") or \
+ self._toStore("SimulatedObservationAtCurrentState") or \
+ self._toStore("SimulatedObservationAtOptimum") or \
+ self._toStore("SimulationQuantiles"):
HXa = Hm * Xa
oma = Y - HXa
if self._parameters["StoreInternalVariables"] or \
- "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \
- "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CostFunctionJ") or \
+ self._toStore("MahalanobisConsistency"):
Jb = float( 0.5 * (Xa - Xb).T * BI * (Xa - Xb) )
Jo = float( 0.5 * oma.T * RI * oma )
J = Jb + Jo
#
# Calcul de la covariance d'analyse
# ---------------------------------
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance") or \
+ self._toStore("SimulationQuantiles"):
if (Y.size <= Xb.size): K = B * Ha * (R + Hm * B * Ha).I
elif (Y.size > Xb.size): K = (BI + Ha * RI * Hm).I * Ha * RI
A = B - K * Hm * B
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xa) )
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(oma) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SigmaObs2"):
TraceR = R.trace(Y.size)
self.StoredVariables["SigmaObs2"].store( float( (d.T * (numpy.asmatrix(numpy.ravel(oma)).T)) ) / TraceR )
- if "SigmaBck2" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SigmaBck2"):
self.StoredVariables["SigmaBck2"].store( float( (d.T * Hm * (Xa - Xb))/(Hm * B * Hm.T).trace() ) )
- if "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("MahalanobisConsistency"):
self.StoredVariables["MahalanobisConsistency"].store( float( 2.*J/d.size ) )
- if "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulationQuantiles"):
nech = self._parameters["NumberOfSamplesForQuantiles"]
YfQ = None
for i in range(nech):
if YQ is None: YQ = YfQ[:,indice]
else: YQ = numpy.hstack((YQ,YfQ[:,indice]))
self.StoredVariables["SimulationQuantiles"].store( YQ )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(HXa) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
_HX = Hm( _X )
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
_Innovation = Y - _HX
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
- if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("InnovationAtCurrentState"):
self.StoredVariables["InnovationAtCurrentState"].store( _Innovation )
#
if QualityMeasure in ["AugmentedWeightedLeastSquares","AWLS","DA"]:
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum") or \
+ self._toStore("CurrentOptimum") or \
+ self._toStore("CostFunctionJAtCurrentOptimum") or \
+ self._toStore("CostFunctionJbAtCurrentOptimum") or \
+ self._toStore("CostFunctionJoAtCurrentOptimum") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
IndexMin = numpy.argmin( self.StoredVariables["CostFunctionJ"][nbPreviousSteps:] ) + nbPreviousSteps
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum"):
self.StoredVariables["IndexOfOptimum"].store( IndexMin )
- if "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentOptimum"].store( self.StoredVariables["CurrentState"][IndexMin] )
- if "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentOptimum"].store( self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin] )
- if "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJAtCurrentOptimum"):
self.StoredVariables["CostFunctionJAtCurrentOptimum" ].store( self.StoredVariables["CostFunctionJ" ][IndexMin] )
- if "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJbAtCurrentOptimum"):
self.StoredVariables["CostFunctionJbAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJb"][IndexMin] )
- if "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJoAtCurrentOptimum"):
self.StoredVariables["CostFunctionJoAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJo"][IndexMin] )
return J
#
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA" ) or \
+ self._toStore("SimulatedObservationAtOptimum"):
+ if self._toStore("SimulatedObservationAtCurrentState"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin]
- elif "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ elif self._toStore("SimulatedObservationAtCurrentOptimum"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
else:
HXa = Hm(Xa)
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation") or \
+ self._toStore("OMB"):
d = Y - HXb
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y) - numpy.ravel(HXa) )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(Hm(Xb)) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run()
_HX = Hm( _X )
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
_Innovation = Y - _HX
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
- if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("InnovationAtCurrentState"):
self.StoredVariables["InnovationAtCurrentState"].store( _Innovation )
#
if QualityMeasure in ["AugmentedWeightedLeastSquares","AWLS","DA"]:
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum") or \
+ self._toStore("CurrentOptimum") or \
+ self._toStore("CostFunctionJAtCurrentOptimum") or \
+ self._toStore("CostFunctionJbAtCurrentOptimum") or \
+ self._toStore("CostFunctionJoAtCurrentOptimum") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
IndexMin = numpy.argmin( self.StoredVariables["CostFunctionJ"][nbPreviousSteps:] ) + nbPreviousSteps
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum"):
self.StoredVariables["IndexOfOptimum"].store( IndexMin )
- if "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentOptimum"].store( self.StoredVariables["CurrentState"][IndexMin] )
- if "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentOptimum"].store( self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin] )
- if "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJAtCurrentOptimum"):
self.StoredVariables["CostFunctionJAtCurrentOptimum" ].store( self.StoredVariables["CostFunctionJ" ][IndexMin] )
- if "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJbAtCurrentOptimum"):
self.StoredVariables["CostFunctionJbAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJb"][IndexMin] )
- if "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJoAtCurrentOptimum"):
self.StoredVariables["CostFunctionJoAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJo"][IndexMin] )
return J
#
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA") or self._toStore("SimulatedObservationAtOptimum"):
+ if self._toStore("SimulatedObservationAtCurrentState"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin]
- elif "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ elif self._toStore("SimulatedObservationAtCurrentOptimum"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
else:
HXa = Hm(Xa)
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation") or \
+ self._toStore("OMB"):
d = Y - HXb
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y) - numpy.ravel(HXa) )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(Hm(Xb)) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run()
# -----------------------------------------------
for iens in range(nb_ens):
HXb = Hm * Xb[iens]
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
d = EnsembleY[:,iens] - HXb
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
Xa = Xb[iens] + K*d
self.StoredVariables["CurrentState"].store( Xa )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( Hm * Xa )
#
# Fabrication de l'analyse
Members = self.StoredVariables["CurrentState"][-nb_ens:]
Xa = numpy.matrix( Members ).mean(axis=0)
self.StoredVariables["Analysis"].store( Xa.A1 )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel( Hm * Xa ) )
#
self._post_run(HO)
#
# Précalcul des inversions de B et R
# ----------------------------------
- if self._parameters["StoreInternalVariables"] \
- or "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] \
- or "CostFunctionJb" in self._parameters["StoreSupplementaryCalculations"] \
- or "CostFunctionJo" in self._parameters["StoreSupplementaryCalculations"] \
- or "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or \
+ self._toStore("CostFunctionJ") or \
+ self._toStore("CostFunctionJb") or \
+ self._toStore("CostFunctionJo") or \
+ self._toStore("APosterioriCovariance"):
BI = B.getI()
RI = R.getI()
BIdemi = B.choleskyI()
else: Qn = Q
#
self.StoredVariables["Analysis"].store( Xb.A1 )
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
self.StoredVariables["APosterioriCovariance"].store( Pn )
covarianceXa = Pn
Xa = Xb
self.StoredVariables["Analysis"].store( Xa )
#
del Yo, PfHT, HPfHT
- if self._parameters["StoreInternalVariables"] \
- or "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] \
- or "CostFunctionJb" in self._parameters["StoreSupplementaryCalculations"] \
- or "CostFunctionJo" in self._parameters["StoreSupplementaryCalculations"] \
- or "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"] \
- or "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or \
+ self._toStore("CostFunctionJ") or \
+ self._toStore("CostFunctionJb") or \
+ self._toStore("CostFunctionJo") or \
+ self._toStore("APosterioriCovariance") or \
+ self._toStore("Innovation"):
d = Ynpu - numpy.asmatrix(numpy.ravel( H((Xa, Un)) )).T
self.StoredVariables["Innovation"].store( d )
if self._parameters["StoreInternalVariables"] \
- or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( Xn )
- if self._parameters["StoreInternalVariables"] \
- or "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] \
- or "CostFunctionJb" in self._parameters["StoreSupplementaryCalculations"] \
- or "CostFunctionJo" in self._parameters["StoreSupplementaryCalculations"] \
- or "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or \
+ self._toStore("CostFunctionJ") or \
+ self._toStore("CostFunctionJb") or \
+ self._toStore("CostFunctionJo") or \
+ self._toStore("APosterioriCovariance"):
Jb = 0.5 * (Xa - Xb).T * BI * (Xa - Xb)
Jo = 0.5 * d.T * RI * d
J = float( Jb ) + float( Jo )
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
Ht = HO["Tangent"].asMatrix(ValueForMethodForm = Xa)
Ht = Ht.reshape(__p,__n) # ADAO & check shape
Pf = 0.
# ----------------------------------------------------------------
if self._parameters["EstimationOf"] == "Parameters":
self.StoredVariables["Analysis"].store( Xa.A1 )
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
self.StoredVariables["APosterioriCovariance"].store( covarianceXa )
#
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
#
self._post_run(HO)
# Calcul de la fonction coût
# --------------------------
if self._parameters["StoreInternalVariables"] or \
- "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \
- "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CostFunctionJ") or \
+ self._toStore("OMA") or \
+ self._toStore("SigmaObs2") or \
+ self._toStore("MahalanobisConsistency") or \
+ self._toStore("SimulatedObservationAtCurrentState") or \
+ self._toStore("SimulatedObservationAtOptimum") or \
+ self._toStore("SimulationQuantiles"):
HXa = numpy.matrix(numpy.ravel( H( Xa ) )).T
oma = Y - HXa
if self._parameters["StoreInternalVariables"] or \
- "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \
- "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CostFunctionJ") or \
+ self._toStore("MahalanobisConsistency"):
Jb = float( 0.5 * (Xa - Xb).T * BI * (Xa - Xb) )
Jo = float( 0.5 * oma.T * RI * oma )
J = Jb + Jo
#
# Calcul de la covariance d'analyse
# ---------------------------------
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance") or \
+ self._toStore("SimulationQuantiles"):
if (Y.size <= Xb.size): K = B * Ha * (R + Hm * B * Ha).I
elif (Y.size > Xb.size): K = (BI + Ha * RI * Hm).I * Ha * RI
A = B - K * Hm * B
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xa) )
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(oma) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SigmaObs2"):
TraceR = R.trace(Y.size)
self.StoredVariables["SigmaObs2"].store( float( (d.T * (numpy.asmatrix(numpy.ravel(oma)).T)) ) / TraceR )
- if "SigmaBck2" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SigmaBck2"):
self.StoredVariables["SigmaBck2"].store( float( (d.T * Hm * (Xa - Xb))/(Hm * B * Hm.T).trace() ) )
- if "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("MahalanobisConsistency"):
self.StoredVariables["MahalanobisConsistency"].store( float( 2.*J/d.size ) )
- if "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulationQuantiles"):
nech = self._parameters["NumberOfSamplesForQuantiles"]
HtM = HO["Tangent"].asMatrix(ValueForMethodForm = Xa)
HtM = HtM.reshape(Y.size,Xa.size) # ADAO & check shape
if YQ is None: YQ = YfQ[:,indice]
else: YQ = numpy.hstack((YQ,YfQ[:,indice]))
self.StoredVariables["SimulationQuantiles"].store( YQ )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(HXa) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
# ----------
Ys = []
for i in range(self._parameters["NumberOfRepetition"]):
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
print(" %s\n"%("-"*75,))
if self._parameters["NumberOfRepetition"] > 1:
msgs += (" Standard error.....: %."+str(_p)+"e\n")%numpy.std( Yn, dtype=mfp )
msgs += (" L2 norm of vector..: %."+str(_p)+"e\n")%numpy.linalg.norm( Yn )
print(msgs)
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(Yn) )
#
Ys.append( copy.copy( numpy.ravel(
FX = numpy.asmatrix(numpy.ravel( Hm( X ) )).T
NormeX = numpy.linalg.norm( X )
NormeFX = numpy.linalg.norm( FX )
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) )
#
if len(self._parameters["InitialDirection"]) == 0:
FX_plus_dX = Hm( X + dX )
FX_plus_dX = numpy.asmatrix(numpy.ravel( FX_plus_dX )).T
#
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(X + dX) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
#
NormedX = numpy.linalg.norm( dX )
# Calcul de la fonction coût
# --------------------------
if self._parameters["StoreInternalVariables"] or \
- "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CostFunctionJ") or \
+ self._toStore("OMA") or \
+ self._toStore("SimulatedObservationAtOptimum"):
HXa = Hm * Xa
oma = Y - HXa
if self._parameters["StoreInternalVariables"] or \
- "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CostFunctionJ"):
Jb = 0.
Jo = 0.5 * oma.T * RI * oma
J = float( Jb ) + float( Jo )
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(oma) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(HXa) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
FX = numpy.asmatrix(numpy.ravel( Hm( Xn ) )).T
NormeX = numpy.linalg.norm( Xn )
NormeFX = numpy.linalg.norm( FX )
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) )
#
# Fabrication de la direction de l'increment dX
dX = amplitude * dX0
#
if self._parameters["ResiduFormula"] == "CenteredDL":
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn - dX) )
#
FX_plus_dX = numpy.asmatrix(numpy.ravel( Hm( Xn + dX ) )).T
FX_moins_dX = numpy.asmatrix(numpy.ravel( Hm( Xn - dX ) )).T
#
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_moins_dX) )
#
msgs += "\n" + __marge + msg
#
if self._parameters["ResiduFormula"] == "Taylor":
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
#
FX_plus_dX = numpy.asmatrix(numpy.ravel( Hm( Xn + dX ) )).T
#
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
#
Residu = numpy.linalg.norm( FX_plus_dX - FX - amplitude * GradFxdX ) / NormeFX
msgs += "\n" + __marge + msg
#
if self._parameters["ResiduFormula"] == "NominalTaylor":
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn - dX) )
self.StoredVariables["CurrentState"].store( numpy.ravel(dX) )
FX_moins_dX = numpy.asmatrix(numpy.ravel( Hm( Xn - dX ) )).T
FdX = numpy.asmatrix(numpy.ravel( Hm( dX ) )).T
#
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_moins_dX) )
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FdX) )
msgs += "\n" + __marge + msg
#
if self._parameters["ResiduFormula"] == "NominalTaylorRMS":
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn - dX) )
self.StoredVariables["CurrentState"].store( numpy.ravel(dX) )
FX_moins_dX = numpy.asmatrix(numpy.ravel( Hm( Xn - dX ) )).T
FdX = numpy.asmatrix(numpy.ravel( Hm( dX ) )).T
#
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_moins_dX) )
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FdX) )
def CostFunction(x):
_X = numpy.asmatrix(numpy.ravel( x )).T
if self._parameters["StoreInternalVariables"] or \
- "CurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CurrentState") or \
+ self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentState"].store( _X )
_HX = Hm( _X )
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
_Innovation = Y - _HX
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
- if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("InnovationAtCurrentState"):
self.StoredVariables["InnovationAtCurrentState"].store( _Innovation )
#
Jb = 0.
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum") or \
+ self._toStore("CurrentOptimum") or \
+ self._toStore("CostFunctionJAtCurrentOptimum") or \
+ self._toStore("CostFunctionJbAtCurrentOptimum") or \
+ self._toStore("CostFunctionJoAtCurrentOptimum") or \
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
IndexMin = numpy.argmin( self.StoredVariables["CostFunctionJ"][nbPreviousSteps:] ) + nbPreviousSteps
- if "IndexOfOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("IndexOfOptimum"):
self.StoredVariables["IndexOfOptimum"].store( IndexMin )
- if "CurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentOptimum"):
self.StoredVariables["CurrentOptimum"].store( self.StoredVariables["CurrentState"][IndexMin] )
- if "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentOptimum"].store( self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin] )
- if "CostFunctionJAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJAtCurrentOptimum"):
self.StoredVariables["CostFunctionJAtCurrentOptimum" ].store( self.StoredVariables["CostFunctionJ" ][IndexMin] )
- if "CostFunctionJbAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJbAtCurrentOptimum"):
self.StoredVariables["CostFunctionJbAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJb"][IndexMin] )
- if "CostFunctionJoAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CostFunctionJoAtCurrentOptimum"):
self.StoredVariables["CostFunctionJoAtCurrentOptimum"].store( self.StoredVariables["CostFunctionJo"][IndexMin] )
return J
#
Jo = float( 0.5 * _Innovation.T * RI * _Innovation )
J = Jb + Jo
if self._parameters["StoreInternalVariables"] or \
- "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( _X )
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
#
# Correction pour pallier a un bug de TNC sur le retour du Minimum
# ----------------------------------------------------------------
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
Minimum = self.StoredVariables["CurrentState"][IndexMin]
#
# Obtention de l'analyse
#
self.StoredVariables["Analysis"].store( Xa.A1 )
#
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA") or \
+ self._toStore("SimulatedObservationAtOptimum"):
+ if self._toStore("SimulatedObservationAtCurrentState"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentState"][IndexMin]
- elif "SimulatedObservationAtCurrentOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ elif self._toStore("SimulatedObservationAtCurrentOptimum"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
else:
HXa = Hm(Xa)
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation") or self._toStore("OMB"):
d = Y - HXb
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y) - numpy.ravel(HXa) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
qBest = copy.copy( quality )
logging.debug("%s Initialisation, Insecte = %s, Qualité = %s"%(self._name, str(Best), str(qBest)))
#
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( Best )
self.StoredVariables["CostFunctionJb"].store( 0. )
self.StoredVariables["CostFunctionJo"].store( 0. )
qBest = copy.copy( quality )
logging.debug("%s Etape %i, Insecte = %s, Qualité = %s"%(self._name, n, str(Best), str(qBest)))
#
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( Best )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
_HmX = Hm( numpy.asmatrix(numpy.ravel( Best )).T )
_HmX = numpy.asmatrix(numpy.ravel( _HmX )).T
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HmX )
#
self.StoredVariables["Analysis"].store( Xa.A1 )
#
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMB" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation") or \
+ self._toStore("OMB") or \
+ self._toStore("SimulatedObservationAtBackground"):
HXb = Hm(Xb)
d = Y - HXb
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA") or \
+ self._toStore("SimulatedObservationAtOptimum"):
HXa = Hm(Xa)
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y) - numpy.ravel(HXa) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
# ------------------------------
def CostFunction(x):
_X = numpy.asmatrix(numpy.ravel( x )).T
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( _X )
_HX = Hm( _X )
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
Jb = 0.
Jo = 0.
#
self.StoredVariables["Analysis"].store( Xa.A1 )
#
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA") or \
+ self._toStore("SimulatedObservationAtOptimum"):
HXa = Hm(Xa)
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb - Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y - HXa) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
Jo = numpy.max( numpy.abs(Y - _HX) )
#
J = float( Jb ) + float( Jo )
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( _X )
- if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("InnovationAtCurrentState"):
self.StoredVariables["InnovationAtCurrentState"].store( Y - _HX )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
if _qualityS < _qualityBest:
_Best, _qualityBest = _S, _qualityS
#
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._parameters["StoreInternalVariables"] or self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( _Best )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
_HmX = Hm( numpy.asmatrix(numpy.ravel( _Best )).T )
_HmX = numpy.asmatrix(numpy.ravel( _HmX )).T
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HmX )
#
self.StoredVariables["Analysis"].store( Xa.A1 )
#
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"] or \
- "OMB" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation") or \
+ self._toStore("OMB") or \
+ self._toStore("SimulatedObservationAtBackground"):
HXb = Hm(Xb)
d = Y - HXb
- if "OMA" in self._parameters["StoreSupplementaryCalculations"] or \
- "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA") or \
+ self._toStore("SimulatedObservationAtOptimum"):
HXa = Hm(Xa)
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
- if "OMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMA"):
self.StoredVariables["OMA"].store( numpy.ravel(Y) - numpy.ravel(HXa) )
- if "OMB" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("OMB"):
self.StoredVariables["OMB"].store( numpy.ravel(d) )
- if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtBackground"):
self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) )
- if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtOptimum"):
self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) )
#
self._post_run(HO)
FX = numpy.asmatrix(numpy.ravel( Hm( Xn ) )).T
NormeX = numpy.linalg.norm( Xn )
NormeFX = numpy.linalg.norm( FX )
- if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("CurrentState"):
self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
- if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("SimulatedObservationAtCurrentState"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) )
#
# Fabrication de la direction de l'increment dX
#
# Précalcul des inversions de B et R
# ----------------------------------
- if self._parameters["StoreInternalVariables"]:
+ if self._parameters["StoreInternalVariables"] \
+ or self._toStore("CostFunctionJ") \
+ or self._toStore("CostFunctionJb") \
+ or self._toStore("CostFunctionJo"):
BI = B.getI()
RI = R.getI()
#
Pn = B
#
self.StoredVariables["Analysis"].store( Xn.A1 )
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
self.StoredVariables["APosterioriCovariance"].store( Pn )
covarianceXa = Pn
Xa = Xn
Xn = numpy.min(numpy.hstack((Xn,numpy.asmatrix(self._parameters["Bounds"])[:,1])),axis=1)
#
self.StoredVariables["Analysis"].store( Xn.A1 )
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
self.StoredVariables["APosterioriCovariance"].store( Pn )
- if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel( d.A1 ) )
- if self._parameters["StoreInternalVariables"]:
+ if self._parameters["StoreInternalVariables"] \
+ or self._toStore("CurrentState"):
+ self.StoredVariables["CurrentState"].store( Xn )
+ if self._parameters["StoreInternalVariables"] \
+ or self._toStore("CostFunctionJ") \
+ or self._toStore("CostFunctionJb") \
+ or self._toStore("CostFunctionJo"):
Jb = 0.5 * (Xn - Xb).T * BI * (Xn - Xb)
Jo = 0.5 * d.T * RI * d
J = float( Jb ) + float( Jo )
- if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
- self.StoredVariables["CurrentState"].store( Xn )
self.StoredVariables["CostFunctionJb"].store( Jb )
self.StoredVariables["CostFunctionJo"].store( Jo )
self.StoredVariables["CostFunctionJ" ].store( J )
if J < previousJMinimum:
previousJMinimum = J
Xa = Xn
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
covarianceXa = Pn
else:
Xa = Xn
# ----------------------------------------------------------------
if self._parameters["EstimationOf"] == "Parameters":
self.StoredVariables["Analysis"].store( Xa.A1 )
- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("APosterioriCovariance"):
self.StoredVariables["APosterioriCovariance"].store( covarianceXa )
#
- if "BMA" in self._parameters["StoreSupplementaryCalculations"]:
+ if self._toStore("BMA"):
self.StoredVariables["BMA"].store( numpy.ravel(Xb) - numpy.ravel(Xa) )
#
self._post_run(HO)