Distributions

The distributions used throughout the code.

class xarpes.distributions.CreateDistributions(distributions)[source]

Thin container for distributions with leaf-aware utilities. If a distribution implements components() -> iterable of leaf distributions, we use it to count/flatten; otherwise it’s treated as a leaf.

property distributions
property n_individuals: int

Number of leaf components (i.e., individual curves to plot).

flatten()[source]

Return a flat list of leaf distributions (useful for plotting/storage).

plot(angle_range, angle_resolution, kinetic_energy=None, hnuminPhi=None, matrix_element=None, matrix_args=None, ax=None)[source]

Notes

Keyword arguments controlling the display of the figure:

kwargs

Meaning

title

Title of the plot (Default: None).

show

True to show the figure (default: True).

savefig

“abc.png” or “abc.eps” to save the figure to a file.

size_kwargs

Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)

tight_layout

True to call fig.tight_layout (default: False)

ax_grid

True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.

ax_annotate

Add labels to subplots e.g. (a), (b). Default: False

fig_close

Close figure. Default: True.

class xarpes.distributions.Distribution(name)[source]

Parent class for distributions. The class cannot be used on its own, but is used to instantiate unique and non-unique distributions.

Parameters:
namestr

Non-unique name for instances, not to be modified after instantiation.

property name
property class_name

TBD

plot(angle_range, angle_resolution, kinetic_energy=None, hnuminPhi=None, matrix_element=None, matrix_args=None, ax=None)[source]

Overwritten for FermiDirac distribution.

Notes

Keyword arguments controlling the display of the figure:

kwargs

Meaning

title

Title of the plot (Default: None).

show

True to show the figure (default: True).

savefig

“abc.png” or “abc.eps” to save the figure to a file.

size_kwargs

Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)

tight_layout

True to call fig.tight_layout (default: False)

ax_grid

True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.

ax_annotate

Add labels to subplots e.g. (a), (b). Default: False

fig_close

Close figure. Default: True.

class xarpes.distributions.UniqueDistribution(name)[source]

Parent class for unique distributions, to be used one at a time, e.g., during the background of an MDC fit or the Fermi-Dirac distribution.

Parameters:
labelstr

Unique label for instances, identical to the name for unique distributions. Not to be modified after instantiation.

property label

Returns the unique class label.

Returns:
labelstr

Unique label for instances, identical to the name for unique distributions. Not to be modified after instantiation.

class xarpes.distributions.FermiDirac(temperature, hnuminPhi, background=0, integrated_weight=1, name='FermiDirac')[source]

Child class for Fermi-Dirac (FD) distributions, used e.g., during Fermi-edge fitting. The FD class is unique, only one instance should be used per task.

The Fermi-Dirac distribution is described by the following formula:

\[\frac{A}{\rm{e}^{\beta(E_{\rm{kin}}-(h\nu-\Phi))}+1} + B\]

with \(A\) as integrated_weight, \(B\) as background, \(h\nu-\Phi\) as hnuminPhi, and \(\beta=1/(k_{\rm{B}}T)\) with \(T\) as temperature.

Parameters:
temperaturefloat

Temperature of the sample [K]

hnuminPhifloat

Kinetic energy minus the work function [eV]

backgroundfloat

Background spectral weight [counts]

integrated_weightfloat

Integrated weight on top of the background [counts]

evaluate(energy_range)[source]

Evaluates the FD distribution for a given class instance. No energy convolution is performed with evaluate.

Parameters:
energy_rangendarray

1D array on which to evaluate the FD distribution [eV]

Returns:
evalfndarray

1D array of the evaluated FD distribution [counts]

plot(energy_range, energy_resolution, ax=None)[source]

TBD

Notes

Keyword arguments controlling the display of the figure:

kwargs

Meaning

title

Title of the plot (Default: None).

show

True to show the figure (default: True).

savefig

“abc.png” or “abc.eps” to save the figure to a file.

size_kwargs

Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)

tight_layout

True to call fig.tight_layout (default: False)

ax_grid

True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.

ax_annotate

Add labels to subplots e.g. (a), (b). Default: False

fig_close

Close figure. Default: True.

class xarpes.distributions.Constant(offset, name='Constant')[source]

Child class for constant distributions, used e.g., during MDC fitting. The constant class is unique, only one instance should be used per task.

Parameters:
offsetfloat

The value of the distribution for the abscissa equal to 0.

property offset

Returns the offset of the constant distribution.

Returns:
offsetfloat

The value of the distribution for the abscissa equal to 0.

evaluate(angle_range)[source]

TBD

class xarpes.distributions.Linear(slope, offset, name='Linear')[source]

Child cass for for linear distributions, used e.g., during MDC fitting. The linear class is unique, only one instance should be used per task.

Parameters:
offsetfloat

The value of the distribution for the abscissa equal to 0.

slopefloat

The linear slope of the distribution w.r.t. the abscissa.

property offset

Returns the offset of the linear distribution.

Returns:
offsetfloat

The value of the distribution for the abscissa equal to 0.

property slope

Returns the slope of the linear distribution.

Returns:
slopefloat

The linear slope of the distribution w.r.t. the abscissa.

evaluate(angle_range)[source]

No energy convolution is performed with evaluate.

class xarpes.distributions.Quadratic(offset, linear, quadratic, name='Quadratic')[source]

Child class for quadratic distributions.

Parameters:
offsetfloat

Constant term of the polynomial.

linearfloat

Linear term of the polynomial w.r.t. the abscissa.

quadraticfloat

Quadratic term of the polynomial w.r.t. the abscissa.

property offset

Returns the constant term of the polynomial.

property linear

Returns the linear term of the polynomial.

property quadratic

Returns the quadratic term of the polynomial.

evaluate(angle_range)[source]

No energy convolution is performed with evaluate.

class xarpes.distributions.NonUniqueDistribution(name, index)[source]

Parent class for unique distributions, to be used one at a time, e.g., during the background of an MDC fit or the Fermi-Dirac distribution.

Parameters:
labelstr

Unique label for instances, identical to the name for unique distributions. Not to be modified after instantiation.

property label

Returns the unique class label.

Returns:
labelstr

Unique label for instances, consisting of the label and the index for non-unique distributions. Not to be modified after instantiation.

property index

Returns the unique class index.

Returns:
indexstr

Unique index for instances. Not to be modified after instantiation.

class xarpes.distributions.Dispersion(amplitude, peak, broadening, name, index)[source]

Dispersions are assumed to be unique, so they need an index.

property amplitude
property peak
property broadening
class xarpes.distributions.SpectralLinear(amplitude, peak, broadening, name, index)[source]

Class for the linear dispersion spectral function

evaluate(angle_range)[source]
class xarpes.distributions.SpectralQuadratic(amplitude, peak, broadening, name, index, center_wavevector=None, center_angle=None)[source]

Class for the quadratic dispersion spectral function

property center_angle

TBD

property center_wavevector

TBD

check_center_coordinates(center_wavevector, center_angle)[source]

TBD

check_binding_angle(binding_angle)[source]

TBD

evaluate(angle_range, kinetic_energy, hnuminPhi)[source]

TBD

plot(angle_range, angle_resolution, kinetic_energy, hnuminPhi, matrix_element=None, matrix_args=None, ax=None)[source]

Overwrites generic class plotting method.

Notes

Keyword arguments controlling the display of the figure:

kwargs

Meaning

title

Title of the plot (Default: None).

show

True to show the figure (default: True).

savefig

“abc.png” or “abc.eps” to save the figure to a file.

size_kwargs

Dictionary with options passed to fig.set_size_inches e.g. size_kwargs=dict(w=3, h=4)

tight_layout

True to call fig.tight_layout (default: False)

ax_grid

True (False) to add (remove) grid from all axes in fig. Default: None i.e. fig is left unchanged.

ax_annotate

Add labels to subplots e.g. (a), (b). Default: False

fig_close

Close figure. Default: True.