Skip to content

Commit

Permalink
Merge pull request #193 from BlueBrain/fix-impedance-plot
Browse files Browse the repository at this point in the history
fix freq indexing in impedance plotting
  • Loading branch information
AurelienJaquier authored Aug 7, 2024
2 parents ad1861d + 3c9c1e1 commit 7cd403b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bluepyefe/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def plot_impedance(cell, output_dir, efel_settings):
fft_volt = numpy.fft.fft(normalized_voltage)
fft_cur = numpy.fft.fft(normalized_current)
if any(fft_cur) == 0:
return None
continue
# convert dt from ms to s to have freq in Hz
freq = numpy.fft.fftfreq(len(normalized_voltage), d=dt / 1000.)
Z = fft_volt / fft_cur
Expand All @@ -400,7 +400,7 @@ def plot_impedance(cell, output_dir, efel_settings):

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.plot(freq[:len(smooth_Z)], smooth_Z)
ax.plot(freq[select_idxs], smooth_Z)
ax.set_xlabel("Frequency (Hz)")
ax.set_ylabel("normalized Z")
fig .suptitle(f"Impedance for {rec.name}\nfor cell {cell.name}")
Expand Down

0 comments on commit 7cd403b

Please sign in to comment.