You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I calculate the spectrum by hand, I obtain the same result either using the eeg object or the raw_array.get_data(), but if I use the * 1e6 factor I get an obviously large number.
Thanks for opening the issue. Great point. I think that a quick and dirty fix is just to divide your Raw data by 1e6, e.g. raw._data /= 1e6 (I haven't tested this).
In the long term, you're right that we need a better solution. As a matter of fact, mne.Raw.get_data() now has an units parameter that will automatically do the conversion, if needed:
I am working with a
np.array
that I convert tomne.raw
to pass toSleepStaging()
.I was getting huge power values and I traced it back to this line:
yasa/yasa/staging.py
Line 200 in 71c0a82
In the comments for
SleepStaging()
, you haveThe data that I am entering is in microvolts, and the transformation to
raw
is not affecting thatThe
sls
object has the scaled data storedIf I calculate the spectrum by hand, I obtain the same result either using the
eeg
object or theraw_array.get_data()
, but if I use the* 1e6
factor I get an obviously large number.Should there be a way to indicate to
SleepStaging()
that it shouldn't rescale the data ? I am thinkingThis issue might or might not be there for the other bands because the default behavior is:
But if I understand the code correctly, it might be also calculating a scaled spectrum and then doing the relative scaling back.
The text was updated successfully, but these errors were encountered: