|
@@ -23,7 +23,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 2,
|
|
|
+ "execution_count": 1,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -112,8 +112,8 @@
|
|
|
" dt = np.diff(pos_at_freq[:, 0])\n",
|
|
|
" speed = np.concatenate([dx/dt, [dx[-1]/dt[-1]]])\n",
|
|
|
"\n",
|
|
|
- " proc.create_dataset('timeline', data=np.column_stack([pos_at_freq[:, 0], x_smooth, y_smooth, speed]))\n",
|
|
|
- " proc.attrs['headers'] = 'time, x, y, speed'\n",
|
|
|
+ " timeline = proc.create_dataset('timeline', data=np.column_stack([pos_at_freq[:, 0], x_smooth, y_smooth, speed]))\n",
|
|
|
+ " timeline.attrs['headers'] = 'time, x, y, speed'\n",
|
|
|
"\n",
|
|
|
" # save trials\n",
|
|
|
" events = np.array(f['raw']['events'])\n",
|
|
@@ -131,8 +131,8 @@
|
|
|
"\n",
|
|
|
" trials[i] = (t_start_idx, t_end_idx, x_in_m, y_in_m, r_in_m, state)\n",
|
|
|
"\n",
|
|
|
- " proc.create_dataset('trial_idxs', data=trials)\n",
|
|
|
- " proc.attrs['headers'] = 't_start_idx, t_end_idx, target_x, target_y, target_r, fail_or_success'\n",
|
|
|
+ " trial_idxs = proc.create_dataset('trial_idxs', data=trials)\n",
|
|
|
+ " trial_idxs.attrs['headers'] = 't_start_idx, t_end_idx, target_x, target_y, target_r, fail_or_success'\n",
|
|
|
"\n",
|
|
|
" # save sounds\n",
|
|
|
" sounds = np.array(f['raw']['sounds'])\n",
|
|
@@ -150,8 +150,8 @@
|
|
|
" sound_idxs[i] = (left_idx, sounds[i][1])\n",
|
|
|
" delta = 10**5\n",
|
|
|
"\n",
|
|
|
- " proc.create_dataset('sound_idxs', data=sound_idxs)\n",
|
|
|
- " proc.attrs['headers'] = 'timeline_idx, sound_id'\n",
|
|
|
+ " sound_idxs = proc.create_dataset('sound_idxs', data=sound_idxs)\n",
|
|
|
+ " sound_idxs.attrs['headers'] = 'timeline_idx, sound_id'\n",
|
|
|
" \n",
|
|
|
" return h5name"
|
|
|
]
|
|
@@ -180,7 +180,7 @@
|
|
|
"name": "python",
|
|
|
"nbconvert_exporter": "python",
|
|
|
"pygments_lexer": "ipython3",
|
|
|
- "version": "3.8.10"
|
|
|
+ "version": "3.8.8"
|
|
|
}
|
|
|
},
|
|
|
"nbformat": 4,
|