Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cristina' into cristina
Browse files Browse the repository at this point in the history
  • Loading branch information
smoia committed Jul 8, 2023
2 parents e834064 + 5317f99 commit ed6d805
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions peakdet/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,29 @@ def add_peaks(data, add):
return data


@utils.make_operation()
def add_peaks(data, add):
"""
Add `newpeak` to add them in `data`
Parameters
----------
data : Physio_like
add : int
Returns
-------
data : Physio_like
"""

data = utils.check_physio(data, ensure_fs=False, copy=True)
idx = np.searchsorted(data._metadata['peaks'], add)
data._metadata['peaks'] = np.insert(data._metadata['peaks'], idx, add)
data._metadata['troughs'] = utils.check_troughs(data, data.peaks)

return data


def edit_physio(data):
"""
Opens interactive plot with `data` to permit manual editing of time series
Expand Down

0 comments on commit ed6d805

Please sign in to comment.