10e-5 and it is not recommended to change it.
:"EnsembleBlue":
- no option
+
+ :SetSeed:
+ This key allow to give an integer in order to fix the seed of the random
+ generator used to generate the ensemble. A convenient value is for example
+ 1000. By default, the seed is left uninitialized, and so use the default
+ initialization from the computer.
:"KalmanFilter":
logging.debug("%s Lancement"%self._name)
logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo")))
#
+ # Paramètres de pilotage
+ # ----------------------
+ # Potentiels : "SetSeed"
+ if Parameters.has_key("SetSeed"):
+ numpy.random.seed(int(Parameters["SetSeed"]))
+ logging.debug("%s Graine fixee pour le generateur aleatoire = %s"%(self._name, int(Parameters["SetSeed"])))
+ else:
+ logging.debug("%s Graine quelconque pour le generateur aleatoire"%(self._name, ))
+ #
# Nombre d'ensemble pour l'ébauche
# --------------------------------
nb_ens = Xb.stepnumber()
else:
self.__Xb = numpy.matrix( asVector, numpy.float ).T
elif asPersistentVector is not None:
- self.__Xb = asPersistentVector
+ if type(asPersistentVector) in [type([]),type(()),type(numpy.array([])),type(numpy.matrix([]))]:
+ self.__Xb = Persistence.OneVector("Background", basetype=numpy.matrix)
+ for member in asPersistentVector:
+ self.__Xb.store( numpy.matrix( numpy.asarray(member).flatten(), numpy.float ).T )
+ else:
+ self.__Xb = asPersistentVector
else:
raise ValueError("Error: improperly defined background")
if toBeStored:
raise ValueError("Shape characteristic of H \"%s\" and R \"%s\" are incompatible"%(__H_shape,__R_shape))
#
if self.__B is not None and len(self.__B) > 0 and not( __B_shape[1] == max(__Xb_shape) ):
- raise ValueError("Shape characteristic of B \"%s\" and Xb \"%s\" are incompatible"%(__B_shape,__Xb_shape))
+ if self.__StoredInputs["AlgorithmName"] in ["EnsembleBlue",]:
+ asPersistentVector = self.__Xb.reshape((-1,min(__B_shape)))
+ self.__Xb = Persistence.OneVector("Background", basetype=numpy.matrix)
+ for member in asPersistentVector:
+ self.__Xb.store( numpy.matrix( numpy.asarray(member).flatten(), numpy.float ).T )
+ __Xb_shape = min(__B_shape)
+ else:
+ raise ValueError("Shape characteristic of B \"%s\" and Xb \"%s\" are incompatible"%(__B_shape,__Xb_shape))
#
if self.__R is not None and len(self.__R) > 0 and not( __R_shape[1] == max(__Y_shape) ):
raise ValueError("Shape characteristic of R \"%s\" and Y \"%s\" are incompatible"%(__R_shape,__Y_shape))