From b7d00c8be06489c76622b8bbf7943e1d1a40b690 Mon Sep 17 00:00:00 2001 From: guangzhi Date: Thu, 21 Oct 2021 11:48:12 +0800 Subject: [PATCH] fix wrong confidence interval of mt_coherence() In `multitaper.py`, the `mt_coherence()` function assigned an empty array for the desired confidence interval using `mt.empty(nf, 2)` at line 600. This gave an 1d complex array of length nf, because the argument `2` is passed to the `complex=False` kwarg of the `mt.empty()` method. The correct call should be `mt.empty((nf, 2))` --- mtspec/multitaper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtspec/multitaper.py b/mtspec/multitaper.py index 8ebbcc9..5bbf34c 100644 --- a/mtspec/multitaper.py +++ b/mtspec/multitaper.py @@ -600,7 +600,7 @@ def mt_coherence(df, xi, xj, tbp, kspec, nf, p, **kwargs): 'cohe_ci', 'phase_ci', 'iadapt'): kwargs.setdefault(key, None) if key in ('cohe_ci', 'phase_ci') and kwargs[key]: - kwargs[key] = mt.empty(nf, 2) + kwargs[key] = mt.empty((nf, 2)) args.append(mt.p(kwargs[key])) elif key == 'iadapt' and kwargs[key]: args.append(C.byref(C.c_int(kwargs[key])))