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

dss_line_iter error #59

Closed
cocomahe opened this issue Apr 27, 2022 · 4 comments
Closed

dss_line_iter error #59

cocomahe opened this issue Apr 27, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@cocomahe
Copy link

Hi, thanks for your handy package!
firstly i am new to eeg processing and programming, hence sorry if its a stupid question i just cant get solved.

i use the dss_line_iter function to get rid of line noise artefact but get thrown following error:

UnboundLocalError: local variable 'mean_psd' referenced before assignment
in the following: File "/home/analysis/anaconda3/lib/python3.9/site-packages/meegkit/dss.py", line 316, in dss_line_iter
mean_psd_wospot = mean_psd.copy()

the dss_line function without iter works fine.

Thanks for help!

@nbara
Copy link
Owner

nbara commented Apr 28, 2022

Hi @cocomahe, thanks for reporting. I will have a look this week.

@nbara
Copy link
Owner

nbara commented Apr 28, 2022

What is the shape of the data you input to dss_line_iter() ?

def dss_line_iter(data, fline, sfreq, win_sz=10, spot_sz=2.5,
                  nfft=512, show=False, prefix="dss_iter", n_iter_max=100):
    """Remove power line artifact iteratively.

    Parameters
    ----------
    data : data, shape=(n_samples, n_chans, n_trials)
        Input data.

It is probably not the expected shape or number of dimensions.

@nbara nbara self-assigned this Apr 28, 2022
@nbara nbara added the bug Something isn't working label Apr 28, 2022
@cocomahe
Copy link
Author

Hi, thanks for quick response!
In deed it works with an adjusted shape. I was confused as the single channel data works with dss_line() but not with dss_line_iter(). However all channel data work fine with both, which makes so much sense^^ Thanks!

@nbara
Copy link
Owner

nbara commented May 3, 2022

No worries, I'll try to throw a more helpful error message to avoid the confusion in the future

@nbara nbara closed this as completed May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants