xarpes 0.3.2__tar.gz → 0.3.4__tar.gz

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.
Files changed (32) hide show
  1. {xarpes-0.3.2 → xarpes-0.3.4}/PKG-INFO +13 -6
  2. {xarpes-0.3.2 → xarpes-0.3.4}/README.md +10 -4
  3. {xarpes-0.3.2 → xarpes-0.3.4}/examples/graphene/graphene.Rmd +68 -9
  4. {xarpes-0.3.2 → xarpes-0.3.4}/examples/graphene/graphene.py +62 -9
  5. {xarpes-0.3.2 → xarpes-0.3.4}/examples/srtio3/srtio3.Rmd +42 -30
  6. {xarpes-0.3.2 → xarpes-0.3.4}/examples/srtio3/srtio3.py +39 -27
  7. {xarpes-0.3.2 → xarpes-0.3.4}/pyproject.toml +3 -2
  8. {xarpes-0.3.2 → xarpes-0.3.4}/xarpes/__init__.py +2 -2
  9. {xarpes-0.3.2 → xarpes-0.3.4}/xarpes/functions.py +102 -48
  10. {xarpes-0.3.2 → xarpes-0.3.4}/xarpes/spectral.py +180 -72
  11. {xarpes-0.3.2 → xarpes-0.3.4}/.gitignore +0 -0
  12. {xarpes-0.3.2 → xarpes-0.3.4}/.readthedocs.yaml +0 -0
  13. {xarpes-0.3.2 → xarpes-0.3.4}/LICENSE +0 -0
  14. {xarpes-0.3.2 → xarpes-0.3.4}/dev_tools/Rmd2py.py +0 -0
  15. {xarpes-0.3.2 → xarpes-0.3.4}/doc/Makefile +0 -0
  16. {xarpes-0.3.2 → xarpes-0.3.4}/doc/README.md +0 -0
  17. {xarpes-0.3.2 → xarpes-0.3.4}/doc/_static/xarpes_small.svg +0 -0
  18. {xarpes-0.3.2 → xarpes-0.3.4}/doc/conf.py +0 -0
  19. {xarpes-0.3.2 → xarpes-0.3.4}/doc/index.rst +0 -0
  20. {xarpes-0.3.2 → xarpes-0.3.4}/doc/modules/distributions.rst +0 -0
  21. {xarpes-0.3.2 → xarpes-0.3.4}/doc/modules/functions.rst +0 -0
  22. {xarpes-0.3.2 → xarpes-0.3.4}/doc/modules/plotting.rst +0 -0
  23. {xarpes-0.3.2 → xarpes-0.3.4}/doc/modules/spectral.rst +0 -0
  24. {xarpes-0.3.2 → xarpes-0.3.4}/doc/requirements.txt +0 -0
  25. {xarpes-0.3.2 → xarpes-0.3.4}/examples/graphene/data_sets/graphene_152.ibw +0 -0
  26. {xarpes-0.3.2 → xarpes-0.3.4}/examples/srtio3/data_sets/STO_2_0010STO_2_.ibw +0 -0
  27. {xarpes-0.3.2 → xarpes-0.3.4}/logo/Makefile +0 -0
  28. {xarpes-0.3.2 → xarpes-0.3.4}/logo/exubi.svg +0 -0
  29. {xarpes-0.3.2 → xarpes-0.3.4}/logo/xarpes.svg +0 -0
  30. {xarpes-0.3.2 → xarpes-0.3.4}/xarpes/constants.py +0 -0
  31. {xarpes-0.3.2 → xarpes-0.3.4}/xarpes/distributions.py +0 -0
  32. {xarpes-0.3.2 → xarpes-0.3.4}/xarpes/plotting.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xarpes
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Extraction from angle resolved photoemission spectra
5
5
  Author: xARPES Developers
6
6
  Requires-Python: >=3.7.0
@@ -16,7 +16,8 @@ Requires-Dist: numpy
16
16
  Requires-Dist: scipy
17
17
  Requires-Dist: lmfit
18
18
  Requires-Dist: pyqt5
19
- Requires-Dist: ipympl
19
+ Requires-Dist: ipympl>=0.9.3
20
+ Requires-Dist: ipywidgets>=8.1.5
20
21
  Requires-Dist: ipykernel<6.32.0
21
22
  Project-URL: Documentation, https://xarpes.github.io
22
23
 
@@ -32,7 +33,7 @@ This project is currently undergoing **beta testing**. Some of the functionaliti
32
33
 
33
34
  # Contributing
34
35
 
35
- 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.
36
+ 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. Files useful for developers can be found in `/dev_tools`, such as the `Rmd2py.py` script for the development of examples.
36
37
 
37
38
  # Installation
38
39
 
@@ -41,6 +42,8 @@ xARPES installation can be divided into graphical package manager instructions,
41
42
  - via conda-forge, out-of-the-box or editable installation, sourcing the [conda-forge package](https://anaconda.org/conda-forge/xarpes).
42
43
  - via Pip, out-of-the-box or editable installation, sourcing the [PyPI package](https://pypi.org/project/xarpes).
43
44
 
45
+ We strongly recommend installing xARPES in a (conda/pip) virtual environment, and to activate the environment each time before activating xARPES.
46
+
44
47
  ## Graphical package manager installation
45
48
 
46
49
  Most IDEs and scientific Python distributions include a GUI-based package manager.
@@ -83,11 +86,13 @@ Example for Linux:
83
86
  wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
84
87
  bash Miniconda3-latest-Linux-x86_64.sh
85
88
 
86
- Create and activate an environment:
89
+ Answer `y` to questions. Create and activate a new environment:
87
90
 
88
91
  conda create -n <my_env> -c defaults -c conda-forge
89
92
  conda activate <my_env>
90
93
 
94
+ Where `<my_env>` must be replaced by your desired name.
95
+
91
96
  ### Installing xARPES
92
97
 
93
98
  #### Option A — Out-of-the-box installation (from conda-forge)
@@ -117,8 +122,8 @@ Install venv if necessary:
117
122
 
118
123
  Create and activate a virtual environment:
119
124
 
120
- python3 -m venv <my_venv>
121
- source <my_venv>/bin/activate
125
+ python3 -m venv <my_env>
126
+ source <my_env>/bin/activate
122
127
 
123
128
  Upgrade pip:
124
129
 
@@ -147,6 +152,8 @@ After installation of xARPES, the `examples/` folder can be downloaded to the cu
147
152
 
148
153
  python -c "import xarpes; xarpes.download_examples()"
149
154
 
155
+ This attempts to download the examples from the version corresponding encountered in `__init__.py`. If no corresponding tagged version can be downloaded, the code attempts to download the latest examples instead.
156
+
150
157
  # Execution
151
158
 
152
159
  It is recommended to use JupyterLab to analyse data. JupyterLab is launched using:
@@ -10,7 +10,7 @@ This project is currently undergoing **beta testing**. Some of the functionaliti
10
10
 
11
11
  # Contributing
12
12
 
13
- 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.
13
+ 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. Files useful for developers can be found in `/dev_tools`, such as the `Rmd2py.py` script for the development of examples.
14
14
 
15
15
  # Installation
16
16
 
@@ -19,6 +19,8 @@ xARPES installation can be divided into graphical package manager instructions,
19
19
  - via conda-forge, out-of-the-box or editable installation, sourcing the [conda-forge package](https://anaconda.org/conda-forge/xarpes).
20
20
  - via Pip, out-of-the-box or editable installation, sourcing the [PyPI package](https://pypi.org/project/xarpes).
21
21
 
22
+ We strongly recommend installing xARPES in a (conda/pip) virtual environment, and to activate the environment each time before activating xARPES.
23
+
22
24
  ## Graphical package manager installation
23
25
 
24
26
  Most IDEs and scientific Python distributions include a GUI-based package manager.
@@ -61,11 +63,13 @@ Example for Linux:
61
63
  wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
62
64
  bash Miniconda3-latest-Linux-x86_64.sh
63
65
 
64
- Create and activate an environment:
66
+ Answer `y` to questions. Create and activate a new environment:
65
67
 
66
68
  conda create -n <my_env> -c defaults -c conda-forge
67
69
  conda activate <my_env>
68
70
 
71
+ Where `<my_env>` must be replaced by your desired name.
72
+
69
73
  ### Installing xARPES
70
74
 
71
75
  #### Option A — Out-of-the-box installation (from conda-forge)
@@ -95,8 +99,8 @@ Install venv if necessary:
95
99
 
96
100
  Create and activate a virtual environment:
97
101
 
98
- python3 -m venv <my_venv>
99
- source <my_venv>/bin/activate
102
+ python3 -m venv <my_env>
103
+ source <my_env>/bin/activate
100
104
 
101
105
  Upgrade pip:
102
106
 
@@ -125,6 +129,8 @@ After installation of xARPES, the `examples/` folder can be downloaded to the cu
125
129
 
126
130
  python -c "import xarpes; xarpes.download_examples()"
127
131
 
132
+ This attempts to download the examples from the version corresponding encountered in `__init__.py`. If no corresponding tagged version can be downloaded, the code attempts to download the latest examples instead.
133
+
128
134
  # Execution
129
135
 
130
136
  It is recommended to use JupyterLab to analyse data. JupyterLab is launched using:
@@ -48,8 +48,7 @@ data_file_path = os.path.join(script_dir, dfld, flnm + extn)
48
48
  ```{python}
49
49
  # %matplotlib inline
50
50
 
51
- fig = plt.figure(figsize=(8, 5))
52
- ax = fig.gca()
51
+ fig = plt.figure(figsize=(8, 5)); ax = fig.gca()
53
52
 
54
53
  bmap = xarpes.BandMap(data_file_path, energy_resolution=0.01,
55
54
  angle_resolution=0.1, temperature=50)
@@ -124,9 +123,8 @@ fig = mdcs.visualize_guess(distributions=guess_dists, energy_value=energy_value,
124
123
  ```
125
124
 
126
125
  #### Note on interactive figures
127
- - Operability of the interactive figure is sensitive to configuration of the plotting backend.
128
- - With Python V>=3.13 in a conda environment, the figure may fail to show up more than once. In that case, the user could try to run "conda env config vars unset MPLBACKEND" inside the conda environment; in Python, this command can be preceded with an exclamation mark ("!conda env ...") such that the command is executed in the terminal. The reset should work after restarting the conda environment.
129
- - As a fallback, the user may switch "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
126
+ - The interactive figure might not work inside the Jupyter notebooks, despite our best efforts to ensure stability.
127
+ - As a fallback, the user may switch from "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
130
128
 
131
129
  ```{python}
132
130
  # %matplotlib widget
@@ -180,7 +178,7 @@ from xarpes.constants import stdv
180
178
 
181
179
  ax.errorbar(self_energy.enel_range, self_energy.imag,
182
180
  yerr=stdv * self_energy.imag_sigma, label =r"$-\Sigma''(E)$")
183
- ax.errorbar(self_energy.enel_range, self_energy.real,
181
+ ax.errorbar(self_energy.enel_range, self_energy.real,
184
182
  yerr=stdv * self_energy.real_sigma, label =r"$\Sigma'(E)$")
185
183
  ax.set_xlabel(r'$E-\mu$ (eV)'); ax.set_ylabel(r"$\Sigma'(E), -\Sigma''(E)$ (eV)")
186
184
 
@@ -202,8 +200,7 @@ xarpes.SpectralLinear(amplitude=450, peak=-7.25, broadening=0.01,
202
200
  name='Linear_left', index='1'),
203
201
  ])
204
202
 
205
- fig = plt.figure(figsize=(8, 6))
206
- ax = fig.gca()
203
+ fig = plt.figure(figsize=(8, 6)); ax = fig.gca()
207
204
 
208
205
  fig = mdc2.visualize_guess(distributions=guess_dists2, energy_value=0, ax=ax)
209
206
  ```
@@ -213,11 +210,71 @@ fig = mdc2.visualize_guess(distributions=guess_dists2, energy_value=0, ax=ax)
213
210
 
214
211
  fig = mdc2.fit_selection(distributions=guess_dists2, show=False, fig_close=True)
215
212
 
216
- self_left = xarpes.SelfEnergy(*mdc2.expose_parameters(select_label='Linear_left_1'))
213
+ self_left = xarpes.SelfEnergy(*mdc2.expose_parameters(select_label='Linear_left_1',
214
+ fermi_velocity=-2.67, fermi_wavevector=-0.354))
215
+ ```
216
+
217
+ ```{python}
218
+ import numpy as np
219
+
220
+ from xarpes.constants import dtor, pref
221
+
222
+ Angl, Ekin = np.meshgrid(bmap.angles, bmap.ekin)
223
+ Mome = np.sqrt(Ekin / pref) * np.sin(Angl * dtor)
224
+
225
+ kmin, kmax = np.min(Mome), np.max(Mome)
226
+
227
+ kspc = np.linspace(kmin, kmax, len(bmap.angles))
228
+
229
+ dis1 = self_energy.fermi_velocity * (kspc - self_energy.fermi_wavevector)
230
+
231
+ dis2 = self_left.fermi_velocity *(kspc - self_left.fermi_wavevector)
232
+ ```
233
+
234
+ ```{python}
235
+ # ax.set_xlim([np.min(Mome), np.max(Mome)])
236
+ # ax.set_ylim([np.min(Ekin - bmap.hnuminphi), np.max(Ekin - bmap.hnuminphi)])
237
+
238
+ from importlib import reload
239
+ import xarpes
240
+ reload(xarpes)
241
+
242
+ # %matplotlib inline
243
+
244
+ fig = plt.figure(figsize=(8, 5))
245
+ ax = fig.gca()
246
+
247
+ self_energies= xarpes.CreateSelfEnergies([
248
+ self_energy,
249
+ self_left
250
+ ])
251
+
252
+ fig = bmap.plot(abscissa='momentum', ordinate='electron_energy',
253
+ self_energies=self_energies, ax=ax, markersize=1.0)
217
254
  ```
218
255
 
219
256
  ```{python}
257
+ # %matplotlib inline
258
+
259
+ fig = plt.figure(figsize=(8, 5))
260
+ ax = fig.gca()
261
+
262
+ from xarpes.constants import stdv
263
+
264
+ ax.errorbar(self_left.mdc_maxima, self_left.enel_range,
265
+ xerr=stdv * self_left.peak_positions_sigma,
266
+ markersize=2, color='tab:red', label=self_left.label)
267
+
268
+ ax.errorbar(self_energy.mdc_maxima, self_energy.enel_range,
269
+ xerr=stdv * self_energy.peak_positions_sigma,
270
+ markersize=2, color='tab:blue', label=self_energy.label)
220
271
 
272
+ ax.plot(kspc, dis1, linestyle='--'); ax.plot(kspc, dis2, linestyle='--')
273
+
274
+ ax.set_xlim([np.min(Mome), np.max(Mome)])
275
+ ax.set_ylim([np.min(Ekin - bmap.hnuminphi), np.max(Ekin - bmap.hnuminphi)])
276
+
277
+ fig = bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
221
278
  ```
222
279
 
223
280
  ```{python}
@@ -413,4 +470,6 @@ self_left = xarpes.SelfEnergy(*mdc2.expose_parameters(select_label='Linear_left_
413
470
  # ax = fig.gca()
414
471
 
415
472
  # fig = mdcs.plot(distributions=guess_dists, ax=ax, energy_value=-0.003)
473
+
474
+
416
475
  ```
@@ -28,8 +28,7 @@ extn = '.ibw' # Extension of the file
28
28
  data_file_path = os.path.join(script_dir, dfld, flnm + extn)
29
29
 
30
30
 
31
- fig = plt.figure(figsize=(8, 5))
32
- ax = fig.gca()
31
+ fig = plt.figure(figsize=(8, 5)); ax = fig.gca()
33
32
 
34
33
  bmap = xarpes.BandMap(data_file_path, energy_resolution=0.01,
35
34
  angle_resolution=0.1, temperature=50)
@@ -94,9 +93,8 @@ ax = fig.gca()
94
93
  fig = mdcs.visualize_guess(distributions=guess_dists, energy_value=energy_value, ax=ax)
95
94
 
96
95
  # #### Note on interactive figures
97
- # - Operability of the interactive figure is sensitive to configuration of the plotting backend.
98
- # - With Python V>=3.13 in a conda environment, the figure may fail to show up more than once. In that case, the user could try to run "conda env config vars unset MPLBACKEND" inside the conda environment; in Python, this command can be preceded with an exclamation mark ("!conda env ...") such that the command is executed in the terminal. The reset should work after restarting the conda environment.
99
- # - As a fallback, the user may switch "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
96
+ # - The interactive figure might not work inside the Jupyter notebooks, despite our best efforts to ensure stability.
97
+ # - As a fallback, the user may switch from "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
100
98
 
101
99
 
102
100
  fig = plt.figure(figsize=(7, 5))
@@ -136,7 +134,7 @@ from xarpes.constants import stdv
136
134
 
137
135
  ax.errorbar(self_energy.enel_range, self_energy.imag,
138
136
  yerr=stdv * self_energy.imag_sigma, label =r"$-\Sigma''(E)$")
139
- ax.errorbar(self_energy.enel_range, self_energy.real,
137
+ ax.errorbar(self_energy.enel_range, self_energy.real,
140
138
  yerr=stdv * self_energy.real_sigma, label =r"$\Sigma'(E)$")
141
139
  ax.set_xlabel(r'$E-\mu$ (eV)'); ax.set_ylabel(r"$\Sigma'(E), -\Sigma''(E)$ (eV)")
142
140
 
@@ -155,8 +153,7 @@ xarpes.SpectralLinear(amplitude=450, peak=-7.25, broadening=0.01,
155
153
  name='Linear_left', index='1'),
156
154
  ])
157
155
 
158
- fig = plt.figure(figsize=(8, 6))
159
- ax = fig.gca()
156
+ fig = plt.figure(figsize=(8, 6)); ax = fig.gca()
160
157
 
161
158
  fig = mdc2.visualize_guess(distributions=guess_dists2, energy_value=0, ax=ax)
162
159
 
@@ -164,10 +161,64 @@ fig = mdc2.visualize_guess(distributions=guess_dists2, energy_value=0, ax=ax)
164
161
 
165
162
  fig = mdc2.fit_selection(distributions=guess_dists2, show=False, fig_close=True)
166
163
 
167
- self_left = xarpes.SelfEnergy(*mdc2.expose_parameters(select_label='Linear_left_1'))
164
+ self_left = xarpes.SelfEnergy(*mdc2.expose_parameters(select_label='Linear_left_1',
165
+ fermi_velocity=-2.67, fermi_wavevector=-0.354))
166
+
167
+ import numpy as np
168
+
169
+ from xarpes.constants import dtor, pref
170
+
171
+ Angl, Ekin = np.meshgrid(bmap.angles, bmap.ekin)
172
+ Mome = np.sqrt(Ekin / pref) * np.sin(Angl * dtor)
173
+
174
+ kmin, kmax = np.min(Mome), np.max(Mome)
175
+
176
+ kspc = np.linspace(kmin, kmax, len(bmap.angles))
177
+
178
+ dis1 = self_energy.fermi_velocity * (kspc - self_energy.fermi_wavevector)
179
+
180
+ dis2 = self_left.fermi_velocity *(kspc - self_left.fermi_wavevector)
181
+
182
+ # ax.set_xlim([np.min(Mome), np.max(Mome)])
183
+ # ax.set_ylim([np.min(Ekin - bmap.hnuminphi), np.max(Ekin - bmap.hnuminphi)])
184
+
185
+ from importlib import reload
186
+ import xarpes
187
+ reload(xarpes)
188
+
189
+
190
+ fig = plt.figure(figsize=(8, 5))
191
+ ax = fig.gca()
192
+
193
+ self_energies= xarpes.CreateSelfEnergies([
194
+ self_energy,
195
+ self_left
196
+ ])
168
197
 
198
+ fig = bmap.plot(abscissa='momentum', ordinate='electron_energy',
199
+ self_energies=self_energies, ax=ax, markersize=1.0)
169
200
 
170
201
 
202
+ fig = plt.figure(figsize=(8, 5))
203
+ ax = fig.gca()
204
+
205
+ from xarpes.constants import stdv
206
+
207
+ ax.errorbar(self_left.mdc_maxima, self_left.enel_range,
208
+ xerr=stdv * self_left.peak_positions_sigma,
209
+ markersize=2, color='tab:red', label=self_left.label)
210
+
211
+ ax.errorbar(self_energy.mdc_maxima, self_energy.enel_range,
212
+ xerr=stdv * self_energy.peak_positions_sigma,
213
+ markersize=2, color='tab:blue', label=self_energy.label)
214
+
215
+ ax.plot(kspc, dis1, linestyle='--'); ax.plot(kspc, dis2, linestyle='--')
216
+
217
+ ax.set_xlim([np.min(Mome), np.max(Mome)])
218
+ ax.set_ylim([np.min(Ekin - bmap.hnuminphi), np.max(Ekin - bmap.hnuminphi)])
219
+
220
+ fig = bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
221
+
171
222
 
172
223
 
173
224
 
@@ -329,3 +380,5 @@ self_left = xarpes.SelfEnergy(*mdc2.expose_parameters(select_label='Linear_left_
329
380
  # ax = fig.gca()
330
381
 
331
382
  # fig = mdcs.plot(distributions=guess_dists, ax=ax, energy_value=-0.003)
383
+
384
+
@@ -29,7 +29,7 @@ import os
29
29
  xarpes.plot_settings('default')
30
30
 
31
31
  # If needed, close figures before running other cells, if figures show up in the wrong places.
32
- get_ipython().events.register('pre_run_cell', lambda info: plt.close('all'))
32
+ # get_ipython().events.register('pre_run_cell', lambda info: plt.close('all'))
33
33
  ```
34
34
 
35
35
  ```{python}
@@ -71,9 +71,7 @@ print('The optimised h nu - Phi = ' + f'{bmap.hnuminphi:.4f}' + ' +/- '
71
71
  ```{python}
72
72
  # %matplotlib inline
73
73
 
74
- from xarpes.constants import dtor
75
-
76
- k_0 = -0.0014
74
+ k_0 = -0.0014 # 0.02
77
75
  theta_0 = 0
78
76
 
79
77
  guess_dists = xarpes.CreateDistributions([
@@ -86,7 +84,7 @@ xarpes.SpectralQuadratic(amplitude=1800, peak=-3.6, broadening=0.0004,
86
84
 
87
85
  import numpy as np
88
86
 
89
- mat_el = lambda x: np.sin((x - theta_0) * dtor) ** 2
87
+ mat_el = lambda x: np.sin((x - theta_0) * xarpes.dtor) ** 2
90
88
 
91
89
  mat_args = {}
92
90
 
@@ -104,9 +102,8 @@ fig = mdcs.visualize_guess(distributions=guess_dists, matrix_element=mat_el,
104
102
  ```
105
103
 
106
104
  #### Note on interactive figures
107
- - Operability of the interactive figure is sensitive to configuration of the plotting backend.
108
- - With Python V>=3.13 in a conda environment, the figure may fail to show up more than once. In that case, the user could try to run "conda env config vars unset MPLBACKEND" inside the conda environment; in Python, this command can be preceded with an exclamation mark ("!conda env ...") such that the command is executed in the terminal. The reset should work after restarting the conda environment.
109
- - As a fallback, the user may switch "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
105
+ - The interactive figure might not work inside the Jupyter notebooks, despite our best efforts to ensure stability.
106
+ - As a fallback, the user may switch from "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
110
107
 
111
108
  ```{python}
112
109
  # %matplotlib widget
@@ -128,8 +125,10 @@ fig = mdcs.fit_selection(distributions=guess_dists, matrix_element=mat_el,
128
125
  - Instead, the user is advised to carefully check correspondence of peak maxima with MDC fitting results.
129
126
 
130
127
  ```{python}
128
+ fermi_one = 0.142
129
+
131
130
  self_energy = xarpes.SelfEnergy(*mdcs.expose_parameters(select_label='Inner_band_1',
132
- bare_mass=0.6, fermi_wavevector=0.142, side='right'))
131
+ bare_mass=0.6, fermi_wavevector=fermi_one, side='right'))
133
132
 
134
133
  self_two = xarpes.SelfEnergy(*mdcs.expose_parameters(select_label='Outer_band_2',
135
134
  bare_mass=0.6, fermi_wavevector=0.207))
@@ -171,28 +170,46 @@ ax.set_ylim([0, 0.06])
171
170
  plt.legend(); plt.show()
172
171
  ```
173
172
 
173
+ ```{python}
174
+ import numpy as np
175
+
176
+ Angl, Ekin = np.meshgrid(bmap.angles, bmap.ekin)
177
+ Mome = np.sqrt(Ekin / xarpes.pref) * np.sin(Angl * xarpes.dtor)
178
+
179
+ kmin, kmax = np.min(Mome), np.max(Mome)
180
+
181
+ kspc = np.linspace(kmin, kmax, len(bmap.angles))
182
+
183
+ dis1 = xarpes.pref * (((kspc - self_energy.center_wavevector)**2 - self_energy.fermi_wavevector**2)) \
184
+ / self_energy.bare_mass
185
+
186
+ # dis1 = self_energy.fermi_velocity * (kspc - self_energy.fermi_wavevector)
187
+
188
+ # dis2 = self_left.fermi_velocity *(kspc - self_left.fermi_wavevector)
189
+ ```
190
+
174
191
  ```{python}
175
192
  # %matplotlib inline
176
193
 
177
194
  fig = plt.figure(figsize=(10, 7))
178
195
  ax = fig.gca()
179
196
 
180
- from xarpes.constants import stdv
197
+ self_energies = xarpes.CreateSelfEnergies([self_energy, self_two])
181
198
 
182
- ax.errorbar(self_energy.peak_positions, self_energy.enel_range,
183
- xerr=stdv * self_energy.peak_positions_sigma,
184
- markersize=2, color='tab:blue', label=self_energy.label)
185
- ax.errorbar(self_two.peak_positions, self_two.enel_range,
186
- xerr=stdv * self_two.peak_positions_sigma,
187
- markersize=2, color='tab:purple', label=self_two.label)
199
+ # ax.errorbar(self_energy.mdc_maxima, self_energy.enel_range,
200
+ # xerr=stdv * self_energy.peak_positions_sigma,
201
+ # markersize=2, color='tab:blue', label=self_energy.label)
202
+ # ax.errorbar(self_two.mdc_maxima, self_two.enel_range,
203
+ # xerr=stdv * self_two.peak_positions_sigma,
204
+ # markersize=2, color='tab:purple', label=self_two.label)
205
+
206
+ ax.plot(kspc, dis1, linestyle='--')
188
207
 
189
208
  ax.set_xlim([-0.25, 0.25]); ax.set_ylim([-0.3, 0.1])
190
209
 
191
210
  plt.legend()
192
211
 
193
212
  fig = bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
194
-
195
- plt.show()
196
213
  ```
197
214
 
198
215
  ```{python}
@@ -245,16 +262,16 @@ ax = fig.gca()
245
262
 
246
263
  from xarpes.constants import stdv
247
264
 
248
- ax.errorbar(self_energy.peak_positions, self_energy.enel_range,
265
+ ax.errorbar(self_energy.mdc_maxima, self_energy.enel_range,
249
266
  xerr=stdv * self_energy.peak_positions_sigma,
250
267
  markersize=2, color='tab:blue', label=self_energy.label)
251
- ax.errorbar(self_two.peak_positions, self_two.enel_range,
268
+ ax.errorbar(self_two.mdc_maxima, self_two.enel_range,
252
269
  xerr=stdv * self_two.peak_positions_sigma,
253
270
  markersize=2, color='tab:purple', label=self_two.label)
254
- ax.errorbar(self_three.peak_positions, self_three.enel_range,
271
+ ax.errorbar(self_three.mdc_maxima, self_three.enel_range,
255
272
  xerr=stdv * self_three.peak_positions_sigma,
256
273
  markersize=2, color='tab:brown', label=self_three.label)
257
- ax.errorbar(self_four.peak_positions, self_four.enel_range,
274
+ ax.errorbar(self_four.mdc_maxima, self_four.enel_range,
258
275
  xerr=stdv * self_four.peak_positions_sigma,
259
276
  markersize=2, color='palevioletred', label=self_four.label)
260
277
 
@@ -262,14 +279,10 @@ ax.set_xlim([0, 0.25]); ax.set_ylim([-0.15, 0.05])
262
279
 
263
280
  plt.legend()
264
281
 
265
- # Put <1 zorder such that scatters aren't overrridden
266
- bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax, zorder=0.5)
267
282
 
268
- plt.show()
269
- ```
270
-
271
- ```{python}
283
+ bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
272
284
 
285
+ plt.show()
273
286
  ```
274
287
 
275
288
  ```{python}
@@ -581,8 +594,7 @@ plt.show()
581
594
 
582
595
  # plt.legend()
583
596
 
584
- # # Put <1 zorder such that scatters aren't overrridden
585
- # bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax, zorder=0.5)
597
+ # bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
586
598
 
587
599
  # plt.show()
588
600
  ```
@@ -46,9 +46,7 @@ print('The optimised h nu - Phi = ' + f'{bmap.hnuminphi:.4f}' + ' +/- '
46
46
  + f'{bmap.hnuminphi_std:.4f}' + ' eV.')
47
47
 
48
48
 
49
- from xarpes.constants import dtor
50
-
51
- k_0 = -0.0014
49
+ k_0 = -0.0014 # 0.02
52
50
  theta_0 = 0
53
51
 
54
52
  guess_dists = xarpes.CreateDistributions([
@@ -61,7 +59,7 @@ xarpes.SpectralQuadratic(amplitude=1800, peak=-3.6, broadening=0.0004,
61
59
 
62
60
  import numpy as np
63
61
 
64
- mat_el = lambda x: np.sin((x - theta_0) * dtor) ** 2
62
+ mat_el = lambda x: np.sin((x - theta_0) * xarpes.dtor) ** 2
65
63
 
66
64
  mat_args = {}
67
65
 
@@ -78,9 +76,8 @@ fig = mdcs.visualize_guess(distributions=guess_dists, matrix_element=mat_el,
78
76
  matrix_args=mat_args, energy_value=-0.000, ax=ax)
79
77
 
80
78
  # #### Note on interactive figures
81
- # - Operability of the interactive figure is sensitive to configuration of the plotting backend.
82
- # - With Python V>=3.13 in a conda environment, the figure may fail to show up more than once. In that case, the user could try to run "conda env config vars unset MPLBACKEND" inside the conda environment; in Python, this command can be preceded with an exclamation mark ("!conda env ...") such that the command is executed in the terminal. The reset should work after restarting the conda environment.
83
- # - As a fallback, the user may switch "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
79
+ # - The interactive figure might not work inside the Jupyter notebooks, despite our best efforts to ensure stability.
80
+ # - As a fallback, the user may switch from "%matplotlib widget" to "%matplotlib qt", after which the figure should pop up in an external window.
84
81
 
85
82
 
86
83
  fig = plt.figure(figsize=(7, 5))
@@ -98,8 +95,10 @@ fig = mdcs.fit_selection(distributions=guess_dists, matrix_element=mat_el,
98
95
  # - However, this would also require setting boundaries for the fitting range.
99
96
  # - Instead, the user is advised to carefully check correspondence of peak maxima with MDC fitting results.
100
97
 
98
+ fermi_one = 0.142
99
+
101
100
  self_energy = xarpes.SelfEnergy(*mdcs.expose_parameters(select_label='Inner_band_1',
102
- bare_mass=0.6, fermi_wavevector=0.142, side='right'))
101
+ bare_mass=0.6, fermi_wavevector=fermi_one, side='right'))
103
102
 
104
103
  self_two = xarpes.SelfEnergy(*mdcs.expose_parameters(select_label='Outer_band_2',
105
104
  bare_mass=0.6, fermi_wavevector=0.207))
@@ -133,18 +132,36 @@ ax.set_ylim([0, 0.06])
133
132
 
134
133
  plt.legend(); plt.show()
135
134
 
135
+ import numpy as np
136
+
137
+ Angl, Ekin = np.meshgrid(bmap.angles, bmap.ekin)
138
+ Mome = np.sqrt(Ekin / xarpes.pref) * np.sin(Angl * xarpes.dtor)
139
+
140
+ kmin, kmax = np.min(Mome), np.max(Mome)
141
+
142
+ kspc = np.linspace(kmin, kmax, len(bmap.angles))
143
+
144
+ dis1 = xarpes.pref * (((kspc - self_energy.center_wavevector)**2 - self_energy.fermi_wavevector**2)) \
145
+ / self_energy.bare_mass
146
+
147
+ # dis1 = self_energy.fermi_velocity * (kspc - self_energy.fermi_wavevector)
148
+
149
+ # dis2 = self_left.fermi_velocity *(kspc - self_left.fermi_wavevector)
150
+
136
151
 
137
152
  fig = plt.figure(figsize=(10, 7))
138
153
  ax = fig.gca()
139
154
 
140
- from xarpes.constants import stdv
155
+ self_energies = xarpes.CreateSelfEnergies([self_energy, self_two])
141
156
 
142
- ax.errorbar(self_energy.peak_positions, self_energy.enel_range,
143
- xerr=stdv * self_energy.peak_positions_sigma,
144
- markersize=2, color='tab:blue', label=self_energy.label)
145
- ax.errorbar(self_two.peak_positions, self_two.enel_range,
146
- xerr=stdv * self_two.peak_positions_sigma,
147
- markersize=2, color='tab:purple', label=self_two.label)
157
+ # ax.errorbar(self_energy.mdc_maxima, self_energy.enel_range,
158
+ # xerr=stdv * self_energy.peak_positions_sigma,
159
+ # markersize=2, color='tab:blue', label=self_energy.label)
160
+ # ax.errorbar(self_two.mdc_maxima, self_two.enel_range,
161
+ # xerr=stdv * self_two.peak_positions_sigma,
162
+ # markersize=2, color='tab:purple', label=self_two.label)
163
+
164
+ ax.plot(kspc, dis1, linestyle='--')
148
165
 
149
166
  ax.set_xlim([-0.25, 0.25]); ax.set_ylim([-0.3, 0.1])
150
167
 
@@ -152,8 +169,6 @@ plt.legend()
152
169
 
153
170
  fig = bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
154
171
 
155
- plt.show()
156
-
157
172
 
158
173
  guess_dists = xarpes.CreateDistributions([
159
174
  xarpes.Constant(offset=600),
@@ -194,16 +209,16 @@ ax = fig.gca()
194
209
 
195
210
  from xarpes.constants import stdv
196
211
 
197
- ax.errorbar(self_energy.peak_positions, self_energy.enel_range,
212
+ ax.errorbar(self_energy.mdc_maxima, self_energy.enel_range,
198
213
  xerr=stdv * self_energy.peak_positions_sigma,
199
214
  markersize=2, color='tab:blue', label=self_energy.label)
200
- ax.errorbar(self_two.peak_positions, self_two.enel_range,
215
+ ax.errorbar(self_two.mdc_maxima, self_two.enel_range,
201
216
  xerr=stdv * self_two.peak_positions_sigma,
202
217
  markersize=2, color='tab:purple', label=self_two.label)
203
- ax.errorbar(self_three.peak_positions, self_three.enel_range,
218
+ ax.errorbar(self_three.mdc_maxima, self_three.enel_range,
204
219
  xerr=stdv * self_three.peak_positions_sigma,
205
220
  markersize=2, color='tab:brown', label=self_three.label)
206
- ax.errorbar(self_four.peak_positions, self_four.enel_range,
221
+ ax.errorbar(self_four.mdc_maxima, self_four.enel_range,
207
222
  xerr=stdv * self_four.peak_positions_sigma,
208
223
  markersize=2, color='palevioletred', label=self_four.label)
209
224
 
@@ -211,12 +226,10 @@ ax.set_xlim([0, 0.25]); ax.set_ylim([-0.15, 0.05])
211
226
 
212
227
  plt.legend()
213
228
 
214
- # Put <1 zorder such that scatters aren't overrridden
215
- bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax, zorder=0.5)
216
-
217
- plt.show()
218
229
 
230
+ bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
219
231
 
232
+ plt.show()
220
233
 
221
234
 
222
235
  # fig = plt.figure(figsize=(7, 5))
@@ -476,8 +489,7 @@ plt.show()
476
489
 
477
490
  # plt.legend()
478
491
 
479
- # # Put <1 zorder such that scatters aren't overrridden
480
- # bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax, zorder=0.5)
492
+ # bmap.plot(abscissa='momentum', ordinate='electron_energy', ax=ax)
481
493
 
482
494
  # plt.show()
483
495
 
@@ -24,8 +24,9 @@ dependencies = [
24
24
  "scipy",
25
25
  "lmfit",
26
26
  "pyqt5",
27
- "ipympl",
28
- "ipykernel<6.32.0"
27
+ "ipympl>=0.9.3",
28
+ "ipywidgets>=8.1.5",
29
+ "ipykernel<6.32.0"
29
30
  ]
30
31
 
31
32
  [project.scripts]
@@ -1,6 +1,6 @@
1
- __version__ = '0.3.2'
1
+ __version__ = '0.3.4'
2
2
 
3
3
  from .spectral import *
4
4
  from .distributions import *
5
5
  from .functions import *
6
- from .plotting import *
6
+ from .plotting import *