Skip to content
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

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Update prep4phys #23

wants to merge 25 commits into from

Conversation

me-pic
Copy link
Collaborator

@me-pic me-pic commented Oct 30, 2024

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

  • I added everything I wanted to add to this PR.
  • [Code or tests only] I wrote/updated the necessary docstrings.
  • [Code or tests only] I ran and passed tests locally.
  • [Documentation only] I built the docs locally.
  • My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
  • My code respects the adopted style, especially linting conventions.
  • The title of this PR is explanatory on its own, enough to be understood as part of a changelog.
  • I added or indicated the right labels.
  • I added information regarding the timeline of completion for this PR.
  • Please, comment on my PR while it's a draft and give me feedback on the development!

@github-actions github-actions bot added Documentation This issue or PR is about the documentation Internal Changes affect the internal API. It doesn't increase the version, but produces a changelog labels Oct 30, 2024
peakdet/operations.py Outdated Show resolved Hide resolved
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
Copy link
Member

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?

Suggested change
phys_signal = data.data - data.data.min() if data.data.min() < 0 else data.data
phys_signal = data.data - data.data.min()

Copy link
Member

@smoia smoia left a 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!

@smoia smoia added the Minormod This PR generally closes an "Enhancement" issue. It increments the minor version (0.+1.0) label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation This issue or PR is about the documentation Internal Changes affect the internal API. It doesn't increase the version, but produces a changelog Minormod This PR generally closes an "Enhancement" issue. It increments the minor version (0.+1.0)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants