|
@@ -2,7 +2,7 @@
|
|
|
"cells": [
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 23,
|
|
|
+ "execution_count": 1,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -54,16 +54,16 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 24,
|
|
|
+ "execution_count": 2,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
- "cfg_filename = os.path.join('profiles', 'passive.json')"
|
|
|
+ "cfg_filename = os.path.join('profiles', 'passive_FDA.json')"
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 25,
|
|
|
+ "execution_count": 3,
|
|
|
"metadata": {
|
|
|
"scrolled": false
|
|
|
},
|
|
@@ -94,7 +94,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 26,
|
|
|
+ "execution_count": 4,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -137,7 +137,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 27,
|
|
|
+ "execution_count": 5,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -147,7 +147,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 28,
|
|
|
+ "execution_count": 6,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -158,7 +158,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 29,
|
|
|
+ "execution_count": 7,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -173,7 +173,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 30,
|
|
|
+ "execution_count": 8,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -199,7 +199,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 31,
|
|
|
+ "execution_count": 9,
|
|
|
"metadata": {
|
|
|
"scrolled": true
|
|
|
},
|
|
@@ -209,6 +209,7 @@
|
|
|
"output_type": "stream",
|
|
|
"text": [
|
|
|
"Webcam stream 1024.0:768.0 at 30.00 FPS started\n",
|
|
|
+ "{-1: 'noise', 0: 'silence', 1: 'F2', 2: 'F4', 3: 'D4', 4: 'D5', 5: 'F3', 6: 'I2', 7: 'D1', 8: 'F1', 9: 'I3', 10: 'D6', 11: 'I1', 12: 'I4', 13: 'F5', 14: 'D2', 15: 'D3'}\n",
|
|
|
"Position tracker stopped\n",
|
|
|
"Video writer stopped\n",
|
|
|
"Camera released\n"
|
|
@@ -270,12 +271,23 @@
|
|
|
" 0: 'silence'\n",
|
|
|
"}\n",
|
|
|
"\n",
|
|
|
- "sound_order = 1\n",
|
|
|
- "for s_type in ('F', 'D', 'I', 'L'):\n",
|
|
|
- " keys = sorted([key for key in sounds.keys() if key.startswith(s_type)])\n",
|
|
|
- " for key in keys:\n",
|
|
|
- " commutator[sound_order] = key\n",
|
|
|
- " sound_order += 1\n",
|
|
|
+ "# ordered sound presentations - F, D, I, L\n",
|
|
|
+ "# sound_order = 1\n",
|
|
|
+ "# for s_type in ('F', 'D', 'I', 'L'):\n",
|
|
|
+ "# keys = sorted([key for key in sounds.keys() if key.startswith(s_type)])\n",
|
|
|
+ "# for key in keys:\n",
|
|
|
+ "# commutator[sound_order] = key\n",
|
|
|
+ "# sound_order += 1\n",
|
|
|
+ "\n",
|
|
|
+ "# random sound presentations\n",
|
|
|
+ "sound_keys = [key for key in sounds.keys() if not key.startswith('noise')]\n",
|
|
|
+ "comm_keys = [i+1 for i in list(range(len(sound_keys)))]\n",
|
|
|
+ "for i in comm_keys:\n",
|
|
|
+ " key = sound_keys.pop(random.randrange(len(sound_keys)))\n",
|
|
|
+ " commutator[i] = key\n",
|
|
|
+ "\n",
|
|
|
+ "print(commutator)\n",
|
|
|
+ "\n",
|
|
|
"sc = mp.Process(target=SoundController.run, args=(sound, status, cfg['sound'], commutator))\n",
|
|
|
"sc.start()\n",
|
|
|
"\n",
|
|
@@ -443,9 +455,9 @@
|
|
|
" for t in timers:\n",
|
|
|
" t.cancel()\n",
|
|
|
" \n",
|
|
|
- " if board.is_light_off:\n",
|
|
|
- " board.switch_light() # turn light back on\n",
|
|
|
- " time.sleep(0.1)\n",
|
|
|
+ " #if board.is_light_off:\n",
|
|
|
+ " # board.switch_light() # turn light back on\n",
|
|
|
+ " # time.sleep(0.1)\n",
|
|
|
" board.exit()\n",
|
|
|
" \n",
|
|
|
" if cfg['experiment']['enable_motors']:\n",
|
|
@@ -478,7 +490,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 32,
|
|
|
+ "execution_count": 10,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -490,14 +502,14 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 33,
|
|
|
+ "execution_count": 11,
|
|
|
"metadata": {},
|
|
|
"outputs": [
|
|
|
{
|
|
|
"name": "stderr",
|
|
|
"output_type": "stream",
|
|
|
"text": [
|
|
|
- "D:\\runSIT\\..\\pipeline\\postprocessing\\pack.py:59: UserWarning: loadtxt: Empty input file: \"sessions\\000000_hippoSIT_2023-07-11_09-32-45\\islands.csv\"\n",
|
|
|
+ "D:\\runSIT\\..\\pipeline\\postprocessing\\pack.py:59: UserWarning: loadtxt: Empty input file: \"sessions\\60_SIT_passive_2023-09-06_14-45-21\\islands.csv\"\n",
|
|
|
" data = np.loadtxt(filename, delimiter=',', skiprows=1)\n"
|
|
|
]
|
|
|
},
|
|
@@ -508,7 +520,7 @@
|
|
|
"traceback": [
|
|
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|
|
"\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)",
|
|
|
- "\u001b[1;32m<ipython-input-33-df6d003c4298>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;31m# do pack data to HDF5\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mh5name\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msession_path\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[0mtrial\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
|
|
+ "\u001b[1;32m<ipython-input-11-df6d003c4298>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;31m# do pack data to HDF5\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mh5name\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msession_path\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 6\u001b[0m \u001b[0mtrial\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
|
|
"\u001b[1;32mD:\\runSIT\\..\\pipeline\\postprocessing\\pack.py\u001b[0m in \u001b[0;36mpack\u001b[1;34m(session_path)\u001b[0m\n\u001b[0;32m 165\u001b[0m \u001b[1;31m# head direction\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 166\u001b[0m \u001b[0mtemp_tl\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumn_stack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mpos_at_freq\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mx_smooth\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0my_smooth\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mspeed\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 167\u001b[1;33m \u001b[0mhd\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mhead_direction\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtemp_tl\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 168\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 169\u001b[0m \u001b[1;31m# trial numbers\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
|
|
"\u001b[1;32mD:\\runSIT\\..\\pipeline\\postprocessing\\head_direction.py\u001b[0m in \u001b[0;36mhead_direction\u001b[1;34m(tl, hd_update_speed)\u001b[0m\n\u001b[0;32m 22\u001b[0m \u001b[0mcrit\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwhere\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdiff\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0midle_idxs\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m>\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 23\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 24\u001b[1;33m \u001b[0midle_periods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0midle_idxs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0midle_idxs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mcrit\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m)\u001b[0m \u001b[1;31m# first idle period\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 25\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpoint\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcrit\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 26\u001b[0m \u001b[0midx_start\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0midle_idxs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mcrit\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
|
|
"\u001b[1;31mIndexError\u001b[0m: index 0 is out of bounds for axis 0 with size 0"
|
|
@@ -702,7 +714,9 @@
|
|
|
"execution_count": null,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
- "source": []
|
|
|
+ "source": [
|
|
|
+ "import this\n"
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|