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

FIX: Fix interpolation of dpss_windows #140

Merged
merged 1 commit into from Feb 23, 2016
Merged

Conversation

larsoner
Copy link
Contributor

Interpolation was done unsafely before using floating point comparisons, see:

>>> N_from, N_to = 1000, 245411
>>> d_temp = np.arange(0, N_from - 1, float(N_from - 1) / N_to)  # old way
>>> print(d_temp.shape)
(245412,)
>>> print(d_temp[:3])
[ 0.          0.00407072  0.00814144]
>>> print(d_temp[-3:])
[ 998.99185856  998.99592928  999.        ]
>>> d_temp = np.linspace(0, N_from - 1, N_to, endpoint=False)  # new way
>>> print(d_temp.shape)
(245411,)
>>> print(d_temp[:3])
[ 0.          0.00407072  0.00814144]
>>> print(d_temp[-2:])
[ 998.99185856  998.99592928]

@arokem
Copy link
Member

arokem commented Feb 23, 2016

Thanks!

arokem added a commit that referenced this pull request Feb 23, 2016
FIX: Fix interpolation of dpss_windows
@arokem arokem merged commit 267e64b into nipy:master Feb 23, 2016
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.

None yet

2 participants