Closed apoorva6262 closed 2 years ago
Hi @apoorva6262,
I think that the conversion did not work, the unit of your data is too large (standard deviation 17352) and therefore the spindles_detection function failed. As a result, YASA returns None for the spindles detection and calling None.summary leads to the above error.
Please make sure that the unit of your data is micro-Volts. The standard deviation of the data should be <1000 uV. You may want to rescale, filter and/or remove extreme values from your data. Please also make sure to visualize your data, I recommend the free software EDFBrowser.
Thanks, Raphael
Thanks @raphaelvallat . How do you rescale it ? I tried to just convert it first to mV (code below) and then to uV. The value is still large. I am doubting if the format of the file itself is in a different scale.
some_edf_channels = ['C3','C4']
chan_data = epochs.get_data(some_edf_channels)
print(np.sum(np.abs(chan_data))/chan_data.size)#mV
Here is the plot of the data (40uv) and then I zoomed out to 14000000uv.
Try
chan_data = epochs.get_data(some_edf_channels, units="uV")
That works! Thanks!
Hi @raphaelvallat , I am trying detect spindles in this rem dataset. The unit of the data is 0.4781623844622306V. I converted this to uV but then I am getting this error. Also, why am I getting an error for the summary?
sig *= 478162.384462230606 spindles= yasa.spindles_detect(sig, sf=Fs, ch_names=['C3','C4'],freq_sp=(11, 15), freq_broad=(2, 30), duration=(0.5, 2), min_distance=500, thresh={'rel_pow': 0.2, 'corr': 0.65, 'rms': 1.5}, multi_only=False, remove_outliers=False, verbose=False) spindles.summary(grp_chan=True, grp_stage=True)