Skip to content

Commit

Permalink
Update glm_spectrum.py
Browse files Browse the repository at this point in the history
Fix #249  - implementing the proposed changes
  • Loading branch information
matsvanes authored Jan 9, 2024
1 parent 5e7fe04 commit 9a21eea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion osl/glm/glm_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ def plot_joint_spectrum_clusters(xvect, psd, clusters, info, ax=None, freqs='aut
freqs[clu[2][0]] = 1
finds = np.where(freqs)[0]
if len(finds) == 1:
finds = np.array([finds[0], finds[0]+1])
if finds[0]<len(fx[0])-1:
finds = np.array([finds[0], finds[0]+1])
else: # can't extend to next freq if last freq
finds = np.array([finds[0], finds[0]])

msg = 'Cluster {} - stat: {}, freq range: {}, num channels {}'
freq_range = (fx[0][finds[0]], fx[0][finds[-1]])
Expand Down

0 comments on commit 9a21eea

Please sign in to comment.