model module

Define the base class for all electron emission models.

Todo

Define all the properties: EBEEY, emission energy distributions, etc.

class Model(*args, parameters_values=None, **kwargs)

Bases: ABC

Define the base electron emission model.

Parameters:
  • emission_data_types – Types of modelled data.

  • populations – Modelled populations.

  • considers_energy – Tell if the model has a dependency over PEs impact energy.

  • is_3d – Tell if the model has a dependency over PEs impact angle.

  • is_dielectrics_compatible – Tell if the model can take the surface-trapped charges into account.

  • initial_parameters – List the Parameter kwargs.

  • model_config – List the files that the model needs to know in order to work.

  • implementations – List of different implementations for the same Model. See for example vaughan.Vaughan.

Instantiate the object.

Parameters:

parameters_values (dict[str, Any] | None, default: None) – Contains name of parameters and associated value. If provided, will override the default values set in initial_parameters.

emission_data_types: list[Literal['Emission Yield', 'Emission Energy', 'Emission Angle']]
populations: list[Literal['SE', 'EBE', 'IBE', 'all']]
considers_energy: bool
is_3d: bool
is_dielectrics_compatible: bool
initial_parameters: dict[str, dict[str, str | float | bool]]
model_config: ModelConfig
implementations: tuple[str, ...] | None = None
parameters: Any

A TypedDict specific to every model.Model. Keys are parameters names, values are Parameter.

classmethod _generate_parameter_docs()

Generate documentation for the Parameter.

Return type:

str

teey(energy, theta, *args, **kwargs)

Compute TEEY \(\sigma\).

Return type:

DataFrame

seey(energy, theta, *args, **kwargs)

Compute SEEY \(\delta\).

Return type:

DataFrame

se_energy_distribution(energy, theta, *args, **kwargs)

Compute SEs emission energy distribution.

Return type:

DataFrame

get_data(population, emission_data_type, energy, theta, *args, **kwargs)

Return desired data according to current model.

You should override this method for each Model subclass. When desired data is not found, a None is returned. If you want a dummy dataframe instead, call the specific methods for every quantity: Model.teey(), Model.seey(), Model.se_energy_distribution().

Return type:

DataFrame | None

abstractmethod find_optimal_parameters(data_matrix, **kwargs)

Find the best parameters for the current model.

Return type:

None

plot(plotter, population, emission_data_type, energies, angles, axes=None, grid=True, **kwargs)

Plot desired modelled data using plotter.

This method uses Model.get_data() to compute the modelled data matching population and emission_data_type. Then it calls the Model.plot() method.

Parameters:
  • plotter (Plotter) – Object realizing the plot. We transfer it to the Model.plot() method.

  • population (Literal['SE', 'EBE', 'IBE', 'all'] | Collection[Literal['SE', 'EBE', 'IBE', 'all']]) – One or several populations to plot. If several are given, we simply recursively call this method.

  • emission_data_type (Literal['Emission Yield', 'Emission Energy', 'Emission Angle']) – Type of data to plot.

  • energies (ndarray[tuple[Any, ...], dtype[float64]]) – Energies in \(\mathrm{eV}\) for which model should be plotted.

  • angles (ndarray[tuple[Any, ...], dtype[float64]]) – Angles in \(\mathrm{deg}\) for which model should be plotted.

  • axes (TypeVar(T) | None, default: None) – Axes to re-use if given.

  • grid (bool, default: True) – If grid should be plotted.

  • kwargs – Other keyword arguments passed to the Model.plot() method.

Return type:

TypeVar(T) | None

Returns:

Created axes object, or None if no plot was created.

set_parameter_value(name, value)

Give the parameter named name the value value.

Return type:

None

reset_parameter_value(name)

Reset a parameter value to its default.

Default is defined in initial_parameters.

Return type:

None

set_parameters_values(values)

Set multiple parameter values.

Return type:

None

reset_parameters_values(*names)

Reset multiple parameter values.

Return type:

None

evaluate(data_matrix, *args, evaluations=None, **kwargs)

Evaluate the precision of the model w.r.t. given data.

For now, the only evaluations are TEEY or SEEY criterions proposed by Fil et al. [FBHP16, FBHP20].

Parameters:
  • data_matrix (DataMatrix) – Holds all measured electron emission data.

  • evaluations (dict[str, float] | None, default: None) – Maps names of quality criterions with their actual value. If given, it will be preserved and additional evaluations may be added.

Returns:

Maps names of quality criterions with their actual value.

Return type:

dict[str, float]

_evaluate_for_teey_models(data_matrix)

Evaluate a TEEY model with N. Fil criterions.

Ref: [FBHP16, FBHP20].

Return type:

dict[str, float]

_main_teey_parameters()

Compute main TEEY parameters.

In particular: $E_{c1}$, $E_{max}$, $sigma_{max}$.

Return type:

dict[str, float]

_error_ec1(emission_yield)

Compute relative error over first crossover energy in \(\mathrm{%}\).

Return type:

float

_error_teey(emission_yield)

Compute TEEY relative error between $E_{c1}$ and $E_{max}$.

Returned value is in \(\mathrm{%}\).

Return type:

float

display_parameters()

Display the parameters and their values in a nice looking way.

Return type:

None

_dummy_df(energy, theta)

Return a null array with proper shape.

Return type:

DataFrame