-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite get_pe_res
: numerical FWHM calculation
#137
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #137 +/- ##
==========================================
- Coverage 28.39% 28.24% -0.16%
==========================================
Files 37 37
Lines 3564 3583 +19
==========================================
Hits 1012 1012
- Misses 2552 2571 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
get_pe_res
: numerical FWHM calculation Fix #130get_pe_res
: numerical FWHM calculation
Unit tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manchmal sieht man den Wald vor lauter Bäumen nicht 🥠🌳🔥
I am happy with the PR. Let's finish this soon and merge! |
Glad I could help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works without throwing an error, I would also be happy to merge.
I take this as a yes. |
Fix #130.
The previous implementation of the
get_pe_res
function was incorrect. Since there is no closed formula for the FWHM of a gaussian mixture, it is now calculated numerically.For each given subset of the gaussian mixture model, the maximum of the resulting PDF is calculated by dividing the interval [0.8, 1.2] into small steps. The step size depends on the largest variance of the individual gaussians, which ensures a high enough accuracy for the estimated maximum.
After that, all values where the half maximum is reached are calculated with the
find_zeros
function fromRoots.jl
. The FWHM then corresponds to the difference between the largest and the smallest position.