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

Little clean of padding templates #165

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/MEArec/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1803,8 +1803,8 @@ def cubic_padding(template, pad_samples):
"""
import scipy.interpolate as interp

n_pre = pad_samples[0]
n_post = pad_samples[1]
assert len(pad_samples) == 2, "'pad_samples' should be a list/tuple/array of length 2!"
n_pre, n_post = pad_samples

padded_template = np.zeros((template.shape[0], int(n_pre) + template.shape[1] + n_post))
splines = np.zeros((template.shape[0], int(n_pre) + template.shape[1] + n_post))
Expand All @@ -1814,7 +1814,7 @@ def cubic_padding(template, pad_samples):
sp_copy = deepcopy(sp)
padded_sp = np.zeros(n_pre + len(sp) + n_post)
padded_t = np.arange(len(padded_sp))
initial_offset = np.mean(sp[0])
initial_offset = sp[0]
sp_copy -= initial_offset

x_pre = float(n_pre)
Expand Down
Loading