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: dict[str, Any] | None = None, **kwargs)

Bases: ABC

Define the base electron emission model.

Parameters:
  • emission_data_types (list[Literal['Emission Yield', 'Emission Energy', 'Emission Angle']]) – Types of modelled data.

  • populations (list[Literal['SE', 'EBE', 'IBE', 'all']]) – Modelled populations.

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

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

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

  • initial_parameters (dict[str, dict[str, str | float | bool]]) – List the Parameter kwargs.

  • model_config (eemilib.core.model_config.ModelConfig) – List the files that the model needs to know in order to work.

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
__init__(*args, parameters_values: dict[str, Any] | None = None, **kwargs) None

Instantiate the object.

Parameters:

parameters_values – Contains name of parameters and associated value. If provided, will override the default values set in initial_parameters.

classmethod _generate_parameter_docs() str

Generate documentation for the Parameter.

teey(energy: ndarray[tuple[Any, ...], dtype[float64]], theta: ndarray[tuple[Any, ...], dtype[float64]], *args, **kwargs) DataFrame

Compute TEEY \(\sigma\).

seey(energy: ndarray[tuple[Any, ...], dtype[float64]], theta: ndarray[tuple[Any, ...], dtype[float64]], *args, **kwargs) DataFrame

Compute SEEY \(\delta\).

se_energy_distribution(energy: ndarray[tuple[Any, ...], dtype[float64]], theta: ndarray[tuple[Any, ...], dtype[float64]], *args, **kwargs) DataFrame

Compute SEs emission energy distribution.

get_data(population: Literal['SE', 'EBE', 'IBE', 'all'], emission_data_type: Literal['Emission Yield', 'Emission Energy', 'Emission Angle'], energy: ndarray[tuple[Any, ...], dtype[float64]], theta: ndarray[tuple[Any, ...], dtype[float64]], *args, **kwargs) DataFrame | None

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().

abstractmethod find_optimal_parameters(data_matrix: DataMatrix, **kwargs) None

Find the best parameters for the current model.

plot(plotter: Plotter, population: Literal['SE', 'EBE', 'IBE', 'all'] | Collection[Literal['SE', 'EBE', 'IBE', 'all']], emission_data_type: Literal['Emission Yield', 'Emission Energy', 'Emission Angle'], energies: ndarray[tuple[Any, ...], dtype[float64]], angles: ndarray[tuple[Any, ...], dtype[float64]], axes: T | None = None, grid: bool = True, **kwargs) T | None

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 – Object realizing the plot. We transfer it to the Model.plot() method.

  • population – One or several populations to plot. If several are given, we simply recursively call this method.

  • emission_data_type – Type of data to plot.

  • energies – Energies in \(\mathrm{eV}\) for which model should be plotted.

  • angles – Angles in \(\mathrm{deg}\) for which model should be plotted.

  • axes – Axes to re-use if given.

  • grid – If grid should be plotted.

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

Return type:

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

set_parameter_value(name: str, value: Any) None

Give the parameter named name the value value.

set_parameters_values(values: dict[str, Any]) None

Set multiple parameter values.

evaluate(data_matrix: DataMatrix, *args, **kwargs) dict[str, float]

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

_evaluate_for_teey_models(data_matrix: DataMatrix) dict[str, float]

Evaluate a TEEY model with N. Fil criterions.

Ref: [FBHP16, FBHP20]

_error_ec1(emission_yield: EmissionYield) float

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

_error_teey(emission_yield: EmissionYield) float

Compute TEEY relative error between E_c1 and E_max in \(\mathrm{%}\).

display_parameters() None

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

_abc_impl = <_abc._abc_data object>
_dummy_df(energy: ndarray[tuple[Any, ...], dtype[float64]], theta: ndarray[tuple[Any, ...], dtype[float64]]) DataFrame

Return a null array with proper shape.