833 lines
415 KiB
Plaintext
833 lines
415 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%load_ext autoreload\n",
|
||
|
"%autoreload 2"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stderr",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:26: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0\n",
|
||
|
"Please use `tqdm.notebook.*` instead of `tqdm._tqdm_notebook.*`\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"%matplotlib inline\n",
|
||
|
"import spatial_maps as sp\n",
|
||
|
"import septum_mec.analysis.data_processing as dp\n",
|
||
|
"import septum_mec.analysis.registration\n",
|
||
|
"import expipe\n",
|
||
|
"import os\n",
|
||
|
"import pathlib\n",
|
||
|
"import scipy\n",
|
||
|
"import scipy.signal as ss\n",
|
||
|
"import numpy as np\n",
|
||
|
"import exdir\n",
|
||
|
"import pandas as pd\n",
|
||
|
"import optogenetics as og\n",
|
||
|
"import quantities as pq\n",
|
||
|
"import shutil\n",
|
||
|
"from distutils.dir_util import copy_tree\n",
|
||
|
"import elephant as el\n",
|
||
|
"import neo\n",
|
||
|
"from scipy.signal import find_peaks\n",
|
||
|
"from scipy.interpolate import interp1d\n",
|
||
|
"from matplotlib import mlab\n",
|
||
|
"from spike_statistics.core import theta_mod_idx, correlogram\n",
|
||
|
"\n",
|
||
|
"from tqdm import tqdm_notebook as tqdm\n",
|
||
|
"from tqdm._tqdm_notebook import tqdm_notebook\n",
|
||
|
"tqdm_notebook.pandas()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# data_loader = dp.Data()\n",
|
||
|
"# actions = data_loader.actions\n",
|
||
|
"# project = data_loader.project\n",
|
||
|
"\n",
|
||
|
"max_speed = .5 # m/s only used for speed score\n",
|
||
|
"min_speed = 0.02 # m/s only used for speed score\n",
|
||
|
"position_sampling_rate = 100 # for interpolation\n",
|
||
|
"position_low_pass_frequency = 6 # for low pass filtering of position\n",
|
||
|
"\n",
|
||
|
"box_size = [1.0, 1.0]\n",
|
||
|
"bin_size = 0.02\n",
|
||
|
"smoothing_low = 0.03\n",
|
||
|
"smoothing_high = 0.06\n",
|
||
|
"\n",
|
||
|
"speed_binsize = 0.02\n",
|
||
|
"\n",
|
||
|
"stim_mask = True\n",
|
||
|
"# baseline_duration = 600\n",
|
||
|
"baseline_duration = None\n",
|
||
|
"\n",
|
||
|
"data_loader = dp.Data(\n",
|
||
|
" position_sampling_rate=position_sampling_rate, \n",
|
||
|
" position_low_pass_frequency=position_low_pass_frequency,\n",
|
||
|
" box_size=box_size, bin_size=bin_size, \n",
|
||
|
" stim_mask=stim_mask, baseline_duration=baseline_duration\n",
|
||
|
")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"actions = data_loader.actions\n",
|
||
|
"project = data_loader.project"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"output = pathlib.Path('output/theta-rhythmicity')\n",
|
||
|
"(output / 'data').mkdir(parents=True, exist_ok=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"identify_neurons = actions['identify-neurons']\n",
|
||
|
"# sessions = pd.read_csv(identify_neurons.data_path('sessions'))\n",
|
||
|
"units = pd.read_csv(identify_neurons.data_path('units'))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def get_lim(action_id):\n",
|
||
|
" stim_times = data_loader.stim_times(action_id)\n",
|
||
|
" if stim_times is None:\n",
|
||
|
" return [0, np.inf]\n",
|
||
|
" stim_times = np.array(stim_times)\n",
|
||
|
" return [stim_times.min(), stim_times.max()]\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def compute_stim_freq(action_id):\n",
|
||
|
" stim_times = data_loader.stim_times(action_id)\n",
|
||
|
" if stim_times is None:\n",
|
||
|
" return np.nan\n",
|
||
|
" stim_times = np.array(stim_times)\n",
|
||
|
" return 1 / np.mean(np.diff(stim_times))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 8,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def plot_acorr(sptr, binsize=0.01, time_limit=1):\n",
|
||
|
" count, bins = correlogram(\n",
|
||
|
" t1=sptr, t2=None, binsize=binsize, limit=time_limit, auto=True)\n",
|
||
|
" plt.bar(bins, count, width=binsize)\n",
|
||
|
" plt.axvspan(.05, .07, color='r', alpha=.5)\n",
|
||
|
" plt.axvspan(.1, .14, color='k', alpha=.5)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def zscore(a):\n",
|
||
|
" return (a - a.mean(0)) / a.std(0)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def signaltonoise(a, axis=0, ddof=0):\n",
|
||
|
" a = np.asanyarray(a)\n",
|
||
|
" m = a.mean(axis)\n",
|
||
|
" sd = a.std(axis=axis, ddof=ddof)\n",
|
||
|
" return np.where(sd == 0, 0, m / sd)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def compute_energy(p, f, f1, f2):\n",
|
||
|
" if np.isnan(f1) or np.all(np.isnan(p)):\n",
|
||
|
" return np.nan\n",
|
||
|
" mask = (f > f1) & (f < f2)\n",
|
||
|
" df = f[1] - f[0]\n",
|
||
|
" return np.sum(p[mask]) * df\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def compute_band_power(p, f, f1, f2):\n",
|
||
|
" if np.isnan(f1) or np.all(np.isnan(p)):\n",
|
||
|
" return [np.nan] * 2\n",
|
||
|
" from scipy.integrate import simps\n",
|
||
|
" dx = f[1] - f[0]\n",
|
||
|
" mask = (f > f1) & (f < f2)\n",
|
||
|
" # Compute the absolute power by approximating the area under the curve\n",
|
||
|
" band_power = simps(p[mask], dx=dx)\n",
|
||
|
" total_power = simps(p, dx=dx)\n",
|
||
|
" rel_power = band_power / total_power\n",
|
||
|
" return band_power, rel_power\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def find_theta_peak(p, f, f1, f2):\n",
|
||
|
" if np.all(np.isnan(p)):\n",
|
||
|
" return np.nan, np.nan\n",
|
||
|
" mask = (f > f1) & (f < f2)\n",
|
||
|
" p_m = p[mask]\n",
|
||
|
" f_m = f[mask]\n",
|
||
|
" peaks, _ = find_peaks(p_m)\n",
|
||
|
" if len(peaks) == 0:\n",
|
||
|
" return np.nan, np.nan\n",
|
||
|
" idx = np.argmax(p_m[peaks])\n",
|
||
|
" return f_m[peaks[idx]], p_m[peaks[idx]]"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def compute_half_width(power, freq, max_power, max_frequency, band, band_width=1):\n",
|
||
|
" if np.isnan(max_power):\n",
|
||
|
" return [np.nan] * 3\n",
|
||
|
" \n",
|
||
|
" # estimate baseline power\n",
|
||
|
" low_baseline_mask = (freq > band[0] - band_width) & (freq < band[0])\n",
|
||
|
" high_baseline_mask = (freq > band[1]) & (freq < band[1] + band_width)\n",
|
||
|
" baseline = np.mean(np.concatenate([power[low_baseline_mask], power[high_baseline_mask]]))\n",
|
||
|
" p = power - baseline\n",
|
||
|
" m_p = max_power - baseline\n",
|
||
|
" m_f = max_frequency\n",
|
||
|
" f = freq\n",
|
||
|
" \n",
|
||
|
" # estimate half width\n",
|
||
|
" m_p_half = m_p / 2\n",
|
||
|
" half_p = p - m_p_half\n",
|
||
|
" idx_f = np.where(f <= m_f)[0].max()\n",
|
||
|
" idxs_p1, = np.where(np.diff(half_p[:idx_f + 1] > 0) == 1)\n",
|
||
|
" if len(idxs_p1) == 0:\n",
|
||
|
" return [np.nan] * 3\n",
|
||
|
" m1 = idxs_p1.max()\n",
|
||
|
" idxs_p2, = np.where(np.diff(half_p[idx_f:] > 0) == 1)\n",
|
||
|
" if len(idxs_p2) == 0:\n",
|
||
|
" return [np.nan] * 3\n",
|
||
|
" m2 = idxs_p2.min() + idx_f\n",
|
||
|
"# assert p[m1] < m_p_half < p[m1+1], (p[m1], m_p_half, p[m1+1])\n",
|
||
|
"# assert p[m2] > m_p_half > p[m2+1], (p[m2], m_p_half, p[m2+1])\n",
|
||
|
" \n",
|
||
|
" f1 = interp1d([half_p[m1], half_p[m1 + 1]], [f[m1], f[m1 + 1]])(0)\n",
|
||
|
" f2 = interp1d([half_p[m2], half_p[m2 + 1]], [f[m2], f[m2 + 1]])(0)\n",
|
||
|
" return f1, f2, m_p_half + baseline"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def compute_relative_peak(power, freq, max_power, band, band_width=1):\n",
|
||
|
" # estimate baseline power\n",
|
||
|
" low_baseline_mask = (freq > band[0] - band_width) & (freq < band[0])\n",
|
||
|
" high_baseline_mask = (freq > band[1]) & (freq < band[1] + band_width)\n",
|
||
|
" baseline = np.mean(np.concatenate([power[low_baseline_mask], power[high_baseline_mask]]))\n",
|
||
|
" return (max_power - baseline) / abs(baseline)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def compute_stim_peak(p, f, s_f):\n",
|
||
|
" if np.isnan(s_f):\n",
|
||
|
" return np.nan\n",
|
||
|
" return interp1d(f, p)(s_f)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"sampling_period = 10 * pq.ms\n",
|
||
|
"kernel_width = 10 * pq.ms\n",
|
||
|
"\n",
|
||
|
"kernel = el.kernels.GaussianKernel(kernel_width)\n",
|
||
|
"\n",
|
||
|
"# Define window length (6 seconds)\n",
|
||
|
"sampling_frequency = 1 / sampling_period.rescale('s').magnitude\n",
|
||
|
"\n",
|
||
|
"window = int(6 * sampling_frequency)\n",
|
||
|
"\n",
|
||
|
"theta_band_f1, theta_band_f2 = 6, 10 "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"psd_data, freq_data = {}, {}\n",
|
||
|
"\n",
|
||
|
"def process(row):\n",
|
||
|
" action_id = row['action']\n",
|
||
|
" channel_group = row['channel_group']\n",
|
||
|
" unit_name = row['unit_name']\n",
|
||
|
" \n",
|
||
|
" name = f'{action_id}_{channel_group}_{unit_name}'\n",
|
||
|
" \n",
|
||
|
" sptr = data_loader.spike_train(action_id, channel_group, unit_name)\n",
|
||
|
" \n",
|
||
|
" rate = el.statistics.instantaneous_rate(sptr, sampling_period, kernel=kernel)\n",
|
||
|
" \n",
|
||
|
" freq, p_xx = ss.welch(rate.ravel(), fs=sampling_frequency, nperseg=window, nfft=scipy.fftpack.next_fast_len(window))\n",
|
||
|
"# p_xx = 10 * np.log10(p_xx)\n",
|
||
|
" \n",
|
||
|
" theta_f, theta_p_max = find_theta_peak(p_xx, freq, theta_band_f1, theta_band_f2)\n",
|
||
|
" \n",
|
||
|
" theta_bandpower, theta_relpower = compute_band_power(p_xx, freq, theta_band_f1, theta_band_f2)\n",
|
||
|
" \n",
|
||
|
" theta_relpeak = compute_relative_peak(p_xx, freq, theta_p_max, [theta_band_f1, theta_band_f2])\n",
|
||
|
" \n",
|
||
|
" theta_half_f1, theta_half_f2, theta_half_power = compute_half_width(p_xx, freq, theta_p_max, theta_f, [theta_band_f1, theta_band_f2])\n",
|
||
|
" \n",
|
||
|
" theta_half_width = theta_half_f2 - theta_half_f1\n",
|
||
|
" \n",
|
||
|
" psd_data.update({name: p_xx})\n",
|
||
|
" freq_data.update({name: freq})\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
" # stim\n",
|
||
|
" \n",
|
||
|
" stim_freq = compute_stim_freq(action_id)\n",
|
||
|
" \n",
|
||
|
" stim_p_max = compute_stim_peak(p_xx, freq, stim_freq)\n",
|
||
|
" \n",
|
||
|
" stim_half_f1, stim_half_f2, stim_half_power = compute_half_width(p_xx, freq, stim_p_max, stim_freq, [stim_freq - 1, stim_freq + 1])\n",
|
||
|
" \n",
|
||
|
" stim_half_width = stim_half_f2 - stim_half_f1\n",
|
||
|
" \n",
|
||
|
" stim_bandpower, stim_relpower = compute_band_power(p_xx, freq, stim_freq - 1, stim_freq + 1)\n",
|
||
|
" \n",
|
||
|
" stim_relpeak = compute_relative_peak(p_xx, freq, stim_p_max, [stim_freq - 1, stim_freq + 1])\n",
|
||
|
" \n",
|
||
|
" if len(sptr) == 0:\n",
|
||
|
" theta_score = np.nan\n",
|
||
|
" else:\n",
|
||
|
" theta_score = theta_mod_idx(np.array(sptr))\n",
|
||
|
" \n",
|
||
|
" result = pd.Series({\n",
|
||
|
" 'theta_score': theta_score,\n",
|
||
|
" 'signal_to_noise': signaltonoise(rate.ravel()),\n",
|
||
|
" 'theta_freq': theta_f,\n",
|
||
|
" 'theta_peak': theta_p_max,\n",
|
||
|
" 'theta_bandpower': theta_bandpower,\n",
|
||
|
" 'theta_relpower': theta_relpower,\n",
|
||
|
" 'theta_relpeak': theta_relpeak,\n",
|
||
|
" 'theta_half_f1': theta_half_f1, \n",
|
||
|
" 'theta_half_f2': theta_half_f2,\n",
|
||
|
" 'theta_half_width': theta_half_width,\n",
|
||
|
" 'stim_freq': stim_freq,\n",
|
||
|
" 'stim_p_max': stim_p_max,\n",
|
||
|
" 'stim_half_f1': stim_half_f1, \n",
|
||
|
" 'stim_half_f2': stim_half_f2,\n",
|
||
|
" 'stim_half_width': stim_half_width,\n",
|
||
|
" 'stim_bandpower': stim_bandpower,\n",
|
||
|
" 'stim_relpower': stim_relpower,\n",
|
||
|
" 'stim_relpeak': stim_relpeak,\n",
|
||
|
" })\n",
|
||
|
" \n",
|
||
|
" return result"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/vnd.jupyter.widget-view+json": {
|
||
|
"model_id": "ce07856dd5d247edb76e1a5855e405a0",
|
||
|
"version_major": 2,
|
||
|
"version_minor": 0
|
||
|
},
|
||
|
"text/plain": [
|
||
|
"HBox(children=(IntProgress(value=0, max=1284), HTML(value='')))"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stderr",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/elephant/statistics.py:835: UserWarning: Instantaneous firing rate approximation contains negative values, possibly caused due to machine precision errors.\n",
|
||
|
" warnings.warn(\"Instantaneous firing rate approximation contains \"\n",
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3373: RuntimeWarning: Mean of empty slice.\n",
|
||
|
" out=out, **kwargs)\n",
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars\n",
|
||
|
" ret = ret.dtype.type(ret / rcount)\n",
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:29: RuntimeWarning: invalid value encountered in double_scalars\n",
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:6: RuntimeWarning: invalid value encountered in double_scalars\n",
|
||
|
" \n",
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:9: RuntimeWarning: invalid value encountered in true_divide\n",
|
||
|
" if __name__ == '__main__':\n",
|
||
|
"/home/mikkel/apps/expipe-project/spike-statistics/spike_statistics/core.py:27: RuntimeWarning: invalid value encountered in double_scalars\n",
|
||
|
" return (pk - th)/(pk + th)\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"results = units.merge(\n",
|
||
|
" units.progress_apply(process, axis=1), \n",
|
||
|
" left_index=True, right_index=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"pd.DataFrame(psd_data).to_feather(output / 'data' / 'spike_psd.feather')\n",
|
||
|
"pd.DataFrame(freq_data).to_feather(output / 'data' / 'freqs.feather')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Save to expipe"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"action = project.require_action(\"theta-rhythmicity\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"action.data['results'] = 'results.csv'\n",
|
||
|
"results.to_csv(action.data_path('results'), index=False)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"copy_tree(output, str(action.data_path()))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"septum_mec.analysis.registration.store_notebook(action, \"10-calculate-theta-rhythmicity.ipynb\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Explore"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 15,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib inline\n",
|
||
|
"plt.rc('axes', titlesize=12)\n",
|
||
|
"plt.rcParams.update({\n",
|
||
|
" 'font.size': 12, \n",
|
||
|
" 'figure.figsize': (6, 4), \n",
|
||
|
" 'figure.dpi': 150\n",
|
||
|
"})\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 16,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# action_id_0, channel_0, unit_0 = '1833-200619-1', 6, 163\n",
|
||
|
"# action_id_1, channel_1, unit_1 = '1833-200619-2', 6, 28\n",
|
||
|
"# action_id_0, channel_0, unit_0 = '1834-220319-3', 2, 46\n",
|
||
|
"action_id_1, channel_1, unit_1 = '1834-220319-4', 2, 60\n",
|
||
|
"\n",
|
||
|
"action_id_0, channel_0, unit_0 = '1834-150319-3', 3, 61"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 17,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"lim_0 = get_lim(action_id_0)\n",
|
||
|
"lim_1 = get_lim(action_id_1)\n",
|
||
|
"\n",
|
||
|
"sptrs_0 = data_loader.spike_trains(action_id_0, channel_0)\n",
|
||
|
"\n",
|
||
|
"sptrs_1 = data_loader.spike_trains(action_id_1, channel_1)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 18,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"kernel = el.kernels.GaussianKernel(10*pq.ms)\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 19,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stderr",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/elephant/statistics.py:835: UserWarning: Instantaneous firing rate approximation contains negative values, possibly caused due to machine precision errors.\n",
|
||
|
" warnings.warn(\"Instantaneous firing rate approximation contains \"\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"rate_0 = el.statistics.instantaneous_rate(sptrs_0[unit_0], 10*pq.ms, kernel=kernel)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 20,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"[<matplotlib.lines.Line2D at 0x7efc19113e48>]"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 20,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAyYAAAIICAYAAACb5vrAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOzdeZwcZYH/8e9wybEqKj9BREBRH3FXXVfAH7ouuLrqrqvAz2MRENFFBV1FWQQUlCg3qCASCFeAJBwBCQTIRULu+5xkziczSWYymUky933P9O+P7klmJj19VvdT1f15v155VWa6qvrpnu6q+tZzFYRCIQEAAACAS4e5LgAAAAAAEEwAAAAAOEcwAQAAAOAcwQQAAACAcwQTAAAAAM4RTAAAAAA4RzABAAAA4BzBBAAAAIBzBBMAAAAAzhFMAAAAADhHMAEAAADgHMEEAAAAgHNHuC6AXxlj9kk6VlKN67IAAAAAHnqfpG5r7UmuCzIawWRixx511FFvPfXUUz/quiAAAACAV3bv3q3+/n7XxTgEwWRiNaeeeupH58yZ47ocAAAAgGe++tWvqrKy0netguhjAgAAAMA5ggkAAAAA5wgmAAAAAJwjmAAAAABwjmACAAAAwDmCCQAAAADnCCYAAAAAnCOYAAAAAHCOYAIAAADAOYIJAAAAAOcIJgAAAACcI5gAAAAAcI5gAgAAAMA5ggkAAAAA5wgmAAAAAJwjmAAAAABwjmACAAAAwDmCCQAAAPJaa3e/Hl66Q2t3NrkuSl47wnUBAAAAAJeue3GbFpXtV0GBtPrGf9V73n6M6yLlJWpMAAAAkNcWle2XJIVC0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": [
|
||
|
"<Figure size 900x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.plot(rate_0)\n",
|
||
|
"# plt.xlim(0,10000)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 22,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"[<matplotlib.lines.Line2D at 0x7efc14154d68>]"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 22,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAB6gAAARdCAYAAADsYByOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOzdd5gkVfX/8c8sm8k5w4LAIS9IEEQUBRRFoihJZVFB4SsiKBhQggEJklSCgEhGkpJEEBAQlChBWODAAiuSc9rApvn9ce6drumpjjPbw/58v55nn9mZruqq7r4V+p57zu3q7u4WAAAAAAAAAAAAAACz25DB3gEAAAAAAAAAAAAAwP8GAtQAAAAAAAAAAAAAgI4gQA0AAAAAAAAAAAAA6AgC1AAAAAAAAAAAAACAjiBADQAAAAAAAAAAAADoCALUAAAAAAAAAAAAAICOIEANAAAAAAAAAAAAAOgIAtQAAAAAAAAAAAAAgI4gQA0AAAAAAAAAAAAA6AgC1AAAAAAAAAAAAACAjiBADQAAAAAAAAAAAADoCALUAAAAAAAAAAAAAICOIEANAAAAAAAAAAAAAOgIAtQAAAAAAAAAAAAAgI4YOtg7AADAnMbMR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8XUXQyl613Vg6IpPWeVSXIsaoKGUMp82dLRRbnrjk4ndZ7V/G53C5pmKKTrCGLLO3j0q97V5Wx/KyihPgkSZ/Lwem0vZcVmZATJM2vCIwX5c7X8S10hh6YnutFSVvnYF3a3g2KARdSBO1GFtbbX9JwRQbrgZ5KPhfaynWK72nV+/hZRUWBNxVB07fSejPd/TB
|
||
|
"text/plain": [
|
||
|
"<Figure size 2400x1350 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=(16,9))\n",
|
||
|
"from scipy import signal\n",
|
||
|
"\n",
|
||
|
"# Define window length (6 seconds)\n",
|
||
|
"sf = 100\n",
|
||
|
"win = 6 * sf\n",
|
||
|
"freq, p_xx = ss.welch(rate_0.ravel(), sf, nperseg=win, nfft=scipy.fftpack.next_fast_len(win))\n",
|
||
|
"p_xx = 10*np.log10(p_xx)\n",
|
||
|
"\n",
|
||
|
"theta_f, theta_p_max = find_theta_peak(p_xx, freq, theta_band_f1, theta_band_f2)\n",
|
||
|
" \n",
|
||
|
"theta_bandpower, theta_relpower = compute_band_power(p_xx, freq, theta_band_f1, theta_band_f2)\n",
|
||
|
"\n",
|
||
|
"theta_relpeak = compute_relative_peak(p_xx, freq, theta_p_max, [theta_band_f1, theta_band_f2])\n",
|
||
|
"\n",
|
||
|
"theta_half_f1, theta_half_f2, theta_half_power = compute_half_width(p_xx, freq, theta_p_max, theta_f, [theta_band_f1, theta_band_f2])\n",
|
||
|
"\n",
|
||
|
"theta_half_width = theta_half_f2 - theta_half_f1\n",
|
||
|
"\n",
|
||
|
"plt.plot(freq, p_xx)\n",
|
||
|
"\n",
|
||
|
"plt.xlim(0,50)\n",
|
||
|
"plt.title(f'theta bandpower = {theta_bandpower}, {theta_relpower}, relpeak = {theta_relpeak}')\n",
|
||
|
"\n",
|
||
|
"plt.scatter(theta_f, theta_p_max)\n",
|
||
|
"\n",
|
||
|
"plt.plot([theta_half_f1, theta_half_f2], [theta_half_power]*2, marker='.')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 77,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"33.439801780086405 -201.5410642685435\n",
|
||
|
"-6.8019949006129155 -201.5410642685435\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.collections.PathCollection at 0x7f574ccf4c18>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 77,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAB6gAAASSCAYAAAAM3rDvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOydd7gdVfW/3yRAQighUhNaaFlBCKELCBLpKNIRhCChCkoXAb9qKAqCdKlK6AICgnSQ3nuHAItmQq9i6C3k98dn75y5c2fOOfcmgD9Y7/PkmXvOzJrZs/eePSf7s9daPSZOnEgQBEEQBEEQBEEQBEEQBEEQBEEQBEEQfNH0/KoLEARBEARBEARBEARBEARBEARBEARBEHwzCIE6CIIgCIIgCIIgCIIgCIIgCIIgCIIg+FIIgToIgiAIgiAIgiAIgiAIgiAIgiAIgiD4UgiBOgiCIAiCIAiCIAiCIAiCIAiCIAiCIPhSCIE6CIIgCIIgCIIgCIIgCIIgCIIgCIIg+FIIgToIgiAIgiAIgiAIgiAIgiAIgiAIgiD4UgiBOgiCIAiCIAiCIAiCIAiCIA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WJA7ncw6kMa5u6+735X3u/gywffq4TklUXQct/gHYsCiUu/uzaAyZAGxvZksUrtePxgKVHdz98YLdNYV9o5IInhlJN9o80Z22Wx4J36Axd1K6GXc/GS0ogc7PwRRt8yAIgiAIgkCEQB0EQRAEQRAEQdA1/o28sE7IIl+JR9K2LIo+grzFJgm7bdq1RfJcPB0JNbVexaa8q5ciMeT
|
||
|
"text/plain": [
|
||
|
"<Figure size 2400x1350 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=(16,9))\n",
|
||
|
"from scipy import signal\n",
|
||
|
"rate_1 = el.statistics.instantaneous_rate(sptrs_1[unit_1], 10*pq.ms, kernel=kernel)\n",
|
||
|
"\n",
|
||
|
"# Define window length (6 seconds)\n",
|
||
|
"sf = 100\n",
|
||
|
"win = 6 * sf\n",
|
||
|
"freq, p_xx = ss.welch(rate_1.ravel(), sf, nperseg=win, nfft=scipy.fftpack.next_fast_len(win))\n",
|
||
|
"# freq, p_xx = ss.welch(zscore(rate_1.ravel()), sf, nperseg=win, nfft=scipy.fftpack.next_fast_len(win))\n",
|
||
|
"p_xx = 10*np.log10(p_xx)\n",
|
||
|
"\n",
|
||
|
"# p_xx, freq = mlab.psd(zscore(np.array(rate_1).ravel()), Fs=100, NFFT=scipy.fftpack.next_fast_len(1000))\n",
|
||
|
"\n",
|
||
|
"plt.plot(freq, p_xx)\n",
|
||
|
"plt.xlim(0,50)\n",
|
||
|
"band_power, rel_power = compute_band_power(p_xx, freq, 6, 10)\n",
|
||
|
"\n",
|
||
|
"f, p = find_theta_peak(p_xx, freq, 6, 10)\n",
|
||
|
"\n",
|
||
|
"plt.scatter(f,p)\n",
|
||
|
"f1, f2, p_half = compute_half_width(p_xx, freq, p, f, [6,10])\n",
|
||
|
"\n",
|
||
|
"theta_relpeak = compute_relative_peak(p_xx, freq, p, [6,10])\n",
|
||
|
"\n",
|
||
|
"plt.plot([f1, f2], [p_half]*2, marker='.')\n",
|
||
|
"\n",
|
||
|
"stim_freq = compute_stim_freq(action_id_1)\n",
|
||
|
"\n",
|
||
|
"stim_p_max = compute_stim_peak(p_xx, freq, stim_freq)\n",
|
||
|
"\n",
|
||
|
"stim_half_f1, stim_half_f2, stim_half_power = compute_half_width(p_xx, freq, stim_p_max, stim_freq, [stim_freq - 1, stim_freq + 1])\n",
|
||
|
"\n",
|
||
|
"stim_half_width = stim_half_f2 - stim_half_f1\n",
|
||
|
"\n",
|
||
|
"stim_bandpower, stim_relpower = compute_band_power(p_xx, freq, stim_freq - 1, stim_freq + 1)\n",
|
||
|
"\n",
|
||
|
"stim_relpeak = compute_relative_peak(p_xx, freq, stim_p_max, [stim_freq - 1, stim_freq + 1])\n",
|
||
|
"\n",
|
||
|
"plt.title(f'theta bandpower = {band_power}, {rel_power}\\n stim bandpower = {stim_bandpower}, {stim_relpower}\\n theta_relpeak = {theta_relpeak}, stim_relpeak = {stim_relpeak}')\n",
|
||
|
"\n",
|
||
|
"plt.plot([stim_half_f1, stim_half_f2], [stim_half_power]*2, marker='.')\n",
|
||
|
"\n",
|
||
|
"plt.scatter(stim_freq, stim_p_max)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 45,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.image.AxesImage at 0x7fb52960a860>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 45,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAx0AAAInCAYAAAD9DzTsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxv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XZZpXV/HdZaj7Pe0WWcjdDyHfNT6GPKR/peRB/1+P6X0zpbVNc5w9YyWsQnNfqfp/0/qsu0vB55LHvT7ri7LtTqC3E3pN3TeGZ/u69w4Wv4QcBl5p/LPyN3K/oTcTeq7LS1GMP66PLfdA5XXakW52fE1SSn9ZUrpRvKR/jeQWwheHNH99LcppZNTSj8hB7z9gW8Dv9964gCAiPjPRuCYioi4oBE4eiGl9FTGT6P8hYi4r+mxVpE/hzeTP4v/m1K6Bvhfcve2/yE/v/9tWmXjPXhmCSftTPaz2bydf0gOn5BPJDAp062T1H+GDklzwfIyfaDLMo2uIcu7LNO6vumssxE6lpF3+leQu1s9ndwCsQA4PqXU3Of/EnK3mcfTZjBxSumJPHoAeaedP8jjIgDOm+xOcOlO1uhOdXoZvN7OdF/nDcr0g+TuRG8mB5j1yV2FbiVfi+HClh3b/yjTN6SUNm7zWH9Dfp2h+2uyN7nbW6N1fzPglS2DrNt5Ifn9a/xWbsX4aWMHTkrpSeRWkI3IZx47vs1i9zDe9euJ5C5jTyy3f86ju2YBXEx+T59Amy535TGPbrqr2/vQqHku0Liey/do33LUszpJg8HuVZLmglEmfxBlMucJbzvuYJLrvJB8MbkvxaOv53AzcExK6S7gncDbU0qfiIi7IuLucl2HfwTeVa5T8M/kFoVdGO8u1dC2q0tK6VnkrkMw3lVqMl5ODkVryGMLOpnK69L
|
||
|
"text/plain": [
|
||
|
"<Figure size 900x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAg0AAAINCAYAAAC9GEyUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy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0mY5DmuiwCVJmlhBUosHQM2M42IerjQAAAALTQMAALDQNAAAAAtNAwAAsNA0AAAAC00DAACw0DQAAAALTQMAALAciHCnmUptTOeH/LSNAJd+EW+uVSPEpGMElPSN4KYlM+gkMjEDfoZGzbgVL6vdMZ7baCWsKR6I13XFxkZY0z8a1xjTQ1uPx/PjxMnVsOYb7W5Yc7IVh7xsGoEyjp4RyrRmnEqOl97p5lmTuOb64HiWpLWuEbozjZ/bE7M4SWvTmCDOUdYzgne6xpKcPX+6HT/3x9rx8zplzMWB8eTjpUithkKiJC8Aa1DGk3HLqBnM4rk4MY7XaQMBUIsGunGlAQAAWGgaAACAhaYBAABYaBoAAICFpgEAAFhoGgAAgIWmAQAAWGgaAACAhaYBAABYDkYiZFlqOB3NrekYqXf9Ik7qWzVqhorX1Wuon3NS1kaFUyVtWWlkcdrYppFEN1iKa05PDoU1V399Oaw5+sj8uSFJ3Xac1jYYx4fT19UPax7uxUmfp4t4PGNjX7SddFJjvl6heN4/a+IlmN402wprrrvmdFiztBYn9Q3X4322ciqeQ5uj+Pm3jeNsbSWeiytrcY3j8ZNx6mp/vBbWTHvxuWpgzFfnPDR202uDVMS
|
||
|
"text/plain": [
|
||
|
"<Figure size 900x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAw8AAAInCAYAAADeVGU5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOzdeZhkZXnw/y8zzDiABBFk3xyQOxgRcRADYphX0OhrFIlblCWguL0/NWIiGiUuIRJGIxqNCXGDCKhg9JU3uI4gKgiIig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UE6wvAcR0Xrq0787dHxJHAvwPtHaqfBrw2Ik7IzM4+Fq3k4VmUZintngmcEBF/lZmntT3fvr8TgHfywO+cZwCvj4hjM/NTvc6t+t+U1+i+up1uWiM9Pa7PdlqvZ/trOdn3Suv87gW+Tml+1+75wF9FxDPb+9wAZOZPKE3jJuMUShLznm7Ns6YhDrh/2NV3UJKt1rDAr8rMb7St8xBKkgDlvfVdSt+GdkcAX4uIP8/MXzXc90LgX+vDWymjqEkaEvs8SBq21gXsPX3WaQ3NuWmfdaZ7m+Pta0L7y8zbKR2JAU5s72PQpr2D9eI+2/7fjCUOUPqQPK1jnc3blp0BXAHsTxkRaClldKqFlP4OL+yIbSUPCyjD1u5EuYDcm9LpeTHwb3V0qs79HUy5O30e5ULyIcBelNGXlgBnNugA+/pafqJLDUfL/6vlId2Gqa3PHVwftr+Wk32vtM7vvZQ2+K+jJCKbUZKsmyivz/n1DvyU1Vqf11Da/p/Yf+2px3XYn5J8tQYQ2BL4s9pMrqX99zMoo079JWW0rS0ogxj
|
||
|
"text/plain": [
|
||
|
"<Figure size 900x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAg0AAAINCAYAAAC9GEyUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAXEQAAFxEByibzPwAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3de7AlZ33e+6d7Xfbal7nrhhCSQBKvZUcOxmBCEQelgp2k7EPigjgEBCVcEOPKsY9TiSEJJIgYU1zKOSQpTqkSn2AHh4RQISahwNiYRA5wIJhwC5dXINAVhOY++75uff5YvZlhPLN+z8zqPXuk/f1UqZb2rN/u9Xb3271/u3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1E85s3DRn89PhWWbByOX+vBRw7GNZ143R8r4yCcVSMsx5mLbWM7zxlBOZK0VMShO1eWvbDmOsXBTTcO43FfM4y3UVdxaFff+B3tpBFsdawVL6fVMo4fIyRq0zhX9atRPB5jfjghYkPjtSRvzhbjeBttGMfQhuIxrRRxjXFa1MAJkJvx+QhXGgAAgIWmAQAAWGgaAACAhaYBAABYaBoAAICFpgEAAFhoGgAAgIWmAQAAWGgaAACAZVckQo6qsY4NVqbWOIllpZHG5Y6niRqHs15OaqQkdct4usyVnbCmULwdF1vxcuKsNmlg7LJTwziB8Mh3FsOa8tE4a+2x1YWw5hudOMnwm604Ye671WZYc2rcD2ucxD9nny4U8T6VpGvK+bDm6VWcCPmMzTil8Wl
|
||
|
"text/plain": [
|
||
|
"<Figure size 900x600 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"plot_acorr(np.array(sptrs_0[unit_0]))\n",
|
||
|
"plt.title(f'{theta_mod_idx(np.array(sptrs_0[unit_0]))}')\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.imshow(data_loader.rate_map(action_id_0, channel_0, unit_0, 0.04))\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"plot_acorr(np.array(sptrs_1[unit_1]))\n",
|
||
|
"plt.title(f'{theta_mod_idx(np.array(sptrs_1[unit_1]))}')\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.imshow(data_loader.rate_map(action_id_1, channel_1, unit_1, 0.04))"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.6.8"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 4
|
||
|
}
|