Skip to content

Commit

Permalink
plotCSD: time slicing on pre-loaded data (credit: Nikita Novikov)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvbragin committed Oct 31, 2024
1 parent a1ef3e8 commit 0c71a1b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions netpyne/plotting/plotCSD.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,16 @@ def plotCSD(
getAllData=True,
**kwargs)
else:
pass # TODO: ensure time slicing works properly in case CSDData is passed as an argument
nsamples = CSDData.shape[1]
tt = np.arange(nsamples) * dt
if timeRange is not None:
mask = (tt >= timeRange[0]) & (tt < timeRange[1])
LFPData = LFPData[mask, :]
CSDData = CSDData[:, mask]

npcsd = CSDData
if pad > 0: npcsd = getPaddedCSD(CSDData, pad) # apply padding (replicate first,last rows)
if pad > 0:
npcsd = getPaddedCSD(CSDData, pad) # apply padding (replicate first,last rows)

if timeRange is None:
timeRange = [0, sim.cfg.duration]
Expand Down

0 comments on commit 0c71a1b

Please sign in to comment.