epraya.Metro#
- Metro(Hamer, Exp, Var, exper, maximal=2000, datype='data', mode='p')#
Fitting adjutsment of the experimental data using a modified Metrópolis-Simulated annealing approach. First, the parameters in the Vary container are evaluated in range, one by one, using a gaussian distribution and then, all are varied at the same time. With every evaluation, the difference between the simulation and the data is calculated as a cost.
Depending in the acceptance rate of the process, the temperature of the process change. If the acceptance is too low, the process heats up (the range of the evaluating values increases), if the accpetance is high, the process colds down (the range reduces).
- Parameters:
Hamer (Class) – Container for the hamiltonian parameters.
Exp (Class) – Container for the experimental conditions.
Var (Class) – Container for the range and parameters to vary.
exper (np.array) – Experimental spectrum data to fit.
maximal (int) – Max. number of evaluations of the function.
datype (str) – Type of data to do the fitting, can be ‘data’, the data as it’s or ‘integral’, its first integral.
mode (str) – Defines the sample type, ‘p’ for powder and ‘c’ for monocristal.
- Returns:
scpe (np.array) – Best adjusted spectrum.