Download data and plot drift over the sessionΒΆ

Downloads LFP power spectrum for a given session and probe and plots a heatmap of power spectrum on the channels along probe against frequency

# import modules
from import ONE
from brainbox.metrics import electrode_drift
import matplotlib.pyplot as plt

# instantiate one
one = ONE()

# Specify subject, date and probe we are interested in
subject = 'CSHL049'
date = '2020-01-08'
sess_no = 1
probe_label = 'probe00'
eid =, date=date, number=sess_no)[0]

# define datasets to download
dtypes = ['spikes.times',

# Download the data and get paths to downloaded data
_ = one.load(eid, dataset_types=dtypes, download_only=True)
alf_path = one.path_from_eid(eid).joinpath('alf', probe_label)

# Load in spikes object and use brainbox function to compute drift over session
spikes =, 'spikes')
drift = electrode_drift.estimate_drift(spikes['times'], spikes['amps'], spikes['depths'],
Connected to as mayo