Skip to content

Document absolute EELS quantification and intensity units#177

Open
francisco-dlp wants to merge 1 commit into
hyperspy:mainfrom
francisco-dlp:ENH_EELS_quantification_units
Open

Document absolute EELS quantification and intensity units#177
francisco-dlp wants to merge 1 commit into
hyperspy:mainfrom
francisco-dlp:ENH_EELS_quantification_units

Conversation

@francisco-dlp

Copy link
Copy Markdown
Member

Adds comprehensive documentation explaining how to convert the fitted intensity parameter of EELSCLEdge to areal density (atoms/nm²).

Key changes:

  • EELSCLEdge.intensity docstring: documents proportionality to areal density, conversion formula, and dwell-time correction.
  • EELSModel.quantify() docstring: explains printed intensities scale cross-sections in barns/eV/atom.
  • EELSMODEL_PARAMETERS docstring: notes raw low-loss required for absolute quantification.
  • User guide (eels.rst): new Absolute quantification subsection with formulas.
  • Example script: adds quantification step after fitting.
  • GOS integrateq docstrings: document return units (barns/eV/atom).

Adds comprehensive documentation explaining how to convert the fitted intensity parameter of EELSCLEdge to areal density (atoms/nm²).

Key changes:

- EELSCLEdge.intensity docstring: documents proportionality to areal density, conversion formula, and dwell-time correction.

- EELSModel.quantify() docstring: explains printed intensities scale cross-sections in barns/eV/atom.

- EELSMODEL_PARAMETERS docstring: notes raw low-loss required for absolute quantification.

- User guide (eels.rst): new Absolute quantification subsection with formulas.

- Example script: adds quantification step after fitting.

- GOS integrateq docstrings: document return units (barns/eV/atom).
@francisco-dlp francisco-dlp added documentation Improvements or additions to documentation status: needs review labels May 13, 2026
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.36%. Comparing base (10e53fa) to head (262c48b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   88.33%   88.36%   +0.03%     
==========================================
  Files         100      100              
  Lines        7764     7764              
  Branches      932      932              
==========================================
+ Hits         6858     6861       +3     
+ Misses        632      629       -3     
  Partials      274      274              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation and examples for converting fitted EELS core-loss edge intensity values into absolute areal density (atoms/nm²), clarifying the underlying cross-section units and required acquisition/normalization assumptions.

Changes:

  • Expanded docstrings to explain the intensity scaling relationship, units (barns/eV/atom), and dwell-time correction requirements.
  • Added/updated user-guide documentation for “Absolute quantification” with formulas and warnings.
  • Updated the EELS curve-fitting example to demonstrate converting fitted intensities to atoms/nm².

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
exspy/models/eelsmodel.py Extends EELSModel.quantify() docstring with absolute-quantification context and cross-section units.
exspy/components/_eels_cl_edge.py Documents EELSCLEdge.intensity conversion to atoms/nm² and dwell-time correction caveats.
exspy/_misc/eels/hydrogenic_gos.py Documents integrateq() return units (barns/eV/atom).
exspy/_misc/eels/base_gos.py Documents integrateq() return units (barns/eV/atom).
exspy/_docstrings/model.py Notes raw low-loss requirement and dwell-time correction in common model parameter docs.
examples/model_fitting/EELS_curve_fitting.py Adds a quantification printout and example conversion to atoms/nm² after fitting.
doc/user_guide/eels.rst Adds an “Absolute quantification” section with formula and warnings about dwell time / normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exspy/models/eelsmodel.py
Comment on lines +108 to +110
spectrum (i.e. counts), the fitted ``intensity`` equals
:math:`N \times 10^{-10}`, where :math:`N` is the areal
density in atoms/nm². Consequently:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@ericpre ericpre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

Comment thread doc/user_guide/eels.rst

.. math::

\text{intensity} = N \times 10^{-10}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain where does this 1e-10 come from?

Comment on lines +108 to +110
spectrum (i.e. counts), the fitted ``intensity`` equals
:math:`N \times 10^{-10}`, where :math:`N` is the areal
density in atoms/nm². Consequently:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation status: waiting for author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants