epraya.LSquare#

LSquare(Ham1, Expe, Vary, exper, maximal=1000, mode='p')#

Fitting adjutsment of the experimental data using the scipy.optimize.least_squares method. The Trust Region Reflective algorithm is use, with a tolerance for the change of variables (xtol, ftol, gtol) of 1e-10 and a maximun number of evaluations defined with the variable maximal. The documentation of the function can be consulted in https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.least_squares.html.

Parameters:
  • Ham1 (Class) – Container for the hamiltonian parameters.

  • Expe (Class) – Container for the experimental conditions.

  • Vary (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.

  • mode (str) – Defines the sample type, ‘p’ for powder and ‘c’ for monocristal.

Returns:

scpe (np.array) – Best adjusted spectrum.