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

a possible bug in parameter 'freq' #626

Open
thelightonmyway opened this issue Nov 13, 2024 · 0 comments
Open

a possible bug in parameter 'freq' #626

thelightonmyway opened this issue Nov 13, 2024 · 0 comments
Assignees

Comments

@thelightonmyway
Copy link

thelightonmyway commented Nov 13, 2024

Hi,

I use wavelet_coherence recently, and I encounter an error when I run:
freq=freq_vector_scale(time,dj=1/12,s0=2,j1=84,mother='MORLET',param=6)
coh=pv_series.wavelet_coherence(SWS_series, freq=freq)

and it shows:
ValueError: negative dimensions are not allowed

Something similar will happen here when I run:
coh=pv_series.wavelet_coherence(SWS_series, method='wwz',freq='scale')

I suppose it may be a bug that freq set as in reverse order, and it could be seen also in #626.

For reference, my parameter freq is set as:
time=np.arange(708) freq=freq_vector_scale(time,dj=1/12,s0=2,j1=84,mother='MORLET',param=6)

and it is:
array([0.48400665, 0.45684145, 0.43120091, 0.40699946, 0.38415634, 0.3625953 , 0.34224439, 0.32303569, 0.30490509, 0.28779208, 0.27163955, 0.25639359, 0.24200333, 0.22842072, 0.21560045, 0.20349973, 0.19207817, 0.18129765, 0.17112219, 0.16151784, 0.15245254, 0.14389604, 0.13581978, 0.1281968 , 0.12100166, 0.11421036, 0.10780023, 0.10174987, 0.09603908, 0.09064882, 0.0855611 , 0.08075892, 0.07622627, 0.07194802, 0.06790989, 0.0640984 , 0.06050083, 0.05710518, 0.05390011, 0.05087493, 0.04801954, 0.04532441, 0.04278055, 0.04037946, 0.03811314, 0.03597401, 0.03395494, 0.0320492 , 0.03025042, 0.02855259, 0.02695006, 0.02543747, 0.02400977, 0.02266221, 0.02139027, 0.02018973, 0.01905657, 0.017987 , 0.01697747, 0.0160246 , 0.01512521, 0.0142763 , 0.01347503, 0.01271873, 0.01200489, 0.0113311 , 0.01069514, 0.01009487, 0.00952828, 0.0089935 , 0.00848874, 0.0080123 , 0.0075626 , 0.00713815, 0.00673751, 0.00635937, 0.00600244, 0.00566555, 0.00534757, 0.00504743, 0.00476414, 0.00449675, 0.00424437, 0.00400615, 0.0037813 ])

The code won't work until the freq is rearrange in order:
coh=pv_series.wavelet_coherence(SWS_series,freq=freq[::-1])

Looking forward to your reply!

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

No branches or pull requests

2 participants