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

Raise error when peaks overlapping in merge_peaks #927

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

dachengx
Copy link
Collaborator

@dachengx dachengx commented Nov 17, 2024

This PR just adds a safeguard.

If we do need to handle the case where peaks overlap, we need to change two lines:

  1. new_p["length"] = (strax.endtime(last_peak) - new_p["time"]) // common_dt
    , we can not assume last_peak has the largest endtime
  2. buffer[i0 : i0 + n_after] = np.repeat(p["data"][: p["length"]], upsample) / upsample
    , should change = to +=

@dachengx dachengx marked this pull request as ready for review November 17, 2024 21:53
@coveralls
Copy link

Coverage Status

coverage: 89.323% (-0.8%) from 90.074%
when pulling 97e1de9 on merge_peaks_overlap
into dd62b13 on master.

@dachengx dachengx merged commit 739ad30 into master Nov 17, 2024
8 checks passed
@dachengx dachengx deleted the merge_peaks_overlap branch November 17, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants