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
I was able to initialize a fooof group object and fit the group of spectra using the .fit() method. However, when I try to plot a summary of the model using fg.plot(), only the aperiodic fit and error plots populate; the center frequencies portion of the plot remains empty and the console returns the following error:
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
File "", line 1, in
File "/Library/Python/3.9/site-packages/fooof/objs/group.py", line 403, in plot
plot_fg(self, save_fig, file_name, file_path)
File "/Library/Python/3.9/site-packages/fooof/core/modutils.py", line 180, in wrapped_func
func(*args, **kwargs)
File "/Library/Python/3.9/site-packages/fooof/plts/fg.py", line 57, in plot_fg
plot_fg_peak_cens(fg, ax2)
File "/Library/Python/3.9/site-packages/fooof/core/modutils.py", line 180, in wrapped_func
func(*args, **kwargs)
File "/Library/Python/3.9/site-packages/fooof/plts/fg.py", line 114, in plot_fg_peak_cens
plot_hist(fg.get_params('peak_params', 0)[:, 0], 'Center Frequency',
File "/Library/Python/3.9/site-packages/fooof/objs/group.py", line 378, in get_params
out = np.array([np.insert(getattr(data, name), 3, index, axis=1)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (25,) + inhomogeneous part.
This same error comes up when I try the following with the fooof group object:
fooof.objs.average_fg()
get_band_peak_fg()
fg.print_results()
Interestingly, the following DOES work:
print(fg.group_results[0:])
the below works when any of the 25 fits = ind
fm = fg.get_fooof(ind=4, regenerate=True)
fm.plot()
I have also checked the organization of the data:
print(freqs.shape)
print(spectra.shape)
Out:
(204,)
(25, 204)
I am sure I am doing something wrong, but I'm not sure what!
Thanks
The text was updated successfully, but these errors were encountered:
Hello,
I am working on fitting a group of power spectra using the tutorial here: https://fooof-tools.github.io/fooof/auto_tutorials/plot_06-FOOOFGroup.html
I was able to initialize a fooof group object and fit the group of spectra using the .fit() method. However, when I try to plot a summary of the model using fg.plot(), only the aperiodic fit and error plots populate; the center frequencies portion of the plot remains empty and the console returns the following error:
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
File "", line 1, in
File "/Library/Python/3.9/site-packages/fooof/objs/group.py", line 403, in plot
plot_fg(self, save_fig, file_name, file_path)
File "/Library/Python/3.9/site-packages/fooof/core/modutils.py", line 180, in wrapped_func
func(*args, **kwargs)
File "/Library/Python/3.9/site-packages/fooof/plts/fg.py", line 57, in plot_fg
plot_fg_peak_cens(fg, ax2)
File "/Library/Python/3.9/site-packages/fooof/core/modutils.py", line 180, in wrapped_func
func(*args, **kwargs)
File "/Library/Python/3.9/site-packages/fooof/plts/fg.py", line 114, in plot_fg_peak_cens
plot_hist(fg.get_params('peak_params', 0)[:, 0], 'Center Frequency',
File "/Library/Python/3.9/site-packages/fooof/objs/group.py", line 378, in get_params
out = np.array([np.insert(getattr(data, name), 3, index, axis=1)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (25,) + inhomogeneous part.
This same error comes up when I try the following with the fooof group object:
fooof.objs.average_fg()
get_band_peak_fg()
fg.print_results()
Interestingly, the following DOES work:
print(fg.group_results[0:])
fm = fg.get_fooof(ind=4, regenerate=True)
fm.plot()
I have also checked the organization of the data:
print(freqs.shape)
print(spectra.shape)
Out:
(204,)
(25, 204)
I am sure I am doing something wrong, but I'm not sure what!
Thanks
The text was updated successfully, but these errors were encountered: