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
Add option to find peaks using ratio variance/ mean in FindSXPeaksConvolve #37171
Merged
SilkeSchomann
merged 10 commits into
main
from
variance_over_mean_ratio_in_FindSXPeaksConvovle
May 2, 2024
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6265ae7
Add variance over mean ratio to FindSXPEaksConvolve
RichardWaiteSTFC e26041d
Implement usign 1D convolutions (with uniform_filter) for performance
RichardWaiteSTFC eb641f7
Add argument doc strings and refactor to reduce size of main exec
RichardWaiteSTFC 917cf2c
Add unit test
RichardWaiteSTFC a842637
Use FindSXPeaksConvolve as default in sxd and update system test
RichardWaiteSTFC 0e6c186
Update documentation
RichardWaiteSTFC 396ca19
Add release notes
RichardWaiteSTFC dfd02fb
Fix typo in docs
RichardWaiteSTFC 9560824
Remove unnecessary reference file to avoid flaky tests
RichardWaiteSTFC f653bed
Update technique docs as per PR review
RichardWaiteSTFC File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
Testing/SystemTests/tests/framework/reference/SXD23767_found_peaks_convolve.nxs.md5
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
23bbde7e64f3d3fcb00984fd91e89e62 |
This file contains 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
2 changes: 2 additions & 0 deletions
2
docs/source/release/v6.10.0/Diffraction/Single_Crystal/New_features/37171.rst
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Add option to find peaks using the ratio of variance/ mean in :ref:`FindSXPeaksConvolve <algm-FindSXPeaksConvolve>` - this is a peak finding criterion used in DIALS software Winter, G., et al. Acta Crystallographica Section D: Structural Biology 74.2 (2018): 85-97. | ||
- :ref:`FindSXPeaksConvolve <algm-FindSXPeaksConvolve>` is the default peak finding algorithm in the SXD reduction class. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ Here is an example using the ``SXD`` class that finds peaks and then removes dup | |
|
||
# find peaks using SXD static method - determines peak threshold from | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this comment needs to be updated to represent Variance over mean |
||
# the standard deviation of the intensity distribution | ||
peaks_ws = SXD.find_sx_peaks(ws, nstd=6) | ||
peaks_ws = SXD.find_sx_peaks(ws, ThresholdVarianceOverMean=2.0) | ||
SXD.remove_duplicate_peaks_by_qlab(peaks_ws, q_tol=0.05) | ||
|
||
# find a UB | ||
|
This file contains 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
Oops, something went wrong.
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.
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.
From a user perspective, isn't it better to keep
ThresholdIoverSigma
andThresholdVarianceOverMean
variables closer and next to each other that becomes active/inactive based on the selection ofPeakFindingStratergy
after it?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.
I agree, but the convention is to put new arguments at the bottom so as to preserve the positional argument order in the python wrapper. Sometimes if there are loads of parameters that makes it more likely no one will be using positional arguments, but there are not so many arguments here so it's probably better to keep it as is. Is that OK?
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.
yeah understood, I guess users won't bother much since there is only a small number of params to fill.