elli.fitting package
Submodules
elli.fitting.decorator_mmatrix module
Decorator functions for convenient fitting of Mueller matrices
- class elli.fitting.decorator_mmatrix.FitMuellerMatrix(exp_mm, params, model, **kwargs)[source]
Bases:
objectA class to fit mueller matrices to experimental data
- fit_function(params, lbda, mueller_matrix)[source]
The fit function to minimize the fitting problem
- Parameters
params (Parameters) – The lmfit fitting Parameters to construct the simulation
lbda (npt.NDArray) – Wavelengths in nm
mueller_matrix (pd.DataFrame) – The experimental data to compare to the fitted model
- Returns
Residual between the calculation with current parameters and experimental data
- Return type
npt.NDArray
- get_fit_data()[source]
Gets the fit results as dataframe
- Returns
The fit results
- Return type
pd.DataFrame
- elli.fitting.decorator_mmatrix.fit_mueller_matrix(exp_mm, params, **kwargs)[source]
A parameters decorator for fitting mueller matrices. Displays an ipywidget float box for each fitting parameter and an interactive plot to estimate parameters.
- Parameters
exp_mm (pd.DataFrame) – The dataframe containing an experimental mueller matrix. It should contain 16 columns with labels Mxy, where xy are the matrix positions.
params (Parameters) – Fitting start parameters
**display_single (bool) – Returns a figure containing a single graph, if set to true. Returns a grid of figures otherwise.
**sharex (bool) – Ties the zoom of the x-axes together for grid view.
**full_scale (bool) – Sets the y-axis scale to [-1, 1] if set to True.
- Returns
- A function taking wavelengths as first parameter and fitting parameters as second,
which returns a pyEllis Result object. This function contains the actual model which should be fitted and is automatically provided when used as a decorator.
- Return type
Callable[[npt.NDArray, Parameters], Result]
- elli.fitting.decorator_mmatrix.mmatrix_to_dataframe(exp_df, mueller_matrix)[source]
Reshape a numpy 4x4 array containing mueller matrix elements to a dataframe with columns Mxy. The index labels for each column are taken from the provided exp_df.
- Parameters
exp_df (pd.DataFrame) – The experimental dataframe providing the index and columns for the newly generated dataframe.
mueller_matrix (npt.NDArray) – Data to be reshaped into a dataframe
- Returns
Contains the data from mueller_matrix in the shape of exp_df
- Return type
pd.DataFrame
elli.fitting.decorator_psi_delta module
Decorator functions for convenient fitting
- class elli.fitting.decorator_psi_delta.FitRho(exp_data, params, model, angle=70)[source]
Bases:
objectA class to fit psi/delta or rho based ellipsometry data with two degress of freedom
- fit_function(params, lbda, rhor, rhoi)[source]
The fit function to minimize the fitting problem
- Parameters
params (Parameters) – The lmfit fitting Parameters to construct the simulation
lbda (npt.NDArray) – Wavelengths in nm
rhor (npt.NDArray) – The real part of the experimental rho
rhoi (npt.NDArray) – The imaginary part of the experimental rho
- Returns
Residual between the calculation with current parameters and experimental data
- Return type
npt.NDArray
- set_pseudo_diel(update_exp=False, update_names=False)[source]
Sets Plot to Pseudo Dielectric function values
- elli.fitting.decorator_psi_delta.fit(exp_data, params, angle=70)[source]
A parameters decorator for fitting psi/delta valus. Displays an ipywidget float box for each fitting parameter and an interactive plot to estimate parameters.
- Parameters
exp_data (pd.DataFrame) – The dataframe containing an experimental mueller matrix. It should contain 2 columns with labels Ψ and Δ.
params (Parameters) – Fitting start parameters
angle (float, optional) – The angle of incident of the measurement. Used to calculate the Pseudo-Dielectric function. Defaults to 70.
- Returns
- A function taking wavelengths as first parameter and fitting parameters as second,
which returns a pyEllis Result object. This function contains the actual model which should be fitted and is automatically provided when used as a decorator.
- Return type
Callable[[npt.NDArray, Parameters], Result]
elli.fitting.params_hist module
ParmsHist provides a wrapper around lmfit.Parameters to keep track of the changes made to the parameters.
- class elli.fitting.params_hist.ParamsHist(usersyms=None)[source]
Bases:
lmfit.parameter.ParametersA wrapper around lmfit.Parameters to keep track of the changes made to the parameters.
- property history
Gets the entire history
- Returns
The history
- Return type
List[Parameters]
- property history_len
The current length of the history
- Returns
The length of the history
- Return type
- property max_history_len
The maximum length of the history
- Returns
The maximum length of the history
- Return type