Skip to content

Commit 3690012

Browse files
committed
update
1 parent b998921 commit 3690012

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

notebooks/Spectroscopy/EDS.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
},
469469
{
470470
"cell_type": "code",
471-
"execution_count": 10,
471+
"execution_count": 12,
472472
"id": "7f9e23cc-bbb2-47d1-ae3b-7ec78532aeec",
473473
"metadata": {
474474
"scrolled": true
@@ -478,17 +478,17 @@
478478
"name": "stdout",
479479
"output_type": "stream",
480480
"text": [
481-
"Element: Nb, Corrected Atom%: 0.25, Corrected Weight%: 0.65\n",
482-
"Element: Sr, Corrected Atom%: 19.56, Corrected Weight%: 46.75\n",
483-
"Element: Ti, Corrected Atom%: 20.25, Corrected Weight%: 26.45\n",
484-
"Element: O, Corrected Atom%: 59.93, Corrected Weight%: 26.16\n",
485-
"Element: Cu, Corrected Atom%: 0.00, Corrected Weight%: 0.00\n"
481+
"Element: O, Corrected Atom%: 58.60, Corrected Weight%: 25.10\n",
482+
"Element: Sr, Corrected Atom%: 20.22, Corrected Weight%: 47.43\n",
483+
"Element: Cu, Corrected Atom%: 0.00, Corrected Weight%: 0.00\n",
484+
"Element: Ti, Corrected Atom%: 20.92, Corrected Weight%: 26.81\n",
485+
"Element: Nb, Corrected Atom%: 0.26, Corrected Weight%: 0.66\n"
486486
]
487487
}
488488
],
489489
"source": [
490490
"# ------ Input ----------\n",
491-
"thickness_in_nm = 250\n",
491+
"thickness_in_nm = 210\n",
492492
"# -----------------------\n",
493493
"pyTEMlib.eds_tools.apply_absorption_correction(spectrum, thickness_in_nm)\n",
494494
"for key, value in spectrum.metadata['EDS']['GUI'].items():\n",

pyTEMlib/eds_tools/eds_tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ def fit_model(spectrum, use_detector_efficiency=False):
473473
def residuals(pp, yy):
474474
""" residuals for fit"""
475475
model = np.zeros(len(yy))
476+
pp = np.abs(pp)
476477
for i in range(len(pp)-4):
477478
model += peaks[i]*pp[i]
478479
if use_detector_efficiency:
@@ -486,8 +487,8 @@ def residuals(pp, yy):
486487
y = np.array(spectrum) # .compute()
487488
[p, _] = scipy.optimize.leastsq(residuals, pin, args=(y,), maxfev=10000)
488489

489-
update_fit_values(spectrum.metadata['EDS'], peaks, p)
490-
return np.array(peaks), np.array(p)
490+
update_fit_values(spectrum.metadata['EDS'], peaks, np,abs(p)
491+
return np.array(peaks), np.abs(p)
491492

492493

493494
def update_fit_values(out_tags, peaks, p):

pyTEMlib/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
version
33
"""
4-
__version__ = '0.2026.1.3'
4+
__version__ = '0.2026.3.0'
55
__time__ = '2026-01-28 20:58:26'

0 commit comments

Comments
 (0)