Browse Source

moved settings to profiles

dianamaro 2 years ago
parent
commit
a40e3e9d9f
3 changed files with 36 additions and 19 deletions
  1. 2 2
      .gitignore
  2. 34 17
      aSIT.ipynb
  3. 0 0
      profiles/default.json

+ 2 - 2
.gitignore

@@ -1,11 +1,11 @@
 # user generated files
 *.png
 *parameters.txt
-*parameters.json
 *.xlsx
 *.avi
 sessions*
-settings_*
+*.json
+!default.json
 
 # ipython temp files
 .ipynb_checkpoints

+ 34 - 17
aSIT.ipynb

@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 48,
+   "execution_count": 5,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -44,16 +44,16 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 49,
+   "execution_count": 19,
    "metadata": {},
    "outputs": [],
    "source": [
-    "cfg_filename = 'settings.json'"
+    "cfg_filename = os.path.join('profiles', 'default.json')"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 50,
+   "execution_count": 7,
    "metadata": {
     "scrolled": false
    },
@@ -69,7 +69,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 51,
+   "execution_count": 8,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -91,7 +91,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 52,
+   "execution_count": 9,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -122,7 +122,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 53,
+   "execution_count": 10,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -137,7 +137,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 54,
+   "execution_count": 11,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -155,7 +155,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 55,
+   "execution_count": 12,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -165,7 +165,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 56,
+   "execution_count": 13,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -176,12 +176,11 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 57,
+   "execution_count": 18,
    "metadata": {},
    "outputs": [],
    "source": [
     "def switch_light(pt, board):\n",
-    "    print('Switching BG..')\n",
     "    pt.switch_background()\n",
     "    board.switch_light()"
    ]
@@ -203,7 +202,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 15,
    "metadata": {
     "scrolled": false
    },
@@ -212,7 +211,12 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "Webcam stream 1024.0:768.0 at 20.00 FPS started\n"
+      "Webcam stream 1024.0:768.0 at 20.00 FPS started\n",
+      "Switching BG..\n",
+      "Switching BG..\n",
+      "Position tracker stopped\n",
+      "Video writer stopped\n",
+      "Camera released\n"
      ]
     }
    ],
@@ -468,7 +472,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 16,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -478,9 +482,22 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 17,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "ename": "IndexError",
+     "evalue": "too many indices for array: array is 1-dimensional, but 2 were indexed",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
+      "\u001b[1;32m<ipython-input-17-74648d1531a4>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\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----> 2\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[1;32mD:\\runSIT\\postprocessing.ipynb\u001b[0m in \u001b[0;36mpack\u001b[1;34m(session_path)\u001b[0m\n\u001b[0;32m     89\u001b[0m     \u001b[1;34m\"            if curr_idx < len(positions) - 1 and \\\\\\n\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     90\u001b[0m     \u001b[1;34m\"                np.abs(t - positions[:, 0][curr_idx]) > np.abs(t - positions[:, 0][curr_idx + 1]):\\n\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 91\u001b[1;33m     \u001b[1;34m\"                curr_idx += 1\\n\"\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     92\u001b[0m     \u001b[1;34m\"            pos_at_freq[i] = (t, positions[curr_idx][1], positions[curr_idx][2])\\n\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     93\u001b[0m     \u001b[1;34m\"\\n\"\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: too many indices for array: array is 1-dimensional, but 2 were indexed"
+     ]
+    }
+   ],
    "source": [
     "# do pack data to HDF5\n",
     "h5name = pack(session_path)"

settings.json → profiles/default.json