-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update prep4phys #23
base: master
Are you sure you want to change the base?
Update prep4phys #23
Conversation
updates: - [github.com/psf/black: 24.4.2 → 24.8.0](psf/black@24.4.2...24.8.0) - [github.com/pycqa/flake8: 7.1.0 → 7.1.1](PyCQA/flake8@7.1.0...7.1.1)
Add contribution
Update contributors
Fix type errors in exporting history after manually adding peaks
[pre-commit.ci] pre-commit autoupdate
Make sure peak detection works with negative signals
locs, heights = signal.find_peaks(data[:], distance=cdist, height=thresh) | ||
|
||
# check if data is negative, if so make it all positive and continue with signal | ||
phys_signal = data.data - data.data.min() if data.data.min() < 0 else data.data |
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 was thinking that maybe we can just always work with data at min=0 for peak detection (it doesn't rescale the data for real). That should make percentages for thresh
easier to work with. Thoughts?
phys_signal = data.data - data.data.min() if data.data.min() < 0 else data.data | |
phys_signal = data.data - data.data.min() |
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.
See the suggestion on min()=0, for the rest all good, thanks!
Integrate latest peakdet changes in prep4phys
Proposed Changes
Change Type
bugfix
(+0.0.1)minor
(+0.1.0)major
(+1.0.0)refactoring
(no version update)test
(no version update)infrastructure
(no version update)documentation
(no version update)other
Checklist before review