Package: astroml / 0.3-9

Fix-index-error-on-wiener-filter.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Ole Streicher <olebole@debian.org>
Date: Sat, 30 Dec 2017 11:22:24 +0100
Subject: Fix index error on wiener filter

This is effectively an unapproved workaround; I am not sure whether
this works correctly. It should be cross-checked with the fix of the
relevant upstream issue

https://github.com/astroML/astroML/issues/101

However it closes #877161.
---
 astroML/filters.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/astroML/filters.py b/astroML/filters.py
index d95ebf9..2d48651 100644
--- a/astroML/filters.py
+++ b/astroML/filters.py
@@ -183,7 +183,7 @@ def wiener_filter(t, h, signal='gaussian', noise='flat', return_PSDs=False,
     # fit signal/noise params if necessary
     if signal_params is None:
         amp_guess = np.max(PSD[1:])
-        width_guess = np.min(np.abs(f[PSD[1:] < np.mean(PSD[1:])]))
+        width_guess = np.min(np.abs(f[PSD[:] < np.mean(PSD[:])]))
         signal_params = (amp_guess, width_guess)
     if noise_params is None:
         noise_params = (np.mean(PSD[1:]),)