ENH: Add ssd parameter to fourier_log_deconvolution#178
Draft
francisco-dlp wants to merge 2 commits into
Draft
Conversation
Default (ssd=False) returns J¹(E) = I₀·S(E), the single-scattering component that an idealized (plural-scattering-free) experiment would record. Set ssd=True to divide by I₀ and recover S(E) directly, whose integral equals t/λ, for absolute quantification. Constraint: default behaviour is unchanged from prior releases Confidence: high Scope-risk: narrow Assisted-by: opus:deepseek-v4-pro
When add_zlp=True and ssd=True the ZLP must be divided by I₀ to keep units coherent with the normalised SSD output. Without scaling the raw ZLP counts (typically 10⁴–10⁶) would dominate the dimensionless SSD by 7–9 orders of magnitude. - add_zlp block computes zlp_add = zlp.data / i0 for ssd=True - Add quantification-pitfall warning to docstring - Strengthen test_add_zlp_with_ssd: verify integral = t/λ + 1 and consistency with J¹ output outside taper region - Add test_add_zlp_j1_raw_zlp: verify J¹ case adds raw ZLP - Expand user guide with J¹/SSD distinction and quantification guidance Assisted-by: deepseek-v4-pro:deepseek-v4-pro
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
==========================================
+ Coverage 88.33% 88.70% +0.37%
==========================================
Files 100 100
Lines 7764 7838 +74
Branches 932 934 +2
==========================================
+ Hits 6858 6953 +95
+ Misses 632 607 -25
- Partials 274 278 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an
ssdparameter tofourier_log_deconvolutionthat optionally returns the normalised single-scattering distributionS(E)instead of the defaultJ^1(E) = I₀ · S(E).ssd=False(default)J¹(E)I₀ · t/λssd=TrueS(E)t/λAdditional fixes
add_zlpscaling: Whenadd_zlp=Truewithssd=True, the ZLP is now correctly scaled by1/I₀to match SSD normalisation. Previously raw ZLP counts were added, producing nonsense output 7–9 orders of magnitude too large.J¹(E)must be divided byI₀for areal-density quantification.Changes
exspy/signals/_eels.py—ssdparameter +add_zlpscaling fix + docstring warningexspy/tests/signals/test_eels.py— 7 new tests inTestFourierLogDeconvolutiondoc/user_guide/eels.rst— expanded Deconvolutions sectionupcoming_changes/168.enhancements.rst— towncrier changelogTest results
two_area_powerlaw_estimation*failures unrelated to this PR)References