Rev 4417 Rev 4422
Line 1... Line 1...
1 { 1 {
2 "metadata": { 2 "metadata": {
3 "name": "", 3 "name": "",
4 "signature": "sha256:c35f5f2963a30c62e2bc2437fc0d2422404aec0dbc3c5526df0be8cecdef27ee" 4 "signature": "sha256:2b27dc30afc5801b549b86c718ac60f04cf5f54a281bec76ad61772eab7fb3e7"
5 }, 5 },
6 "nbformat": 3, 6 "nbformat": 3,
7 "nbformat_minor": 0, 7 "nbformat_minor": 0,
8 "worksheets": [ 8 "worksheets": [
9 { 9 {
Line 17... Line 17...
17 "import matplotlib.pyplot as plt" 17 "import matplotlib.pyplot as plt"
18 ], 18 ],
19 "language": "python", 19 "language": "python",
20 "metadata": {}, 20 "metadata": {},
21 "outputs": [], 21 "outputs": [],
22 "prompt_number": 1 22 "prompt_number": 2
23 }, 23 },
24 { 24 {
25 "cell_type": "code", 25 "cell_type": "code",
26 "collapsed": false, 26 "collapsed": false,
27 "input": [ 27 "input": [
Line 29... Line 29...
29 "dataset = file['RPS01']" 29 "dataset = file['RPS01']"
30 ], 30 ],
31 "language": "python", 31 "language": "python",
32 "metadata": {}, 32 "metadata": {},
33 "outputs": [], 33 "outputs": [],
34 "prompt_number": 2 34 "prompt_number": 3
35 }, 35 },
36 { 36 {
37 "cell_type": "code", 37 "cell_type": "code",
38 "collapsed": false, 38 "collapsed": false,
39 "input": [ 39 "input": [
Line 48... Line 48...
48 "text": [ 48 "text": [
49 "36.7822\n" 49 "36.7822\n"
50 ] 50 ]
51 } 51 }
52 ], 52 ],
53 "prompt_number": 24 53 "prompt_number": 4
54 }, 54 },
55 { 55 {
56 "cell_type": "code", 56 "cell_type": "code",
57 "collapsed": false, 57 "collapsed": false,
58 "input": [ 58 "input": [
Line 61... Line 61...
61 "plt.show()" 61 "plt.show()"
62 ], 62 ],
63 "language": "python", 63 "language": "python",
64 "metadata": {}, 64 "metadata": {},
65 "outputs": [], 65 "outputs": [],
66 "prompt_number": 14 66 "prompt_number": 5
67 }, 67 },
68 { 68 {
69 "cell_type": "code", 69 "cell_type": "code",
70 "collapsed": false, 70 "collapsed": false,
71 "input": [ 71 "input": [
72 "prev_val= dataset.value[0,2]\n", 72 "prev_val= dataset.value[0,2]\n",
73 "n = 0\n", 73 "n = 0\n",
74 "angle = np.zeros_like(dataset.value)\n", 74 "angle = np.zeros((dataset.shape[0]))\n",
75 "for i in range(dataset.value.shape[0]):\n", 75 "for i in range(dataset.value.shape[0]):\n",
76 " if (dataset.value[i,2] - prev_val) > 300: \n", 76 " if abs(dataset.value[i,2] - prev_val) > 300:\n",
77 " n += 1\n", 77 " n -= 1\n",
-   78 " angle[i] = dataset.value[i,2] + n*360\n",
-   79 " prev_val = dataset.value[i,2]\n",
-   80 "# elif (dataset.value[i,2] - prev_val) < -300:\n",
-   81 "# n -= 1\n",
-   82 "# angle[i] = dataset.value[i,2] + n*360\n",
-   83 "# prev_val = dataset.value[i,2]\n",
-   84 " else:\n",
78 " angle[i] = dataset.value[i,2] + n*360\n", 85 " angle[i] = dataset.value[i,2] + n*360\n",
79 " prev_val = dataset.value[i,2]" 86 " prev_val = dataset.value[i,2]"
80 ], 87 ],
81 "language": "python", 88 "language": "python",
82 "metadata": {}, 89 "metadata": {},
83 "outputs": [], 90 "outputs": [],
-   91 "prompt_number": 55
-   92 },
-   93 {
-   94 "cell_type": "code",
-   95 "collapsed": false,
-   96 "input": [
-   97 "fig, ax1 = plt.subplots()\n",
-   98 "\n",
-   99 " ax2 = ax1.twinx()\n",
-   100 " ax1.plot(x, y1, 'g-')\n",
-   101 " ax2.plot(x, y2, 'b-')\n",
-   102 "\n",
-   103 " ax1.set_xlabel('X data')\n",
-   104 " ax1.set_ylabel('Y1 data', color='g')\n",
-   105 " ax2.set_ylabel('Y2 data', color='b')\n",
-   106 "\n",
-   107 " ax1.plot(dataset.value[:,0], angle,'b',dataset.value[:,0], dataset.value[:,2],'r')\n",
-   108 " ax2.plot(dataset.value[1:,0], np.diff(angle, n=1, axis=0),'g')\n",
-   109 "\n",
-   110 "plt.show()"
-   111 ],
-   112 "language": "python",
-   113 "metadata": {},
-   114 "outputs": [
-   115 {
-   116 "ename": "IndentationError",
-   117 "evalue": "unexpected indent (<ipython-input-68-85470c16d7f6>, line 3)",
-   118 "output_type": "pyerr",
-   119 "traceback": [
-   120 "\u001b[0;36m File \u001b[0;32m\"<ipython-input-68-85470c16d7f6>\"\u001b[0;36m, line \u001b[0;32m3\u001b[0m\n\u001b[0;31m ax2 = ax1.twinx()\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m unexpected indent\n"
-   121 ]
-   122 }
-   123 ],
-   124 "prompt_number": 68
-   125 },
-   126 {
-   127 "cell_type": "code",
-   128 "collapsed": false,
-   129 "input": [
-   130 "angle.shape"
-   131 ],
-   132 "language": "python",
-   133 "metadata": {},
-   134 "outputs": [
-   135 {
-   136 "metadata": {},
-   137 "output_type": "pyout",
-   138 "prompt_number": 63,
-   139 "text": [
-   140 "(12120,)"
-   141 ]
-   142 }
-   143 ],
-   144 "prompt_number": 63
-   145 },
-   146 {
-   147 "cell_type": "code",
-   148 "collapsed": false,
-   149 "input": [
-   150 "dataset.value[:,0].shape"
-   151 ],
-   152 "language": "python",
-   153 "metadata": {},
-   154 "outputs": [
-   155 {
-   156 "metadata": {},
-   157 "output_type": "pyout",
-   158 "prompt_number": 57,
-   159 "text": [
-   160 "(12120,)"
-   161 ]
-   162 }
-   163 ],
-   164 "prompt_number": 57
-   165 },
-   166 {
-   167 "cell_type": "code",
-   168 "collapsed": false,
-   169 "input": [
-   170 "dataset.value[:,0].shape"
-   171 ],
-   172 "language": "python",
-   173 "metadata": {},
-   174 "outputs": [
-   175 {
-   176 "metadata": {},
-   177 "output_type": "pyout",
-   178 "prompt_number": 60,
-   179 "text": [
-   180 "(12120,)"
-   181 ]
-   182 }
-   183 ],
84 "prompt_number": 19 184 "prompt_number": 60
85 }, 185 },
86 { 186 {
87 "cell_type": "code", 187 "cell_type": "code",
88 "collapsed": false, 188 "collapsed": false,
89 "input": [ 189 "input": [
90 "angle" 190 "np.diff(angle, n=1, axis=0).shape"
91 ], 191 ],
92 "language": "python", 192 "language": "python",
93 "metadata": {}, 193 "metadata": {},
94 "outputs": [ 194 "outputs": [
95 { 195 {
96 "metadata": {}, 196 "metadata": {},
97 "output_type": "pyout", 197 "output_type": "pyout",
98 "prompt_number": 20, 198 "prompt_number": 62,
99 "text": [ 199 "text": [
100 "array([[ 0., 0., 0.],\n", -  
101 " [ 0., 0., 0.],\n", -  
102 " [ 0., 0., 0.],\n", -  
103 " ..., \n", 200 "(12119,)"
104 " [ 0., 0., 0.],\n", -  
105 " [ 0., 0., 0.],\n", -  
106 " [ 0., 0., 0.]], dtype=float32)" -  
107 ] 201 ]
108 } 202 }
109 ], 203 ],
110 "prompt_number": 20 204 "prompt_number": 62
111 }, 205 },
112 { 206 {
113 "cell_type": "code", 207 "cell_type": "code",
114 "collapsed": false, 208 "collapsed": false,
115 "input": [], 209 "input": [],