xarpes 0.2.3__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xarpes/__init__.py +3 -5
- xarpes/constants.py +12 -0
- xarpes/distributions.py +500 -239
- xarpes/functions.py +263 -61
- xarpes/plotting.py +46 -29
- xarpes/spectral.py +2067 -0
- xarpes-0.3.0.dist-info/METADATA +160 -0
- xarpes-0.3.0.dist-info/RECORD +11 -0
- {xarpes-0.2.3.dist-info → xarpes-0.3.0.dist-info}/WHEEL +1 -1
- xarpes-0.3.0.dist-info/entry_points.txt +3 -0
- {xarpes-0.2.3.dist-info → xarpes-0.3.0.dist-info/licenses}/LICENSE +0 -0
- xarpes/.ipynb_checkpoints/__init__-checkpoint.py +0 -8
- xarpes/band_map.py +0 -306
- xarpes-0.2.3.dist-info/METADATA +0 -121
- xarpes-0.2.3.dist-info/RECORD +0 -10
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xarpes
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Extraction from angle resolved photoemission spectra
|
|
5
|
+
Author: xARPES Developers
|
|
6
|
+
Requires-Python: >=3.7.0
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: igor2>=0.5.8
|
|
12
|
+
Requires-Dist: jupyterlab
|
|
13
|
+
Requires-Dist: jupytext
|
|
14
|
+
Requires-Dist: matplotlib
|
|
15
|
+
Requires-Dist: numpy
|
|
16
|
+
Requires-Dist: scipy
|
|
17
|
+
Requires-Dist: lmfit
|
|
18
|
+
Requires-Dist: pyqt5
|
|
19
|
+
Requires-Dist: ipympl
|
|
20
|
+
Project-URL: Documentation, https://xarpes.github.io
|
|
21
|
+
|
|
22
|
+
# xARPES
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
Repository for the code xARPES – extraction of the self-energy and Eliashberg function from angle-resolved photoemission spectroscopy. The documentation can be found on [Read the Docs](https://xarpes.readthedocs.io), while the code is maintained on [GitHub](https://github.com/xARPES/xARPES). Instructions for installing the code and downloading the code are found below. An extensive description of the functionalities and examples is found at the [arXiv preprint](https://arxiv.org/abs/2508.13845).
|
|
27
|
+
|
|
28
|
+
# Warning
|
|
29
|
+
|
|
30
|
+
This project is currently undergoing **beta testing**. Some of the functionalities are in the process of being implemented. If you encounter any bugs, you can open an issue.
|
|
31
|
+
|
|
32
|
+
# Contributing
|
|
33
|
+
|
|
34
|
+
Contributions to the code are most welcome. xARPES is intended to co-develop alongside the increasing complexity of experimental ARPES data sets. Contributions can be made by forking the code and creating a pull request. Importing of file formats from different beamlines is particularly encouraged.
|
|
35
|
+
|
|
36
|
+
# Installation
|
|
37
|
+
|
|
38
|
+
xARPES can be installed in several ways depending on your workflow:
|
|
39
|
+
- via a graphical package manager (Anaconda Navigator, VS Code, PyCharm, Spyder, JupyterLab)
|
|
40
|
+
- via conda-forge, out-of-the-box or editable installation, sourcing the [conda-forge package](https://anaconda.org/conda-forge/xarpes).
|
|
41
|
+
- via Pip, out-of-the-box or editable installation, sourcing the [PyPI package](https://pypi.org/project/xarpes).
|
|
42
|
+
|
|
43
|
+
## Graphical package manager installation
|
|
44
|
+
|
|
45
|
+
Most IDEs and scientific Python distributions include a GUI-based package manager.
|
|
46
|
+
These typically install from conda-forge (for conda environments) or PyPI (for venv/system Python).
|
|
47
|
+
|
|
48
|
+
### Anaconda Navigator
|
|
49
|
+
|
|
50
|
+
1. Open Anaconda Navigator
|
|
51
|
+
2. Select or create an environment
|
|
52
|
+
3. Set the package channel to conda-forge
|
|
53
|
+
4. Search for “xarpes”
|
|
54
|
+
5. Click Install
|
|
55
|
+
|
|
56
|
+
This installs the latest stable release from conda-forge.
|
|
57
|
+
|
|
58
|
+
### PyCharm, VS Code, Spyder, or JupyterLab
|
|
59
|
+
|
|
60
|
+
These IDEs install from the active environment’s package source:
|
|
61
|
+
- conda environment → installs from conda-forge
|
|
62
|
+
- venv/system Python → installs from PyPI
|
|
63
|
+
|
|
64
|
+
### Installation steps (generic)
|
|
65
|
+
|
|
66
|
+
1. Open your IDE
|
|
67
|
+
2. Select or create a Python environment
|
|
68
|
+
3. Open the environment/package manager panel
|
|
69
|
+
4. Search for “xarpes”
|
|
70
|
+
5. Click Install
|
|
71
|
+
|
|
72
|
+
## Conda Forge installation
|
|
73
|
+
|
|
74
|
+
Install xARPES inside a conda environment, either out of the box or as an editable.
|
|
75
|
+
|
|
76
|
+
### Setting up a conda environment
|
|
77
|
+
|
|
78
|
+
Download and install Miniconda (see the [Miniconda installation page](https://docs.anaconda.com/free/miniconda/)).
|
|
79
|
+
|
|
80
|
+
Example for Linux:
|
|
81
|
+
|
|
82
|
+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
|
83
|
+
bash Miniconda3-latest-Linux-x86_64.sh
|
|
84
|
+
|
|
85
|
+
Create and activate an environment:
|
|
86
|
+
|
|
87
|
+
conda create -n <my_env> -c defaults -c conda-forge
|
|
88
|
+
conda activate <my_env>
|
|
89
|
+
|
|
90
|
+
### Installing xARPES
|
|
91
|
+
|
|
92
|
+
#### Option A — User installation (from conda-forge)
|
|
93
|
+
|
|
94
|
+
conda install conda-forge::xarpes
|
|
95
|
+
|
|
96
|
+
#### Option B — Developer installation (GitHub, editable)
|
|
97
|
+
|
|
98
|
+
git clone git@github.com:xARPES/xARPES.git
|
|
99
|
+
cd xARPES
|
|
100
|
+
pip install -e .
|
|
101
|
+
|
|
102
|
+
## Pip installation
|
|
103
|
+
|
|
104
|
+
Install xARPES using pip, either out of the box or as an editable.
|
|
105
|
+
|
|
106
|
+
### Setting up a virtual environment
|
|
107
|
+
|
|
108
|
+
Install venv if necessary:
|
|
109
|
+
|
|
110
|
+
sudo apt install python3-venv
|
|
111
|
+
|
|
112
|
+
Create and activate a virtual environment:
|
|
113
|
+
|
|
114
|
+
python3 -m venv <my_venv>
|
|
115
|
+
source <my_venv>/bin/activate
|
|
116
|
+
|
|
117
|
+
Upgrade pip:
|
|
118
|
+
|
|
119
|
+
python3 -m pip install --upgrade pip
|
|
120
|
+
|
|
121
|
+
### Installing xARPES
|
|
122
|
+
|
|
123
|
+
#### Option A — User installation (PyPI)
|
|
124
|
+
|
|
125
|
+
python3 -m pip install xarpes
|
|
126
|
+
|
|
127
|
+
#### Option B — Developer installation (GitHub, editable)
|
|
128
|
+
|
|
129
|
+
git clone git@github.com:xARPES/xARPES.git
|
|
130
|
+
cd xARPES
|
|
131
|
+
python3 -m pip install -e .
|
|
132
|
+
|
|
133
|
+
# Examples
|
|
134
|
+
|
|
135
|
+
After installation of xARPES, the `examples/` folder can be downloaded to the current directory:
|
|
136
|
+
|
|
137
|
+
xarpes_download_examples
|
|
138
|
+
|
|
139
|
+
Equivalently:
|
|
140
|
+
|
|
141
|
+
python3 -c "import xarpes; xarpes.download_examples()"
|
|
142
|
+
|
|
143
|
+
# Execution
|
|
144
|
+
|
|
145
|
+
It is recommended to use JupyterLab to analyse data. JupyterLab is launched using:
|
|
146
|
+
|
|
147
|
+
jupyter lab
|
|
148
|
+
|
|
149
|
+
# Citation
|
|
150
|
+
|
|
151
|
+
If you have used xARPES for your research, please cite the following preprint:
|
|
152
|
+
[arXiv preprint 2508.13845](https://arxiv.org/abs/2508.13845).
|
|
153
|
+
|
|
154
|
+
# License
|
|
155
|
+
|
|
156
|
+
Copyright (C) 2025 xARPES Developers
|
|
157
|
+
|
|
158
|
+
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation.
|
|
159
|
+
|
|
160
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
xarpes/__init__.py,sha256=w-VIJOW1owG2XHnWYT9vJerM_YH-FkhK-HdiDNbpPIc,124
|
|
2
|
+
xarpes/constants.py,sha256=vQxxFeCdGIxMpdh5XGbeRbn7-HF1d5snWkR09d8spGc,587
|
|
3
|
+
xarpes/distributions.py,sha256=svzhvf994_5gndJA1M04SW4MVfHEVwiAumbhO5Jj22s,23434
|
|
4
|
+
xarpes/functions.py,sha256=gE76z-Y9UI1KNUUtADyLziLU1UJ43E1CHLDi_khj0bc,12007
|
|
5
|
+
xarpes/plotting.py,sha256=W-5WaKjBtg8PIxTypqja2R29mgWkQ844lgRWci0nhn0,5679
|
|
6
|
+
xarpes/spectral.py,sha256=qw0qSeYfaCc9C28cGe32QrI3mK64KNcoNTDkS5EplmM,78637
|
|
7
|
+
xarpes-0.3.0.dist-info/entry_points.txt,sha256=917UR-cqFTMMI_vMqIbk7boYSuFX_zHwQlXKcj9vlCE,79
|
|
8
|
+
xarpes-0.3.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
9
|
+
xarpes-0.3.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
10
|
+
xarpes-0.3.0.dist-info/METADATA,sha256=v1gBQmF0wbdq8tVQtWHHIK3KgVIYTtxH9w4mkYS1Jms,5378
|
|
11
|
+
xarpes-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
xarpes/band_map.py
DELETED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
# Copyright (C) 2024 xARPES Developers
|
|
2
|
-
# This program is free software under the terms of the GNU GPLv3 license.
|
|
3
|
-
|
|
4
|
-
# get_ax_fig_plt and add_fig_kwargs originate from pymatgen/util/plotting.py.
|
|
5
|
-
# Copyright (C) 2011-2024 Shyue Ping Ong and the pymatgen Development Team
|
|
6
|
-
# Pymatgen is released under the MIT License.
|
|
7
|
-
|
|
8
|
-
# See also abipy/tools/plotting.py.
|
|
9
|
-
# Copyright (C) 2021 Matteo Giantomassi and the AbiPy Group
|
|
10
|
-
# AbiPy is free software under the terms of the GNU GPLv2 license.
|
|
11
|
-
|
|
12
|
-
"""The band map class and allowed operations on it."""
|
|
13
|
-
|
|
14
|
-
import numpy as np
|
|
15
|
-
|
|
16
|
-
from .plotting import get_ax_fig_plt, add_fig_kwargs
|
|
17
|
-
from .functions import fit_leastsq
|
|
18
|
-
from .distributions import fermi_dirac
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class MDCs():
|
|
22
|
-
r"""
|
|
23
|
-
"""
|
|
24
|
-
def __init__(self, intensities, angles, ekin, angular_resolution):
|
|
25
|
-
self.intensities = intensities
|
|
26
|
-
self.angles = angles
|
|
27
|
-
self.ekin = ekin
|
|
28
|
-
self.angular_resolution = angular_resolution
|
|
29
|
-
|
|
30
|
-
# @add_fig_kwargs
|
|
31
|
-
# def fit(self):
|
|
32
|
-
# r"""
|
|
33
|
-
# """
|
|
34
|
-
# return 0
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# @add_fig_kwargs
|
|
38
|
-
# def fit_fermi_edge(self, hnuminphi_guess, background_guess=0.0,
|
|
39
|
-
# integrated_weight_guess=1.0, angle_min=-np.infty,
|
|
40
|
-
# angle_max=np.infty, ekin_min=-np.infty,
|
|
41
|
-
# ekin_max=np.infty, ax=None, **kwargs):
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@add_fig_kwargs
|
|
45
|
-
def plot(self, ax=None, **kwargs):
|
|
46
|
-
r"""
|
|
47
|
-
"""
|
|
48
|
-
ax, fig, plt = get_ax_fig_plt(ax=ax)
|
|
49
|
-
|
|
50
|
-
ax.scatter(self.angles, self.intensities)
|
|
51
|
-
|
|
52
|
-
ax.set_xlabel("Angle ($\degree$)")
|
|
53
|
-
ax.set_ylabel('Counts (-)')
|
|
54
|
-
|
|
55
|
-
return fig
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class band_map():
|
|
59
|
-
r"""Class for the band map from the ARPES experiment.
|
|
60
|
-
|
|
61
|
-
Parameters
|
|
62
|
-
----------
|
|
63
|
-
intensities : ndarray
|
|
64
|
-
2D array of counts for given (E,k) or (E,angle) pairs [counts]
|
|
65
|
-
angles : ndarray
|
|
66
|
-
1D array of angular values for the abscissa [degrees]
|
|
67
|
-
ekin : ndarray
|
|
68
|
-
1D array of kinetic energy values for the ordinate [eV]
|
|
69
|
-
angular_resolution : float, None
|
|
70
|
-
Angular resolution of the detector [degrees]
|
|
71
|
-
energy_resolution : float, None
|
|
72
|
-
Energy resolution of the detector [eV]
|
|
73
|
-
temperature : float, None
|
|
74
|
-
Temperature of the sample [K]
|
|
75
|
-
hnuminphi : float, None
|
|
76
|
-
Kinetic energy minus the work function [eV]
|
|
77
|
-
hnuminphi_std : float, None
|
|
78
|
-
Standard deviation of kinetic energy minus work function [eV]
|
|
79
|
-
"""
|
|
80
|
-
def __init__(self, intensities, angles, ekin, energy_resolution=None,
|
|
81
|
-
angular_resolution=None, temperature=None, hnuminphi=None,
|
|
82
|
-
hnuminphi_std=None):
|
|
83
|
-
self.intensities = intensities
|
|
84
|
-
self.angles = angles
|
|
85
|
-
self.ekin = ekin
|
|
86
|
-
self.energy_resolution = energy_resolution
|
|
87
|
-
self.angular_resolution = angular_resolution
|
|
88
|
-
self.temperature = temperature
|
|
89
|
-
self.hnuminphi = hnuminphi
|
|
90
|
-
self.hnuminphi_std = hnuminphi_std
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def hnuminphi(self):
|
|
94
|
-
r"""Returns the photon energy minus the work function in eV if it has
|
|
95
|
-
been set, either during instantiation, with the setter, or by fitting
|
|
96
|
-
the Fermi-Dirac distribution to the integrated weight.
|
|
97
|
-
|
|
98
|
-
Returns
|
|
99
|
-
-------
|
|
100
|
-
hnuminphi : float, None
|
|
101
|
-
Kinetic energy minus the work function [eV]
|
|
102
|
-
"""
|
|
103
|
-
return self._hnuminphi
|
|
104
|
-
|
|
105
|
-
@hnuminphi.setter
|
|
106
|
-
def hnuminphi(self, hnuminphi):
|
|
107
|
-
r"""Manually sets the photon energy minus the work function in eV if it
|
|
108
|
-
has been set; otherwise returns None.
|
|
109
|
-
|
|
110
|
-
Parameters
|
|
111
|
-
----------
|
|
112
|
-
hnuminphi : float, None
|
|
113
|
-
Kinetic energy minus the work function [eV]
|
|
114
|
-
"""
|
|
115
|
-
self._hnuminphi = hnuminphi
|
|
116
|
-
|
|
117
|
-
@property
|
|
118
|
-
def hnuminphi_std(self):
|
|
119
|
-
r"""Returns standard deviation of the photon energy minus the work
|
|
120
|
-
function in eV.
|
|
121
|
-
|
|
122
|
-
Returns
|
|
123
|
-
-------
|
|
124
|
-
hnuminphi_std : float
|
|
125
|
-
Standard deviation of energy minus the work function [eV]
|
|
126
|
-
"""
|
|
127
|
-
return self._hnuminphi_std
|
|
128
|
-
|
|
129
|
-
@hnuminphi_std.setter
|
|
130
|
-
def hnuminphi_std(self, hnuminphi_std):
|
|
131
|
-
r"""Manually sets the standard deviation of photon energy minus the
|
|
132
|
-
work function in eV.
|
|
133
|
-
|
|
134
|
-
Parameters
|
|
135
|
-
----------
|
|
136
|
-
hnuminphi_std : float
|
|
137
|
-
Standard deviation of energy minus the work function [eV]
|
|
138
|
-
"""
|
|
139
|
-
self._hnuminphi_std = hnuminphi_std
|
|
140
|
-
|
|
141
|
-
def shift_angles(self, shift):
|
|
142
|
-
r"""
|
|
143
|
-
Shifts the angles by the specified amount in degrees. Used to shift
|
|
144
|
-
from the detector angle to the material angle.
|
|
145
|
-
|
|
146
|
-
Parameters
|
|
147
|
-
----------
|
|
148
|
-
shift : float
|
|
149
|
-
Angular shift [degrees]
|
|
150
|
-
"""
|
|
151
|
-
self.angles = self.angles + shift
|
|
152
|
-
|
|
153
|
-
def slice(self, angle_min, angle_max, energy_value):
|
|
154
|
-
r"""
|
|
155
|
-
Parameters
|
|
156
|
-
----------
|
|
157
|
-
angle_min : float
|
|
158
|
-
Minimum angle of integration interval [degrees]
|
|
159
|
-
angle_max : float
|
|
160
|
-
Maximum angle of integration interval [degrees]
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
Returns
|
|
164
|
-
-------
|
|
165
|
-
angle_range : ndarray
|
|
166
|
-
Array of size n containing the angular values
|
|
167
|
-
energy_range : ndarray
|
|
168
|
-
Array of size m containing the energy values
|
|
169
|
-
mdcs :
|
|
170
|
-
Array of size nxm containing the MDC intensities
|
|
171
|
-
"""
|
|
172
|
-
|
|
173
|
-
energy_index = np.abs(self.ekin-energy_value).argmin()
|
|
174
|
-
angle_min_index = np.abs(self.angles-angle_min).argmin()
|
|
175
|
-
angle_max_index = np.abs(self.angles-angle_max).argmin()
|
|
176
|
-
|
|
177
|
-
angle_range = self.angles[angle_min_index:angle_max_index+1]
|
|
178
|
-
energy_range = self.ekin[energy_index]
|
|
179
|
-
mdcs = self.intensities[energy_index, angle_min_index:angle_max_index+1]
|
|
180
|
-
|
|
181
|
-
return mdcs, angle_range, energy_range, self.angular_resolution
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
@add_fig_kwargs
|
|
185
|
-
def plot_band_map(self, ax=None, **kwargs):
|
|
186
|
-
r"""Plots the band map.
|
|
187
|
-
|
|
188
|
-
Parameters
|
|
189
|
-
----------
|
|
190
|
-
|
|
191
|
-
Other parameters
|
|
192
|
-
----------------
|
|
193
|
-
**kwargs : dict, optional
|
|
194
|
-
Additional arguments passed on to add_fig_kwargs. See the keyword
|
|
195
|
-
table below.
|
|
196
|
-
|
|
197
|
-
Returns
|
|
198
|
-
-------
|
|
199
|
-
fig : Matplotlib-Figure
|
|
200
|
-
Figure containing the Fermi edge fit
|
|
201
|
-
"""
|
|
202
|
-
ax, fig, plt = get_ax_fig_plt(ax=ax)
|
|
203
|
-
|
|
204
|
-
Angl, Ekin = np.meshgrid(self.angles, self.ekin)
|
|
205
|
-
mesh = ax.pcolormesh(Angl, Ekin, self.intensities, shading="auto", cmap=plt.get_cmap("bone").reversed())
|
|
206
|
-
cbar = plt.colorbar(mesh, ax=ax)
|
|
207
|
-
|
|
208
|
-
ax.set_xlabel("Angle ($\degree$)")
|
|
209
|
-
ax.set_ylabel("$E_{\mathrm{kin}}$ (eV)")
|
|
210
|
-
|
|
211
|
-
return fig
|
|
212
|
-
|
|
213
|
-
@add_fig_kwargs
|
|
214
|
-
def fit_fermi_edge(self, hnuminphi_guess, background_guess=0.0,
|
|
215
|
-
integrated_weight_guess=1.0, angle_min=-np.infty,
|
|
216
|
-
angle_max=np.infty, ekin_min=-np.infty,
|
|
217
|
-
ekin_max=np.infty, ax=None, **kwargs):
|
|
218
|
-
r"""Fits the Fermi edge of the band map and plots the result.
|
|
219
|
-
Also sets hnuminphi, the kinetic energy minus the work function in eV.
|
|
220
|
-
The fitting includes an energy convolution with an abscissa range
|
|
221
|
-
expanded by 5 times the energy resolution standard deviation.
|
|
222
|
-
|
|
223
|
-
Parameters
|
|
224
|
-
----------
|
|
225
|
-
hnuminphi_guess : float
|
|
226
|
-
Initial guess for kinetic energy minus the work function [eV]
|
|
227
|
-
background_guess : float
|
|
228
|
-
Initial guess for background intensity [counts]
|
|
229
|
-
integrated_weight_guess : float
|
|
230
|
-
Initial guess for integrated spectral intensity [counts]
|
|
231
|
-
angle_min : float
|
|
232
|
-
Minimum angle of integration interval [degrees]
|
|
233
|
-
angle_max : float
|
|
234
|
-
Maximum angle of integration interval [degrees]
|
|
235
|
-
ekin_min : float
|
|
236
|
-
Minimum kinetic energy of integration interval [eV]
|
|
237
|
-
ekin_max : float
|
|
238
|
-
Maximum kinetic energy of integration interval [eV]
|
|
239
|
-
ax : Matplotlib-Axes / NoneType
|
|
240
|
-
Axis for plotting the Fermi edge on. Created if not provided by
|
|
241
|
-
the user.
|
|
242
|
-
|
|
243
|
-
Other parameters
|
|
244
|
-
----------------
|
|
245
|
-
**kwargs : dict, optional
|
|
246
|
-
Additional arguments passed on to add_fig_kwargs. See the keyword
|
|
247
|
-
table below.
|
|
248
|
-
|
|
249
|
-
Returns
|
|
250
|
-
-------
|
|
251
|
-
fig : Matplotlib-Figure
|
|
252
|
-
Figure containing the Fermi edge fit
|
|
253
|
-
"""
|
|
254
|
-
ax, fig, plt = get_ax_fig_plt(ax=ax)
|
|
255
|
-
|
|
256
|
-
min_angle_index = np.argmin(np.abs(self.angles - angle_min))
|
|
257
|
-
max_angle_index = np.argmin(np.abs(self.angles - angle_max))
|
|
258
|
-
|
|
259
|
-
min_ekin_index = np.argmin(np.abs(self.ekin - ekin_min))
|
|
260
|
-
max_ekin_index = np.argmin(np.abs(self.ekin - ekin_max))
|
|
261
|
-
|
|
262
|
-
energy_range = self.ekin[min_ekin_index:max_ekin_index]
|
|
263
|
-
|
|
264
|
-
integrated_intensity = np.trapz(
|
|
265
|
-
self.intensities[min_ekin_index:max_ekin_index,
|
|
266
|
-
min_angle_index:max_angle_index], axis=1)
|
|
267
|
-
|
|
268
|
-
fdir_initial = fermi_dirac(temperature=self.temperature,
|
|
269
|
-
hnuminphi=hnuminphi_guess,
|
|
270
|
-
background=background_guess,
|
|
271
|
-
integrated_weight=integrated_weight_guess,
|
|
272
|
-
name='Initial guess')
|
|
273
|
-
|
|
274
|
-
parameters = np.array(
|
|
275
|
-
[hnuminphi_guess, background_guess, integrated_weight_guess])
|
|
276
|
-
|
|
277
|
-
extra_args = (self.energy_resolution)
|
|
278
|
-
|
|
279
|
-
popt, pcov = fit_leastsq(parameters, energy_range, integrated_intensity,
|
|
280
|
-
fdir_initial, extra_args)
|
|
281
|
-
|
|
282
|
-
fdir_final = fermi_dirac(temperature=self.temperature,
|
|
283
|
-
hnuminphi=popt[0], background=popt[1],
|
|
284
|
-
integrated_weight=popt[2],
|
|
285
|
-
name='Fitted result')
|
|
286
|
-
|
|
287
|
-
self.hnuminphi = popt[0]
|
|
288
|
-
self.hnuminphi_std = np.sqrt(np.diag(pcov))[0][0]
|
|
289
|
-
|
|
290
|
-
ax.set_xlabel(r'$E_{\mathrm{kin}}$ (-)')
|
|
291
|
-
ax.set_ylabel('Counts (-)')
|
|
292
|
-
ax.set_xlim([ekin_min, ekin_max])
|
|
293
|
-
|
|
294
|
-
ax.plot(energy_range, integrated_intensity, label='Data')
|
|
295
|
-
|
|
296
|
-
ax.plot(energy_range, fdir_initial.convolve(energy_range,
|
|
297
|
-
energy_resolution=self.energy_resolution),
|
|
298
|
-
label=fdir_initial.name)
|
|
299
|
-
|
|
300
|
-
ax.plot(energy_range, fdir_final.convolve(energy_range,
|
|
301
|
-
energy_resolution=self.energy_resolution),
|
|
302
|
-
label=fdir_final.name)
|
|
303
|
-
|
|
304
|
-
ax.legend()
|
|
305
|
-
|
|
306
|
-
return fig
|
xarpes-0.2.3.dist-info/METADATA
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: xarpes
|
|
3
|
-
Version: 0.2.3
|
|
4
|
-
Summary: Extraction from angle resolved photoemission spectra
|
|
5
|
-
Author: xARPES Developers
|
|
6
|
-
Requires-Python: >=3.7.0
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Requires-Dist: igor2
|
|
11
|
-
Requires-Dist: jupyterlab
|
|
12
|
-
Requires-Dist: jupytext
|
|
13
|
-
Requires-Dist: matplotlib
|
|
14
|
-
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist: scipy
|
|
16
|
-
Requires-Dist: lmfit
|
|
17
|
-
Requires-Dist: xarray
|
|
18
|
-
Project-URL: Documentation, https://xarpes.github.io
|
|
19
|
-
|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
Repository for the code xARPES – extraction from angle resolved photoemission spectra.
|
|
23
|
-
|
|
24
|
-
This preliminary release can only be used to fit a Fermi edge. The complete functionality will be made available soon.
|
|
25
|
-
|
|
26
|
-
# Installation
|
|
27
|
-
|
|
28
|
-
xARPES can be installed with `pip`:
|
|
29
|
-
|
|
30
|
-
python3 -m pip install xarpes
|
|
31
|
-
|
|
32
|
-
Or with `conda`:
|
|
33
|
-
|
|
34
|
-
conda install conda-forge::xarpes
|
|
35
|
-
|
|
36
|
-
More detailed instructions for installing the development version, tested for recent Ubuntu and Debian GNU/Linux, are provided below.
|
|
37
|
-
|
|
38
|
-
## pip
|
|
39
|
-
|
|
40
|
-
It is highly recommended to set up a pristine Python virtual environment. First, the `venv` module might have to be installed:
|
|
41
|
-
|
|
42
|
-
sudo apt install python3-venv
|
|
43
|
-
|
|
44
|
-
Afterwards, one can activate a virtual environment named `<my_venv>` using:
|
|
45
|
-
|
|
46
|
-
python3 -m venv <my_venv>
|
|
47
|
-
|
|
48
|
-
It has to be activated whenever installing/running xARPES:
|
|
49
|
-
|
|
50
|
-
source <my_venv>/bin/activate
|
|
51
|
-
|
|
52
|
-
It is recommended to upgrade `pip` to the latest version:
|
|
53
|
-
|
|
54
|
-
python3 -m pip install --upgrade pip
|
|
55
|
-
|
|
56
|
-
Finally, the installation can be performed:
|
|
57
|
-
|
|
58
|
-
git clone git@github.com:xARPES/xARPES.git
|
|
59
|
-
cd xARPES
|
|
60
|
-
python3 -m pip install -e .
|
|
61
|
-
|
|
62
|
-
## conda
|
|
63
|
-
|
|
64
|
-
The user is assumed to be in a pristine virtual environment provided by conda. First, download the required version for your operating system from <https://docs.anaconda.com/free/miniconda/>. For example:
|
|
65
|
-
|
|
66
|
-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
|
67
|
-
|
|
68
|
-
Start the installation:
|
|
69
|
-
|
|
70
|
-
bash Miniconda3-latest-Linux-x86_64.sh
|
|
71
|
-
|
|
72
|
-
Then scroll down the license agreement and answer `yes` to the following question:
|
|
73
|
-
|
|
74
|
-
Do you accept the license terms? [yes|no]
|
|
75
|
-
|
|
76
|
-
Also specify your installation location.
|
|
77
|
-
|
|
78
|
-
It is convenient to also answer `yes` to the following, which will append new lines to your `~/.bashrc`:
|
|
79
|
-
|
|
80
|
-
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
|
|
81
|
-
|
|
82
|
-
A conda base environment is then activated with `source ~/.bashrc` or by starting a new terminal session.
|
|
83
|
-
|
|
84
|
-
Alternatively, you can answer `no` to the above question and activate conda whenever you need it:
|
|
85
|
-
|
|
86
|
-
eval "$(<your_path>/miniconda3/bin/conda shell.<your_shell> hook)"
|
|
87
|
-
|
|
88
|
-
Next, we install `conda-build` for developing xARPES (answer `y` to questions):
|
|
89
|
-
|
|
90
|
-
conda install conda-build
|
|
91
|
-
|
|
92
|
-
Finally, the following steps are executed for the installation – the `<my_env>` environment will have to be launched whenever running xARPES:
|
|
93
|
-
|
|
94
|
-
git clone git@github.com:xARPES/xARPES.git
|
|
95
|
-
cd xARPES
|
|
96
|
-
conda create -n <my_env> -c defaults -c conda-forge --file requirements.txt
|
|
97
|
-
conda activate <my_env>
|
|
98
|
-
conda develop .
|
|
99
|
-
|
|
100
|
-
Answer `y` to questions.
|
|
101
|
-
|
|
102
|
-
# Examples
|
|
103
|
-
|
|
104
|
-
Afer installation of xARPES, the `examples/` folder can be downloaded to the current directory with
|
|
105
|
-
|
|
106
|
-
python3 -c "import xarpes; xarpes.download_examples()"
|
|
107
|
-
|
|
108
|
-
# Execution
|
|
109
|
-
|
|
110
|
-
It is recommended to use JupyterLab to analyse data. JupyterLab is launched using:
|
|
111
|
-
|
|
112
|
-
jupyter lab
|
|
113
|
-
|
|
114
|
-
# License
|
|
115
|
-
|
|
116
|
-
Copyright (C) 2024 xARPES Developers
|
|
117
|
-
|
|
118
|
-
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation.
|
|
119
|
-
|
|
120
|
-
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
121
|
-
|
xarpes-0.2.3.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
xarpes/__init__.py,sha256=P2gd3I7U1a5sg7k46Cyo4YT2NqvqqYJ-X85-Vs6m5uI,149
|
|
2
|
-
xarpes/band_map.py,sha256=WvriXtP-vWny2yhPy9rC5rxS3fiTYaUph3vvg6GyCCQ,10492
|
|
3
|
-
xarpes/distributions.py,sha256=CvHVdtF-P2wXgahmH8j1nVAawsXyomImZUoNlvymIV4,15201
|
|
4
|
-
xarpes/functions.py,sha256=7WZVD8Vi4t2mg3EFJrAINTKg5Bj8EXMZh6c-N9qn6Nc,4606
|
|
5
|
-
xarpes/plotting.py,sha256=sHOI0zRb0zYgXPfWUtVOAc5ezasVsAVRb3u8E8-SHWc,5410
|
|
6
|
-
xarpes/.ipynb_checkpoints/__init__-checkpoint.py,sha256=Xi1H3Jn5vt_8WQhSTRqb9hSBhv12fTXEnQrKVdkFGcw,148
|
|
7
|
-
xarpes-0.2.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
8
|
-
xarpes-0.2.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
9
|
-
xarpes-0.2.3.dist-info/METADATA,sha256=yFbGz9lRmWqY2inVUuqhwFWTqZDyNvIShY51cII1KnY,3889
|
|
10
|
-
xarpes-0.2.3.dist-info/RECORD,,
|