feat: add asymmetric split gaussian shape - #97
Merged
Merged
Conversation
`SplitGaussian` models an asymmetric peak as two gaussian halves sharing the apex, each with its own width (`fwhmLeft` / `fwhmRight`). Includes the analytical derivative, area/height helpers, registry wiring (`getShape1D`), and tests.
… npm run prettier-write
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
=======================================
Coverage ? 96.13%
=======================================
Files ? 24
Lines ? 1088
Branches ? 242
=======================================
Hits ? 1046
Misses ? 41
Partials ? 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`(fwhmLow + fwhmHigh) / 2` is not an aggregate of the two halves, it is the peak's full width at half maximum: the half-maximum crossings sit at `-fwhmLow / 2` and `fwhmHigh / 2`. `fwhmToWidth` is exact in the same way, the width it returns for that fwhm being `σlow + σhigh`; the only caveat is that a single width cannot be mapped back to the two halves. `getSplitGaussianData` also listed an `fwhm` shape parameter, which does not exist. The tests now pin the crossings the fwhm is defined from, the halves each derivative belongs to, the apex, the default widths, the `length` option, and that equal halves reproduce `getGaussianData` exactly. Assisted-By: Claude Opus 5
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.
Adds
SplitGaussian, an asymmetric peak made of two gaussian halves sharing the apex — the lower-x half (x ≤ 0) usesfwhmLow, the higher-x half (x > 0) usesfwhmHigh. Left/right would be ambiguous in NMR, where the axis runs the other way.Equal halves reduce to a plain
Gaussian, andfwhmis the true full width at half maximum of the composite peak, the crossings being at-fwhmLow / 2andfwhmHigh / 2. Ships the analytical derivative, area/height helpers,getShape1Dwiring, and tests.