mx_step module

Allows to extract multiple steps at once. All steps are fit at once…

Author: Mario Krattenmacher | Mario.Krattenmacher@semimod.de

class DMT.extraction.mx_step.MXStep(name, mcard, **kwargs)[source]

Bases: XStep

Multiple extraction step

add(xstep, has_main_plot=False)[source]

Adding a step the the multi-step

ensure_input_correct_per_dataframe(*_args, **_kwargs)[source]
Parameters:
dataframeDMT.core.DataFrame

Dataframe to ensure columns

dutDutView, optional

The corresponding dut (if dut parameters are needed)

keystr, optional

The corresponding key (if ambient temperature is needed)

Raises:
KeyError

If a needed column is not in the frame.

extract()[source]

Perform a parameter extraction. This algorithm should be valid for ALL smallest common XSteps. Compositional XSteps will get another algorithm.

fit_function(xdata, *args)[source]

This function is passed to curve_fit and is a little abused here, see text below.

The curve_fit function is passed to scipy alongside with the jacobian function. Scipy will call these functions in an alternating way, in order to get the current function value and the jacobian. However this would prevent the usage of parallel computing, hence all calculations are performed inside fit_function. self.jacobian just returns calculation results that have already been calculated in fit_function.

This approach also allows easy implementation of multi-dimensional fits.

Parameters:
xdatanp.ndarray

The argument of the fit_function, scipy.curve_fit wants to calculate.

*argslist-like

These represent the current parameter values that curve_fit is interested in. They are expanded by the full local modelcard.

Returns:
f_0np.ndarray

The current value of the model function, possibly normalized.

init_data_reference_per_dataframe(*_args, **_kwargs)[source]

This function needs to append lines to self.reference_data = [{‘x’:x_values, ‘y’:y_values}] from each dataframe in a dut.

Per default overwrite this method since, generally the extraction steps create one or multiple lines from one dataframe independent of other frames.

The attributes self.reference_data is a list of dicts. Each element of the list represents one line with its x_values and y_values. Additional keys can be added, see the x_step_cjc example, where the temperature T of each line has been added.

Parameters:
dataframeDMT.core.DataFrame

Dataframe from which reference data can be obtained.

t_measfloat

Measurement ambient temperature (obtained from key)

dutDutView, optional

The corresponding dut (if dut parameters are needed)

keystr, optional

The corresponding key

jacobian(xdata, *args)[source]

This function returns the jacobian self.jac and possibly normalizes it. This function is only a helper to work with the curve_fit interface.

property mcard[source]
model_function(*args, **kwargs)[source]

Defining a model function to allow parameter grabbing

optimize()[source]

Fit the model to the reference data.

property paras_to_optimize_per_line[source]
refresh_mcards()[source]
remove_para_to_push(para)[source]
set_initial_guess(data_reference)[source]

Find suitable initial guesses for (some of the) model parameters from the given reference data.

set_normalized_parameters(values_normalized)[source]

Saves the parameters from the optimize to self.paras_to_optimize, self.paras_to_optimize_per_line and self.mcard.

If necessary it denormalizes the parameters before doing so.

Parameters:
values_normalizednp.array
set_para_active(para)[source]
set_para_inactive(para)[source]
set_para_to_push(para)[source]
staticMetaObject = PySide6.QtCore.QMetaObject("MXStep" inherits "XStep": )[source]