Skip to content

Commit c7f7f30

Browse files
authored
Merge pull request #264 from pycroscopy/plotly-support
update
2 parents 256d722 + add8f91 commit c7f7f30

5 files changed

Lines changed: 444 additions & 3153 deletions

File tree

notebooks/Diffraction/D1_Diffraction_Rings.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
" version = '-1'\n",
8686
" return version\n",
8787
"\n",
88-
"if test_package('pyTEMlib') < '0.2025.12.0':\n",
88+
"if test_package('pyTEMlib') < '0.2026.06.0':\n",
8989
" print('installing pyTEMlib')\n",
9090
" !{sys.executable} -m pip install git+https://github.com/pycroscopy/pyTEMlib.git@main -q --upgrade\n",
9191
"\n",

notebooks/Introduction/1_Installation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
" version = '-1'\n",
7474
" return version\n",
7575
"\n",
76-
"if test_package('pyTEMlib') < '0.2025.12.1':\n",
76+
"if test_package('pyTEMlib') < '0.2026.06.0':\n",
7777
" print('installing pyTEMlib')\n",
7878
" !{sys.executable} -m pip install --upgrade pyTEMlib -q\n",
7979
"\n",

notebooks/Introduction/2_Open_Files.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
" version = '-1'\n",
7171
" return version\n",
7272
"\n",
73-
"if test_package('pyTEMlib') < '0.2025.12.1':\n",
73+
"if test_package('pyTEMlib') < '0.2026.06.0':\n",
7474
" print('installing pyTEMlib')\n",
7575
" !{sys.executable} -m pip install --upgrade pyTEMlib -q\n",
7676
"\n",

notebooks/Spectroscopy/S2-Analyse_CoreLoss_EELS.ipynb

Lines changed: 432 additions & 3140 deletions
Large diffs are not rendered by default.

pyTEMlib/utilities.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def effective_collection_angle(energy_scale: np.ndarray,
179179
#
180180
"""
181181
z1 = beam_ev # eV
182-
z2 = energy_scale[0]
182+
z2 = np.max([energy_scale[0], 1.0])
183183
z3 = energy_scale[-1]
184184
z4 = 100.0
185185
z5 = alpha*0.001 # rad
@@ -191,11 +191,11 @@ def effective_collection_angle(energy_scale: np.ndarray,
191191
for zx in range(int(z2),int(z3),int(z4)): #! zx = current energy loss
192192
eta=0.0;
193193
x0=float(zx)*(z1+511060.)/(z1*(z1+1022120.)); # x0 = relativistic theta-e
194-
x1 = np.pi/(2.*x0);
195-
x2=x0*x0+z5*z5;
196-
x3=z5/x0*z5/x0;
197-
x4=0.1*np.sqrt(x2);
198-
dtheta=(z6-x4)/z7;
194+
x1 = np.pi/(2.*x0)
195+
x2=x0*x0+z5*z5
196+
x3=z5/x0*z5/x0
197+
x4=0.1*np.sqrt(x2)
198+
dtheta=(z6-x4)/z7
199199
#
200200
# calculation of the analytical expression
201201
#
@@ -225,10 +225,9 @@ def effective_collection_angle(energy_scale: np.ndarray,
225225
#
226226
# calculation of beta *
227227
#
228-
x6=np.power((1.+x1*x1),eta);
229-
x7=x0*np.sqrt(x6-1.);
230-
y=x7*1000.;
231-
228+
x6=np.power((1.+x1*x1),eta)
229+
x7=x0*np.sqrt(x6-1.)
230+
y=x7*1000.
232231

233232
return y
234233

0 commit comments

Comments
 (0)