loader package

Define objects to load the different formats of electron emission files.

class DeesseLoader

Bases: Loader

Define the loader.

__init__() None

Raise an error for now.

Ideally, this loader should detect correct input and columns. But it is not for now.

_abc_impl = <_abc._abc_data object>
_extract_incidence_angle(full_data: DataFrame) float

Try to get the incidence angle in the file.

load_emission_angle_distribution(*args) Any

Load the given electron emission angle distribution file.

load_emission_energy_distribution(filepath: str | Path, e_pe: float | None = None) tuple[DataFrame, float | None]

Load and format an emission energy file from DEESSE.

Parameters:
  • filepath – Path to file holding data under study.

  • e_pe – Energy of PEs in \(\mathrm{eV}\). Should be manually provided, as not present in DEESSE files.

Returns:

  • pandas.DataFrame – Structure holding the data. Has a Energy [eV] column holding emitted electrons energy. And one or several columns theta [deg], where theta is the value of the incidence angle and content is corresponding emission energy distribution.

  • float – Energy of Primary Electrons in \(\mathrm{eV}\). If not found in the file comments, it will be inferred from the position of the EBEs peak.

load_emission_yield(*filepath: str | Path) DataFrame

Load and format the given emission yield files.

Parameters:

filepath – Path(s) to file holding data under study.

Returns:

Structure holding the data. Has a Energy [eV] column holding PEs energy. And one or several columns theta [deg], where theta is the value of the incidence angle and content is corresponding emission yield.

Return type:

pandas.DataFrame

class PandasLoader

Bases: Loader

Define the pandas loader.

__init__() None

Init object.

_abc_impl = <_abc._abc_data object>
load_emission_angle_distribution(*args) Any

Load the given electron emission angle distribution file.

load_emission_energy_distribution(filepath: str | Path, sep: str = ',', comment: str = '#') tuple[DataFrame, float | None]

Load and format the given emission energy file.

CSV files can have comments at the start of the file, starting with a # character. It is expected that the energy of PEs used for the measurements is on the second commented line, in \(\mathrm{eV}\). Column separator must be ,. First non-commented line is incidence angle in degrees. First column is emission energy in \(\mathrm{eV}\). Distribution is in the next columns (excluding the first line). Example:

# PEs energy in eV
# 100
0,0
1.999999999999975131e-01,7.117578753770542783e-03
3.999999999999968026e-01,1.138131444290255145e-02
5.999999999999978684e-01,1.510969903349285159e-02

Files in the data/example_ag/emission_energy files are correctly formatted.

Parameters:
  • filepath – Path to file holding data under study.

  • sep – Column delimiter.

  • comment – Comment character.

Returns:

  • pd.DataFrame – Structure holding the data. Has a Energy [eV] column holding emitted electrons energy. And one or several columns theta [deg], where theta is the value of the incidence angle and content is corresponding emission energy distribution.

  • float – Energy of Primary Electrons in \(\mathrm{eV}\). If not found in the file comments, it will be inferred from the position of the EBEs peak.

load_emission_yield(filepath: str | Path, sep: str = ',', comment: str = '#') DataFrame

Load and format the given emission yield file.

CSV files can have comments at the start of the file, starting with a # character. Column separator must be ,. First non-commented line is incidence angle in degrees. First column is incident energy in \(\mathrm{eV}\). EY is the next columns (excluding the first line). Example:

# Cu measurements
# Some comments
# Energy | 0deg | 20deg | 40deg | 60deg
0,0,20,40,60
0,0.814,0.781,0.866,0.918
10,0.574,0.553,0.637,0.803
20,0.632,0.594,0.671,0.817

Files in the data/example_copper/ files are taken from [PBD20] and are correctly formatted.

Parameters:
  • filepath – Path to file holding data under study.

  • sep – Column delimiter.

  • comment – Comment character.

Returns:

Structure holding the data. Has a Energy [eV] column holding PEs energy. And one or several columns theta [deg], where theta is the value of the incidence angle and content is corresponding emission yield.

Return type:

pandas.DataFrame

Submodules