|
@@ -44,7 +44,6 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "attachments": {},
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|
|
|
"source": [
|
|
@@ -59,12 +58,16 @@
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
- "cfg_filename = os.path.join('profiles', 'gokce_timeSIT_50_100.json')\n",
|
|
|
- "# cfg_filename = os.path.join('profiles', 'gokce_timeSIT_90_99.json')\n",
|
|
|
- "#'gokce_timeSIT_90_108.json')\n",
|
|
|
+ "# cfg_filename = os.path.join('profiles', 'mouse_freq.json')\n",
|
|
|
+ "# cfg_filename = os.path.join('profiles', 'implanted_multiSIT_660_1320.json')\n",
|
|
|
+ "#cfg_filename = os.path.join('profiles', 'implanted_timeSIT_50_100.json')\n",
|
|
|
+ "# cfg_filename = os.path.join('profiles', 'passive_FDA.json')\n",
|
|
|
+ "# cfg_filename = os.path.join('profiles', 'gokce_timeSIT_50_100.json')\n",
|
|
|
+ "# cfg_filename = os.path.join('profiles', 'gokce_timeSIT_90_120.json')\n",
|
|
|
+ "# gokce_timeSIT_90_108.json')\n",
|
|
|
"\n",
|
|
|
- "# cfg_filename = os.path.join('profiles', 'gokce_socialSIT.json')\n",
|
|
|
- "#cfg_filename = os.path.join('profiles', 'miguel_socialSIT_fireface.json')\n",
|
|
|
+ "cfg_filename = os.path.join('profiles', 'gokce_socialSIT.json')\n",
|
|
|
+ "# cfg_filename = os.path.join('profiles', 'miguel_socialSIT_fireface.json')\n",
|
|
|
"# cfg_filename = os.path.join('profiles', 'miguel_socialSIT_fireface_chirp.json')\n",
|
|
|
"\n",
|
|
|
"# cfg_filename = os.path.join('profiles', 'andrey_ppcSIT_SL_009266.json')"
|
|
@@ -106,7 +109,143 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "attachments": {},
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 5,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": [
|
|
|
+ " 0 Microsoft Sound Mapper - Input, MME (2 in, 0 out)\n",
|
|
|
+ "> 1 Line 1/2 (M-Audio Delta 410), MME (2 in, 0 out)\n",
|
|
|
+ " 2 S/PDIF (M-Audio Delta 410), MME (2 in, 0 out)\n",
|
|
|
+ " 3 Monitor (M-Audio Delta 410), MME (2 in, 0 out)\n",
|
|
|
+ " 4 Multichannel (M-Audio Delta 410, MME (2 in, 0 out)\n",
|
|
|
+ " 5 ADAT 1 (1+2) (RME Fireface UFX), MME (2 in, 0 out)\n",
|
|
|
+ " 6 Analog (9+10) (RME Fireface UFX, MME (2 in, 0 out)\n",
|
|
|
+ " 7 Analog (5+6) (RME Fireface UFX), MME (2 in, 0 out)\n",
|
|
|
+ " 8 Analog (1+2) (RME Fireface UFX), MME (2 in, 0 out)\n",
|
|
|
+ " 9 Analog (3+4) (RME Fireface UFX), MME (2 in, 0 out)\n",
|
|
|
+ " 10 Analog (11+12) (RME Fireface UF, MME (2 in, 0 out)\n",
|
|
|
+ " 11 Analog (7+8) (RME Fireface UFX), MME (2 in, 0 out)\n",
|
|
|
+ " 12 AES (RME Fireface UFX), MME (2 in, 0 out)\n",
|
|
|
+ " 13 Microsoft Sound Mapper - Output, MME (0 in, 2 out)\n",
|
|
|
+ "< 14 Speakers (3- Realtek High Defin, MME (0 in, 2 out)\n",
|
|
|
+ " 15 Line 1/2 (M-Audio Delta 410), MME (0 in, 2 out)\n",
|
|
|
+ " 16 Line 3/4 (M-Audio Delta 410), MME (0 in, 2 out)\n",
|
|
|
+ " 17 Line 7/8 (M-Audio Delta 410), MME (0 in, 2 out)\n",
|
|
|
+ " 18 Line 5/6 (M-Audio Delta 410), MME (0 in, 2 out)\n",
|
|
|
+ " 19 S/PDIF (M-Audio Delta 410), MME (0 in, 2 out)\n",
|
|
|
+ " 20 Multichannel (M-Audio Delta 410, MME (0 in, 2 out)\n",
|
|
|
+ " 21 Analog (11+12) (RME Fireface UF, MME (0 in, 2 out)\n",
|
|
|
+ " 22 Analog (7+8) (RME Fireface UFX), MME (0 in, 2 out)\n",
|
|
|
+ " 23 AES (RME Fireface UFX), MME (0 in, 2 out)\n",
|
|
|
+ " 24 Speakers (RME Fireface UFX), MME (0 in, 2 out)\n",
|
|
|
+ " 25 ADAT 1 (1+2) (RME Fireface UFX), MME (0 in, 2 out)\n",
|
|
|
+ " 26 Analog (5+6) (RME Fireface UFX), MME (0 in, 2 out)\n",
|
|
|
+ " 27 Analog (3+4) (RME Fireface UFX), MME (0 in, 2 out)\n",
|
|
|
+ " 28 Analog (9+10) (RME Fireface UFX, MME (0 in, 2 out)\n",
|
|
|
+ " 29 Primary Sound Capture Driver, Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 30 Line 1/2 (M-Audio Delta 410), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 31 S/PDIF (M-Audio Delta 410), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 32 Monitor (M-Audio Delta 410), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 33 Multichannel (M-Audio Delta 410), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 34 ADAT 1 (1+2) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 35 Analog (9+10) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 36 Analog (5+6) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 37 Analog (1+2) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 38 Analog (3+4) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 39 Analog (11+12) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 40 Analog (7+8) (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 41 AES (RME Fireface UFX), Windows DirectSound (2 in, 0 out)\n",
|
|
|
+ " 42 Primary Sound Driver, Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 43 Speakers (3- Realtek High Definition Audio), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 44 Analog (11+12) (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 45 Line 1/2 (M-Audio Delta 410), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 46 Line 3/4 (M-Audio Delta 410), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 47 Line 7/8 (M-Audio Delta 410), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 48 Line 5/6 (M-Audio Delta 410), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 49 Analog (7+8) (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 50 S/PDIF (M-Audio Delta 410), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 51 AES (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 52 Speakers (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 53 Multichannel (M-Audio Delta 410), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 54 ADAT 1 (1+2) (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 55 Analog (5+6) (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 56 Analog (3+4) (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 57 Analog (9+10) (RME Fireface UFX), Windows DirectSound (0 in, 2 out)\n",
|
|
|
+ " 58 ASIO Fireface USB, ASIO (16 in, 16 out)\n",
|
|
|
+ " 59 M-Audio Delta ASIO, ASIO (6 in, 10 out)\n",
|
|
|
+ " 60 Analog (11+12) (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 61 Line 1/2 (M-Audio Delta 410), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 62 Line 3/4 (M-Audio Delta 410), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 63 Line 7/8 (M-Audio Delta 410), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 64 Line 5/6 (M-Audio Delta 410), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 65 Analog (7+8) (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 66 S/PDIF (M-Audio Delta 410), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 67 AES (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 68 Speakers (3- Realtek High Definition Audio), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 69 Speakers (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 70 Multichannel (M-Audio Delta 410), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 71 ADAT 1 (1+2) (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 72 Analog (5+6) (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 73 Analog (3+4) (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 74 Analog (9+10) (RME Fireface UFX), Windows WASAPI (0 in, 2 out)\n",
|
|
|
+ " 75 ADAT 1 (1+2) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 76 Analog (9+10) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 77 Line 1/2 (M-Audio Delta 410), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 78 Analog (5+6) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 79 S/PDIF (M-Audio Delta 410), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 80 Monitor (M-Audio Delta 410), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 81 Analog (1+2) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 82 Analog (3+4) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 83 Analog (11+12) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 84 Analog (7+8) (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 85 AES (RME Fireface UFX), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 86 Multichannel (M-Audio Delta 410), Windows WASAPI (2 in, 0 out)\n",
|
|
|
+ " 87 Line in at front panel (black) (Line in at front panel (black)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 88 Line in at rear panel (Blue) (Line in at rear panel (Blue)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 89 Speakers (Realtek HD Audio output), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 90 Stereo Mix (Realtek HD Audio Stereo input), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 91 Line 1/2 (Delta 410 1/2), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 92 Line 1/2 (Delta 410 1/2), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 93 Line 3/4 (Delta 410 3/4), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 94 Line 5/6 (Delta 410 5/6), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 95 Line 7/8 (Delta 410 7/8), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 96 Monitor (Delta\t410 Monitor), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 97 Multichannel (Delta 410 Multi), Windows WDM-KS (0 in, 10 out)\n",
|
|
|
+ " 98 Multichannel (Delta 410 Multi), Windows WDM-KS (6 in, 0 out)\n",
|
|
|
+ " 99 S/PDIF 1 (Delta 410 SPDIF), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 100 S/PDIF 2 (Delta 410 SPDIF), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 101 S/PDIF (Delta 410 SPDIF), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 102 Analog (1+2) (Fireface Analog (1+2)), Windows WDM-KS (0 in, 8 out)\n",
|
|
|
+ " 103 Analog (1+2) (Fireface Analog (1+2)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 104 Analog (3+4) (Fireface Analog (3+4)), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 105 Analog (3+4) (Fireface Analog (3+4)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 106 Analog (5+6) (Fireface Analog (5+6)), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 107 Analog (5+6) (Fireface Analog (5+6)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 108 Analog (7+8) (Fireface Analog (7+8)), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 109 Analog (7+8) (Fireface Analog (7+8)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 110 Analog (9+10) (Fireface Analog (9+10)), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 111 Analog (9+10) (Fireface Analog (9+10)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 112 Analog (11+12) (Fireface Analog (11+12)), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 113 Analog (11+12) (Fireface Analog (11+12)), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 114 AES (Fireface AES), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 115 AES (Fireface AES), Windows WDM-KS (2 in, 0 out)\n",
|
|
|
+ " 116 ADAT 1 (1+2) (Fireface ADAT 1 (1+2)), Windows WDM-KS (0 in, 2 out)\n",
|
|
|
+ " 117 ADAT 1 (1+2) (Fireface ADAT 1 (1+2)), Windows WDM-KS (2 in, 0 out)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "execution_count": 5,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "sd.query_devices() "
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|
|
|
"source": [
|
|
@@ -117,7 +256,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 4,
|
|
|
+ "execution_count": 6,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -145,6 +284,8 @@
|
|
|
" cfg['sound']['wav_file'] = os.path.join('assets', cfg['sound']['wav_file'])\n",
|
|
|
"if 'continuous' in cfg['sound']:\n",
|
|
|
" cfg['sound']['continuous']['wav_file'] = os.path.join('assets', cfg['sound']['continuous']['wav_file'])\n",
|
|
|
+ "if 'cont_noise' in cfg['sound']:\n",
|
|
|
+ " cfg['sound']['cont_noise']['filepath'] = os.path.join('assets', cfg['sound']['cont_noise']['filepath'])\n",
|
|
|
" \n",
|
|
|
"# Saves all parameters to a JSON file with the user-defined \"Experiment ID\" as filename\n",
|
|
|
"with open(os.path.join(save_to, experiment_id + '.json'), 'w') as f:\n",
|
|
@@ -160,17 +301,18 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 5,
|
|
|
+ "execution_count": 7,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
"def timeout(t_start):\n",
|
|
|
- " return time.time() - t_start > cfg_exp['session_duration'] if t_start is not None else False"
|
|
|
+ " duration_total = cfg_exp['session_duration'] + cfg_exp['silence_before'] + cfg_exp['silence_after']\n",
|
|
|
+ " return time.time() > t_start + duration_total if t_start is not None else False"
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 6,
|
|
|
+ "execution_count": 8,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -181,7 +323,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 7,
|
|
|
+ "execution_count": 9,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -196,7 +338,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 8,
|
|
|
+ "execution_count": 10,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -206,7 +348,6 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "attachments": {},
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|
|
|
"source": [
|
|
@@ -223,7 +364,32 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 9,
|
|
|
+ "execution_count": 11,
|
|
|
+ "metadata": {
|
|
|
+ "scrolled": true
|
|
|
+ },
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": [
|
|
|
+ "{'filepath': 'assets\\\\chirp_rate192KHz_100ms_2000Hz_30000Hz.wav',\n",
|
|
|
+ " 'amp': 0.5,\n",
|
|
|
+ " 'channels': [3],\n",
|
|
|
+ " 'enabled': True}"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "execution_count": 11,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "cfg['sound']['cont_noise']"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 12,
|
|
|
"metadata": {
|
|
|
"scrolled": true
|
|
|
},
|
|
@@ -454,8 +620,20 @@
|
|
|
" sound.value = 0\n",
|
|
|
" punishment_since = None\n",
|
|
|
"\n",
|
|
|
- " if c_time > trial_start and iti_distance > cfg_exp['iti_distance'] and \\\n",
|
|
|
- " isl_factory.last_tgt_x is not None and not pt.is_inside(isl_factory.last_tgt_x, isl_factory.last_tgt_y, cfg_exp['target_radius']):\n",
|
|
|
+ " # animal is not inside the island\n",
|
|
|
+ " if isl_factory.last_tgt_x is not None:\n",
|
|
|
+ " is_inside_island = pt.is_inside(isl_factory.last_tgt_x, isl_factory.last_tgt_y, cfg_exp['target_radius'])\n",
|
|
|
+ " else:\n",
|
|
|
+ " is_inside_island = False\n",
|
|
|
+ "\n",
|
|
|
+ " # silence after the recording\n",
|
|
|
+ " in_silence = c_time < t_start + cfg_exp['silence_before'] or\\\n",
|
|
|
+ " c_time > t_start + cfg_exp['silence_before'] + cfg_exp['session_duration']\n",
|
|
|
+ " \n",
|
|
|
+ " # enough time in ITI\n",
|
|
|
+ " # animal is not sitting in ITI\n",
|
|
|
+ " # not yet silence period after\n",
|
|
|
+ " if c_time > trial_start and iti_distance > cfg_exp['iti_distance'] and not is_inside_island and not in_silence:\n",
|
|
|
" ## TODO refactor this + trial init below into a function\n",
|
|
|
" # init_new_trial\n",
|
|
|
" islands = isl_factory.generate_islands(c_time - t_start)\n",
|
|
@@ -529,20 +707,25 @@
|
|
|
" if status.value == 1: # start the session\n",
|
|
|
" if t_start is None:\n",
|
|
|
" t_start = c_time\n",
|
|
|
- " trial_start = c_time\n",
|
|
|
+ " trial_start = c_time + cfg_exp['silence_before']\n",
|
|
|
" status.value = 2\n",
|
|
|
- " \n",
|
|
|
+ "\n",
|
|
|
" # init_new_trial\n",
|
|
|
- " islands = isl_factory.generate_islands(c_time - t_start)\n",
|
|
|
- " log_islands(islands) # log island(s) positions\n",
|
|
|
- " sound.value = 1\n",
|
|
|
- " phase = 1\n",
|
|
|
- " trial += 1\n",
|
|
|
+ " if cfg_exp['silence_before'] == 0:\n",
|
|
|
+ " islands = isl_factory.generate_islands(c_time - t_start)\n",
|
|
|
+ " log_islands(islands) # log island(s) positions\n",
|
|
|
+ " sound.value = 1\n",
|
|
|
+ " phase = 1\n",
|
|
|
+ " trial += 1\n",
|
|
|
"\n",
|
|
|
- " # log trial start\n",
|
|
|
- " tgt = [i for i in islands if not i.is_distractor][0]\n",
|
|
|
- " log_event(c_time, round(tgt.x, 4), round(tgt.y, 4), round(tgt.r, 4), trial, 0)\n",
|
|
|
- " \n",
|
|
|
+ " # log trial start\n",
|
|
|
+ " tgt = [i for i in islands if not i.is_distractor][0]\n",
|
|
|
+ " log_event(c_time, round(tgt.x, 4), round(tgt.y, 4), round(tgt.r, 4), trial, 0)\n",
|
|
|
+ " \n",
|
|
|
+ " else: # or start with ITI to record in silence before\n",
|
|
|
+ " sound.value = 0\n",
|
|
|
+ " phase = 2\n",
|
|
|
+ " \n",
|
|
|
" # init light events\n",
|
|
|
" timers = []\n",
|
|
|
" for event_t in cfg_exp['light_events']:\n",
|
|
@@ -621,7 +804,6 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "attachments": {},
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|
|
|
"source": [
|
|
@@ -630,7 +812,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 10,
|
|
|
+ "execution_count": 13,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -642,7 +824,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 11,
|
|
|
+ "execution_count": 14,
|
|
|
"metadata": {},
|
|
|
"outputs": [
|
|
|
{
|
|
@@ -652,7 +834,7 @@
|
|
|
"traceback": [
|
|
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|
|
"\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)",
|
|
|
- "\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;32m<ipython-input-14-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"
|
|
@@ -669,7 +851,6 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "attachments": {},
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|
|
|
"source": [
|
|
@@ -765,7 +946,6 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- "attachments": {},
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {},
|
|
|
"source": [
|
|
@@ -776,7 +956,7 @@
|
|
|
"cell_type": "code",
|
|
|
"execution_count": null,
|
|
|
"metadata": {
|
|
|
- "scrolled": true
|
|
|
+ "scrolled": false
|
|
|
},
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
@@ -816,7 +996,9 @@
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
"execution_count": null,
|
|
|
- "metadata": {},
|
|
|
+ "metadata": {
|
|
|
+ "scrolled": true
|
|
|
+ },
|
|
|
"outputs": [],
|
|
|
"source": [
|
|
|
"fig = plt.figure(figsize=(4, 4))\n",
|
|
@@ -848,7 +1030,9 @@
|
|
|
"execution_count": null,
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
|
- "source": []
|
|
|
+ "source": [
|
|
|
+ "# import this\n"
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|