{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Getting Started with MonoDAQ\n", "\n", "We will walk you through the basic usage of python API, like how to:\n", "\n", "1. setup channels, \n", "2. fetch values, \n", "3. plot it, \n", "4. add a math channel and \n", "5. run it as a real-time scope with a rising edge trigger.\n", "\n", "## Wiring\n", "\n", "In this demo we shall activate an analog, a digital one and a PWM channel, then wire the \n", "PWM output (from pin 4) back to the digital input (pin 1)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## 1. Setup Channels\n", "\n", "First we call the `reset()` function to begin from the start, then we configure the channels, and print out the configuration. The configuration could also be stored in a 1-wire memory attached to a connector that is automatically reloaded when the connector with such a memory is detected.\n", "\n", "When directly accessing the parameters, you may want to use the Parameters view of the IDM, which will help you browse through the device data structure." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "slideshow": { "slide_type": "-" } }, "outputs": [ { "data": { "text/html": [ "
pinfunctiontyperangerate [Hz]minmaxoffsetsetvalueunit
DI1 Digital Input TTL 5 V 100000 0 5 --- --- 5 V
2 Off --- --- --- --- --- --- --- ---
V1+ Voltage Input Single Ended 2V 50000 -0.1 2.0 --- --- 0.0397 V
PWM4 PWM TTL 5 V 1200 0.00 0.83 --- 0.25 --- ms
5 Off --- --- --- --- --- --- --- ---
6 Off --- --- --- --- --- --- --- ---
7 Off --- --- --- --- --- --- --- ---
8 Off --- --- --- --- --- --- --- ---
GND OneWire --- --- --- --- --- --- --- ---
IO --- --- --- --- --- --- --- --- ---
CUR+ Off --- --- --- --- --- --- --- ---
CUR- --- --- --- --- --- --- --- --- ---
GND --- --- --- --- --- --- --- --- ---
PWR Off --- --- --- --- --- --- --- ---

Ambient

Tcjc=25.9 ±0.2 oC RH=75 ±3 %
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from isotel.idm import monodaq, signal, gateway\n", "\n", "mdu = monodaq.MonoDAQ_U()\n", "mdu.reset()\n", "\n", "mdu['ch.function.function3'] = 'PWM'\n", "mdu['ch.rate.rate3'] = 1200\n", "mdu['ch.set.set3'] = 0.25\n", "\n", "mdu['ch.function.function0'] = 'Digital Input'\n", "mdu['ch.function.function2'] = 'Voltage Input'\n", "mdu['ch.rate.rate2'] = 50000\n", "\n", "mdu.wait4ready()\n", "mdu.print_setup()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Acquire Only\n", "\n", "The `MonoDAQ_U.fetch()` method is a python generator and fetches N samples from analog channels or digital ones if the analog channels are not active to return the **stream** of tuples organized as:\n", "\n", "- tuples of independent streams,\n", "- each stream holds time (x-axis) and the tuple of channels synchronous to the time (y-axis),\n", "\n", "For example: \n", "\n", "- `s[0][1][0]` means from stream0, channels, and select 0-th channel\n", "\n", "The generator provides meta information on the channels in the first line (row). In order to fetch the values, the generators need a sink, which loops over all the entries. In our example, we simply use the `list()` as the sink to display values.\n", "\n", "From the channel setup above, we can see that digital samples run twice as fast as analog ones. However since `N` primarily selects analog samples, the following example will put twice the number of digital samples compared to analog ones:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(('t [s]', ('V1+ [V]',)), ('t [s]', ('DI1 [V]',))),\n", " ((0.0, (0.13,)), (0.0, (1,))),\n", " ((None, (nan,)), (1e-05, (1,))),\n", " ((2e-05, (0.1275,)), (2e-05, (1,))),\n", " ((None, (nan,)), (3e-05, (1,))),\n", " ((4e-05, (0.1102,)), (4e-05, (1,)))]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list( mdu.fetch(N=3) )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Plot\n", "\n", "The `fetch()` method outputs a stream. To be able to plot it, the stream must be collected into a **signal**. A signal here means a dict sorted by channels, each having a pair of lists of equal size, providing Y samples and corresponding X time samples.\n", "\n", "To convert the generated output to a stream use the `signal.stream2signal()` method, which is a generator returning signals. \n", "\n", "By extending this example we get a nicely sorted dict; again we use the `list()` to display the results. We may again observe more digital samples than analog ones, however, the time axis fits together nicely:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'DI1 [V]': {'x': [0.0, 1e-05, 2e-05, 3e-05, 4e-05], 'y': [0, 0, 0, 0, 0]},\n", " 'V1+ [V]': {'x': [0.0, 2e-05, 4e-05], 'y': [0.0006, -0.0001, 0.0011]}}]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list( signal.stream2signal( mdu.fetch(3) ))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now to the plot, with the `signal.scope()` which iterates over signals provided by the `stream2signal()` method and returns last acquired signal as data. Let us increase the number of samples to get a nicer waveform." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(\"ac9c6e00-a34c-45d5-be00-8a7368735046\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n", " }\n", " finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };var element = document.getElementById(\"ac9c6e00-a34c-45d5-be00-8a7368735046\");\n", " if (element == null) {\n", " console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'ac9c6e00-a34c-45d5-be00-8a7368735046' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.13.0.min.js\"];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n", " }\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " var cell = $(document.getElementById(\"ac9c6e00-a34c-45d5-be00-8a7368735046\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(js_urls, function() {\n", " console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"ac9c6e00-a34c-45d5-be00-8a7368735046\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n }\n finally {\n delete root._bokeh_onload_callbacks\n }\n console.info(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(js_urls, callback) {\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = js_urls.length;\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var s = document.createElement('script');\n s.src = url;\n s.async = false;\n s.onreadystatechange = s.onload = function() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: all BokehJS libraries loaded\");\n run_callbacks()\n }\n };\n s.onerror = function() {\n console.warn(\"failed to load library \" + url);\n };\n console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n }\n };var element = document.getElementById(\"ac9c6e00-a34c-45d5-be00-8a7368735046\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'ac9c6e00-a34c-45d5-be00-8a7368735046' but no matching script tag was found. \")\n return false;\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.13.0.min.js\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n }\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"ac9c6e00-a34c-45d5-be00-8a7368735046\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(js_urls, function() {\n console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"4246e1a5-b2bd-4688-bbb5-c072ed305a77\":{\"roots\":{\"references\":[{\"attributes\":{\"background_fill_color\":{\"value\":\"white\"},\"below\":[{\"id\":\"f9faea41-390a-4c3d-bb39-3ae0f49d2d94\",\"type\":\"LinearAxis\"}],\"border_fill_color\":{\"value\":\"white\"},\"left\":[{\"id\":\"2a6c8ab3-ef6c-4ad6-9d3c-62570122e28a\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":700,\"renderers\":[{\"id\":\"f9faea41-390a-4c3d-bb39-3ae0f49d2d94\",\"type\":\"LinearAxis\"},{\"id\":\"417141d4-1a49-463d-b1c9-b9e05a50a445\",\"type\":\"Grid\"},{\"id\":\"2a6c8ab3-ef6c-4ad6-9d3c-62570122e28a\",\"type\":\"LinearAxis\"},{\"id\":\"5ce581b6-9956-4119-8a49-78e300fe8766\",\"type\":\"Grid\"},{\"id\":\"6f37ce68-121e-4b59-a216-dc4717a0f325\",\"type\":\"BoxAnnotation\"},{\"id\":\"7ddfefd4-71c6-4788-a2ed-715e99f3680f\",\"type\":\"Legend\"},{\"id\":\"ec90755d-1dfe-43c6-a858-5bd495d86dbb\",\"type\":\"GlyphRenderer\"},{\"id\":\"66db0d87-8c30-447d-81b4-1ca17416cb07\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"83c7489a-3487-44c2-9577-193ff82821f1\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"58705a7a-15e4-46d5-939e-f7988998c10e\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"3b75ca50-3493-4d4b-b233-4a8c268a9378\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"0ac7df18-4234-4dd4-a3db-81db46fdea2b\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"22123782-89b5-4e25-9125-ec72e6e91787\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"41bdfb66-86ac-4d15-a758-e9e63381bcd3\",\"type\":\"LinearScale\"}},\"id\":\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"3b75ca50-3493-4d4b-b233-4a8c268a9378\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"22123782-89b5-4e25-9125-ec72e6e91787\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"0ac7df18-4234-4dd4-a3db-81db46fdea2b\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"41bdfb66-86ac-4d15-a758-e9e63381bcd3\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"text\":\"First Plot\"},\"id\":\"83c7489a-3487-44c2-9577-193ff82821f1\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"s\",\"formatter\":{\"id\":\"127d4cbd-b6bd-4e22-a8d9-b97ca73fd49f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0ef743f5-1b7c-4df7-90f9-7364ebb20a94\",\"type\":\"BasicTicker\"}},\"id\":\"f9faea41-390a-4c3d-bb39-3ae0f49d2d94\",\"type\":\"LinearAxis\"},{\"attributes\":{\"grid_line_color\":{\"value\":\"lightgray\"},\"plot\":{\"id\":\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0ef743f5-1b7c-4df7-90f9-7364ebb20a94\",\"type\":\"BasicTicker\"}},\"id\":\"417141d4-1a49-463d-b1c9-b9e05a50a445\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"3348cb3c-3fea-4481-8c84-e361e1ffb6a9\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"fa2871f6-b962-404b-b53f-3fb0e0b9b399\",\"type\":\"BasicTicker\"}},\"id\":\"2a6c8ab3-ef6c-4ad6-9d3c-62570122e28a\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":{\"value\":\"lightgray\"},\"plot\":{\"id\":\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"fa2871f6-b962-404b-b53f-3fb0e0b9b399\",\"type\":\"BasicTicker\"}},\"id\":\"5ce581b6-9956-4119-8a49-78e300fe8766\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"6f37ce68-121e-4b59-a216-dc4717a0f325\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"items\":[{\"id\":\"300bf73b-2fd2-44f9-bc97-acc8ed59b3db\",\"type\":\"LegendItem\"},{\"id\":\"dac0df9f-5a0e-44af-b33c-207b31b3092f\",\"type\":\"LegendItem\"}],\"plot\":{\"id\":\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"7ddfefd4-71c6-4788-a2ed-715e99f3680f\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"56d86d15-fc93-4651-9825-2909cc0a133e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"55479fe3-5cdf-4741-8426-08426d6b78a3\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"dce4f352-8926-4f5a-a626-574a2151d198\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"ebb985a7-9c25-4e22-9f3b-4108b1475ca4\",\"type\":\"CDSView\"}},\"id\":\"ec90755d-1dfe-43c6-a858-5bd495d86dbb\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"3a510288-23ab-49b4-a1e9-6632c775d553\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e10cb273-ed14-4d8f-b60f-282d9acb9e7e\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6ddeeadc-26fc-4eb2-84c4-c5ecfd53b635\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"7eca0288-4ad0-4abe-bde0-51eeadf05590\",\"type\":\"CDSView\"}},\"id\":\"66db0d87-8c30-447d-81b4-1ca17416cb07\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"554b1aa6-8fba-4404-97c5-cf07d78023e8\",\"type\":\"PanTool\"},{\"id\":\"30a11435-a66e-4089-862f-9dcd516d078f\",\"type\":\"CrosshairTool\"},{\"id\":\"07e26f05-4e93-4ffb-af29-1a54d9fccc6f\",\"type\":\"BoxZoomTool\"},{\"id\":\"872feb50-3924-4813-83d5-ec6424f209b4\",\"type\":\"ResetTool\"},{\"id\":\"21f20fd5-36da-4ffd-8f2b-f62cdd947764\",\"type\":\"SaveTool\"},{\"id\":\"cb994afb-a88c-4228-86d2-c5e43f5983ae\",\"type\":\"WheelZoomTool\"},{\"id\":\"0dff3025-c2c6-4efb-a1da-1e5939b030fb\",\"type\":\"HoverTool\"}]},\"id\":\"58705a7a-15e4-46d5-939e-f7988998c10e\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"0ef743f5-1b7c-4df7-90f9-7364ebb20a94\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"127d4cbd-b6bd-4e22-a8d9-b97ca73fd49f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"fa2871f6-b962-404b-b53f-3fb0e0b9b399\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"3348cb3c-3fea-4481-8c84-e361e1ffb6a9\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"V1+ [V]\"},\"renderers\":[{\"id\":\"ec90755d-1dfe-43c6-a858-5bd495d86dbb\",\"type\":\"GlyphRenderer\"}]},\"id\":\"300bf73b-2fd2-44f9-bc97-acc8ed59b3db\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"DI1 [V]\"},\"renderers\":[{\"id\":\"66db0d87-8c30-447d-81b4-1ca17416cb07\",\"type\":\"GlyphRenderer\"}]},\"id\":\"dac0df9f-5a0e-44af-b33c-207b31b3092f\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0.0,2e-05,4e-05,6e-05,8e-05,0.0001,0.00012,0.00014,0.00016,0.00018,0.0002,0.00022,0.00024,0.00026,0.00028,0.0003,0.00032,0.00034,0.00036,0.00038,0.0004,0.00042,0.00044,0.00046,0.00048,0.0005,0.00052,0.00054,0.00056,0.00058,0.0006,0.00062,0.00064,0.00066,0.00068,0.0007,0.00072,0.00074,0.00076,0.00078,0.0008,0.00082,0.00084,0.00086,0.00088,0.0009,0.00092,0.00094,0.00096,0.00098,0.001,0.00102,0.00104,0.00106,0.00108,0.0011,0.00112,0.00114,0.00116,0.00118,0.0012,0.00122,0.00124,0.00126,0.00128,0.0013,0.00132,0.00134,0.00136,0.00138,0.0014,0.00142,0.00144,0.00146,0.00148,0.0015,0.00152,0.00154,0.00156,0.00158,0.0016,0.00162,0.00164,0.00166,0.00168,0.0017,0.00172,0.00174,0.00176,0.00178,0.0018,0.00182,0.00184,0.00186,0.00188,0.0019,0.00192,0.00194,0.00196,0.00198],\"y\":[-0.003,0.0013,-0.0041,0.0044,-0.0083,0.1094,0.1987,0.1754,0.1765,0.1604,0.1572,0.1426,0.137,0.1227,0.1181,0.103,0.1026,0.0561,-0.0621,-0.0472,-0.0347,-0.0253,-0.0208,-0.0157,-0.013,-0.0093,-0.007,-0.0055,-0.0047,-0.0037,-0.0033,-0.0029,-0.0029,-0.0025,-0.0018,-0.0018,-0.002,-0.0017,-0.0017,-0.0016,-0.0016,-0.0015,-0.0013,-0.0013,-0.0009,-0.0025,0.0133,0.1605,0.193,0.1786,0.1765,0.1639,0.1591,0.1458,0.1412,0.1269,0.125,0.1063,0.1114,0.0146,-0.0682,-0.0355,-0.0337,-0.0205,-0.0204,-0.0133,-0.0133,-0.0088,-0.0089,-0.0061,-0.0063,-0.0049,-0.0042,-0.0033,-0.0025,-0.0021,-0.0013,-0.0017,-0.0009,-0.0018,-0.0001,-0.0015,0.001,-0.0021,0.0021,-0.0033,0.0047,-0.0099,0.0626,0.1937,0.1819,0.1803,0.1666,0.1602,0.1486,0.1401,0.1292,0.1207,0.1135,0.1036]},\"selected\":{\"id\":\"15b8e7a1-b5e5-47a6-8be0-dca61b59ca38\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"dda65dbb-31ce-4635-a1f7-0728f29d6d9c\",\"type\":\"UnionRenderers\"}},\"id\":\"56d86d15-fc93-4651-9825-2909cc0a133e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"56d86d15-fc93-4651-9825-2909cc0a133e\",\"type\":\"ColumnDataSource\"}},\"id\":\"ebb985a7-9c25-4e22-9f3b-4108b1475ca4\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"blue\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"55479fe3-5cdf-4741-8426-08426d6b78a3\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"dce4f352-8926-4f5a-a626-574a2151d198\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0.0,1e-05,2e-05,3e-05,4e-05,5e-05,6e-05,7e-05,8e-05,9e-05,0.0001,0.00011,0.00012,0.00013,0.00014,0.00015,0.00016,0.00017,0.00018,0.00019,0.0002,0.00021,0.00022,0.00023,0.00024,0.00025,0.00026,0.00027,0.00028,0.00029,0.0003,0.00031,0.00032,0.00033,0.00034,0.00035,0.00036,0.00037,0.00038,0.00039,0.0004,0.00041,0.00042,0.00043,0.00044,0.00045,0.00046,0.00047,0.00048,0.00049,0.0005,0.00051,0.00052,0.00053,0.00054,0.00055,0.00056,0.00057,0.00058,0.00059,0.0006,0.00061,0.00062,0.00063,0.00064,0.00065,0.00066,0.00067,0.00068,0.00069,0.0007,0.00071,0.00072,0.00073,0.00074,0.00075,0.00076,0.00077,0.00078,0.00079,0.0008,0.00081,0.00082,0.00083,0.00084,0.00085,0.00086,0.00087,0.00088,0.00089,0.0009,0.00091,0.00092,0.00093,0.00094,0.00095,0.00096,0.00097,0.00098,0.00099,0.001,0.00101,0.00102,0.00103,0.00104,0.00105,0.00106,0.00107,0.00108,0.00109,0.0011,0.00111,0.00112,0.00113,0.00114,0.00115,0.00116,0.00117,0.00118,0.00119,0.0012,0.00121,0.00122,0.00123,0.00124,0.00125,0.00126,0.00127,0.00128,0.00129,0.0013,0.00131,0.00132,0.00133,0.00134,0.00135,0.00136,0.00137,0.00138,0.00139,0.0014,0.00141,0.00142,0.00143,0.00144,0.00145,0.00146,0.00147,0.00148,0.00149,0.0015,0.00151,0.00152,0.00153,0.00154,0.00155,0.00156,0.00157,0.00158,0.00159,0.0016,0.00161,0.00162,0.00163,0.00164,0.00165,0.00166,0.00167,0.00168,0.00169,0.0017,0.00171,0.00172,0.00173,0.00174,0.00175,0.00176,0.00177,0.00178,0.00179,0.0018,0.00181,0.00182,0.00183,0.00184,0.00185,0.00186,0.00187,0.00188,0.00189,0.0019,0.00191,0.00192,0.00193,0.00194,0.00195,0.00196,0.00197,0.00198],\"y\":[0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]},\"selected\":{\"id\":\"2156a127-73b9-47ff-9cf4-bb87ccea3e19\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"2c5024f0-96cb-4a5e-aed6-14fe60cdde51\",\"type\":\"UnionRenderers\"}},\"id\":\"3a510288-23ab-49b4-a1e9-6632c775d553\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"3a510288-23ab-49b4-a1e9-6632c775d553\",\"type\":\"ColumnDataSource\"}},\"id\":\"7eca0288-4ad0-4abe-bde0-51eeadf05590\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"magenta\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e10cb273-ed14-4d8f-b60f-282d9acb9e7e\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6ddeeadc-26fc-4eb2-84c4-c5ecfd53b635\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"554b1aa6-8fba-4404-97c5-cf07d78023e8\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"30a11435-a66e-4089-862f-9dcd516d078f\",\"type\":\"CrosshairTool\"},{\"attributes\":{\"overlay\":{\"id\":\"6f37ce68-121e-4b59-a216-dc4717a0f325\",\"type\":\"BoxAnnotation\"}},\"id\":\"07e26f05-4e93-4ffb-af29-1a54d9fccc6f\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"872feb50-3924-4813-83d5-ec6424f209b4\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"21f20fd5-36da-4ffd-8f2b-f62cdd947764\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"cb994afb-a88c-4228-86d2-c5e43f5983ae\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"renderers\":\"auto\"},\"id\":\"0dff3025-c2c6-4efb-a1da-1e5939b030fb\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"dda65dbb-31ce-4635-a1f7-0728f29d6d9c\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"15b8e7a1-b5e5-47a6-8be0-dca61b59ca38\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2c5024f0-96cb-4a5e-aed6-14fe60cdde51\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2156a127-73b9-47ff-9cf4-bb87ccea3e19\",\"type\":\"Selection\"}],\"root_ids\":[\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\"]},\"title\":\"Bokeh Application\",\"version\":\"0.13.0\"}};\n", " var render_items = [{\"docid\":\"4246e1a5-b2bd-4688-bbb5-c072ed305a77\",\"notebook_comms_target\":\"ed065cf4-1d68-4b18-84ee-ec3c485c8ecf\",\"roots\":{\"6a5d646d-669d-4a57-a1a9-3574eae3a80a\":\"178f7aff-651b-4a42-b68a-1634a08f39fb\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\")\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "6a5d646d-669d-4a57-a1a9-3574eae3a80a" } }, "output_type": "display_data" } ], "source": [ "signal.scope( signal.stream2signal( mdu.fetch(100) ), title = 'First Plot');" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4. Adding a Math Channel\n", "\n", "It would be a pity not to be able to perform a real-time analysis or computation on data in python.\n", "We mute the first `V1+ [V]` channel and change the colors of the other two. You may freely enter\n", "an equation with channel names with big capital letters, and only up to the + sign or space." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(\"2a4dae30-203a-42a7-ac4e-131273bf3903\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n", " }\n", " finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };var element = document.getElementById(\"2a4dae30-203a-42a7-ac4e-131273bf3903\");\n", " if (element == null) {\n", " console.log(\"Bokeh: ERROR: autoload.js configured with elementid '2a4dae30-203a-42a7-ac4e-131273bf3903' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.13.0.min.js\"];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n", " }\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " var cell = $(document.getElementById(\"2a4dae30-203a-42a7-ac4e-131273bf3903\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(js_urls, function() {\n", " console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"2a4dae30-203a-42a7-ac4e-131273bf3903\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n }\n finally {\n delete root._bokeh_onload_callbacks\n }\n console.info(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(js_urls, callback) {\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = js_urls.length;\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var s = document.createElement('script');\n s.src = url;\n s.async = false;\n s.onreadystatechange = s.onload = function() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: all BokehJS libraries loaded\");\n run_callbacks()\n }\n };\n s.onerror = function() {\n console.warn(\"failed to load library \" + url);\n };\n console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n }\n };var element = document.getElementById(\"2a4dae30-203a-42a7-ac4e-131273bf3903\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid '2a4dae30-203a-42a7-ac4e-131273bf3903' but no matching script tag was found. \")\n return false;\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.13.0.min.js\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n }\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"2a4dae30-203a-42a7-ac4e-131273bf3903\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(js_urls, function() {\n console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"5cc53eae-b57e-47d6-bcf9-df94084fb541\":{\"roots\":{\"references\":[{\"attributes\":{\"background_fill_color\":{\"value\":\"white\"},\"below\":[{\"id\":\"8fb35a4c-dd61-46f3-bdcc-ed3ed094bf73\",\"type\":\"LinearAxis\"}],\"border_fill_color\":{\"value\":\"white\"},\"left\":[{\"id\":\"bcf47d38-fc4b-4894-a15e-83a68ac91013\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":700,\"renderers\":[{\"id\":\"8fb35a4c-dd61-46f3-bdcc-ed3ed094bf73\",\"type\":\"LinearAxis\"},{\"id\":\"c45139d0-daf8-47ea-9e72-01df881291f3\",\"type\":\"Grid\"},{\"id\":\"bcf47d38-fc4b-4894-a15e-83a68ac91013\",\"type\":\"LinearAxis\"},{\"id\":\"4a30ebe5-ad1e-4324-bf2b-a69a50276137\",\"type\":\"Grid\"},{\"id\":\"96248975-12e4-42e0-b01c-767e3e80e40f\",\"type\":\"BoxAnnotation\"},{\"id\":\"9be1d125-85ff-44e9-961e-5731b686ec97\",\"type\":\"Legend\"},{\"id\":\"84549da6-5434-4b4e-9b05-f330dc63deb2\",\"type\":\"GlyphRenderer\"},{\"id\":\"8fb658d9-022a-488b-933c-00cc527dfafe\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"6ae382e1-b5e1-4afd-b926-e1db0b72f46a\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1daedab7-20cc-4d60-9e75-17595edf47dd\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"8491f72e-db28-44dc-b3c8-077001c35423\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"e7788909-1243-4c6b-b79d-496a0fbbed2c\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"9c0e8787-d11f-4eff-bad8-592b73959a4d\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"27595a7d-5e06-47bb-9f03-ec386daebdf6\",\"type\":\"LinearScale\"}},\"id\":\"29efd975-f383-4637-958b-f576217e375f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"8491f72e-db28-44dc-b3c8-077001c35423\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"9c0e8787-d11f-4eff-bad8-592b73959a4d\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"e7788909-1243-4c6b-b79d-496a0fbbed2c\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"27595a7d-5e06-47bb-9f03-ec386daebdf6\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"text\":\"First Plot with Math Channel\"},\"id\":\"6ae382e1-b5e1-4afd-b926-e1db0b72f46a\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"s\",\"formatter\":{\"id\":\"4c96d902-6cf8-4119-a60f-671340998ca2\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"29efd975-f383-4637-958b-f576217e375f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f4f96c3c-91ea-4d6c-9b13-e5c01e68169b\",\"type\":\"BasicTicker\"}},\"id\":\"8fb35a4c-dd61-46f3-bdcc-ed3ed094bf73\",\"type\":\"LinearAxis\"},{\"attributes\":{\"grid_line_color\":{\"value\":\"lightgray\"},\"plot\":{\"id\":\"29efd975-f383-4637-958b-f576217e375f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f4f96c3c-91ea-4d6c-9b13-e5c01e68169b\",\"type\":\"BasicTicker\"}},\"id\":\"c45139d0-daf8-47ea-9e72-01df881291f3\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"cb1a171e-8cca-4274-b8dc-fc4ec4022026\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"29efd975-f383-4637-958b-f576217e375f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"23b5f155-a86a-49dc-8baf-30d77f76e1f9\",\"type\":\"BasicTicker\"}},\"id\":\"bcf47d38-fc4b-4894-a15e-83a68ac91013\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":{\"value\":\"lightgray\"},\"plot\":{\"id\":\"29efd975-f383-4637-958b-f576217e375f\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"23b5f155-a86a-49dc-8baf-30d77f76e1f9\",\"type\":\"BasicTicker\"}},\"id\":\"4a30ebe5-ad1e-4324-bf2b-a69a50276137\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"96248975-12e4-42e0-b01c-767e3e80e40f\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"items\":[{\"id\":\"df5b738f-4858-4659-96ab-e9c0bbdfb884\",\"type\":\"LegendItem\"},{\"id\":\"8eab1c99-e3f5-490d-903e-2084a3b0753c\",\"type\":\"LegendItem\"}],\"plot\":{\"id\":\"29efd975-f383-4637-958b-f576217e375f\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"9be1d125-85ff-44e9-961e-5731b686ec97\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"72a9372c-fe91-4338-ba1e-205dbf346522\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"04b228be-54a5-44f2-a633-6af0ff7d0eb8\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"b75b8754-d91c-421a-9fda-6e29278f66d2\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"4f373626-7085-4dc3-9fc8-0e9806da0d01\",\"type\":\"CDSView\"}},\"id\":\"84549da6-5434-4b4e-9b05-f330dc63deb2\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"138b0384-a29a-4e86-8f34-5fa1ee381e00\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c8eb7f21-75bd-4d56-96db-b201ad1c7e0e\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7da23b5a-f37e-4107-a321-7a059154a282\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"6617735d-3db6-48fb-bc58-5d2e5b862947\",\"type\":\"CDSView\"}},\"id\":\"8fb658d9-022a-488b-933c-00cc527dfafe\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"dc3875b2-81fb-4597-b1a1-07e9ec62bb63\",\"type\":\"PanTool\"},{\"id\":\"fb56922f-86a6-43af-a5cb-ec3590ab4e7f\",\"type\":\"CrosshairTool\"},{\"id\":\"e42d67ac-f5b8-4ec8-b79f-71cfbac08ae4\",\"type\":\"BoxZoomTool\"},{\"id\":\"5f183d3e-4e61-4253-bb0c-06a37c82ccce\",\"type\":\"ResetTool\"},{\"id\":\"f16b5527-9ffb-4e63-b5e2-240f0c3ba8a8\",\"type\":\"SaveTool\"},{\"id\":\"49abfc12-546b-4a71-a45b-e37efb1124f5\",\"type\":\"WheelZoomTool\"},{\"id\":\"bd92e597-ce6c-45ee-ad29-e29cd4afad66\",\"type\":\"HoverTool\"}]},\"id\":\"1daedab7-20cc-4d60-9e75-17595edf47dd\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"f4f96c3c-91ea-4d6c-9b13-e5c01e68169b\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4c96d902-6cf8-4119-a60f-671340998ca2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"23b5f155-a86a-49dc-8baf-30d77f76e1f9\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"cb1a171e-8cca-4274-b8dc-fc4ec4022026\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"DI1 [V]\"},\"renderers\":[{\"id\":\"84549da6-5434-4b4e-9b05-f330dc63deb2\",\"type\":\"GlyphRenderer\"}]},\"id\":\"df5b738f-4858-4659-96ab-e9c0bbdfb884\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"Masked [V]\"},\"renderers\":[{\"id\":\"8fb658d9-022a-488b-933c-00cc527dfafe\",\"type\":\"GlyphRenderer\"}]},\"id\":\"8eab1c99-e3f5-490d-903e-2084a3b0753c\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[2e-05,4e-05,6e-05,8e-05,0.0001,0.00012,0.00014,0.00016,0.00018,0.0002,0.00022,0.00024,0.00026,0.00028,0.0003,0.00032,0.00034,0.00036,0.00038,0.0004,0.00042,0.00044,0.00046,0.00048,0.0005,0.00052,0.00054,0.00056,0.00058,0.0006,0.00062,0.00064,0.00066,0.00068,0.0007,0.00072,0.00074,0.00076,0.00078,0.0008,0.00082,0.00084,0.00086,0.00088,0.0009,0.00092,0.00094,0.00096,0.00098,0.001,0.00102,0.00104,0.00106,0.00108,0.0011,0.00112,0.00114,0.00116,0.00118,0.0012,0.00122,0.00124,0.00126,0.00128,0.0013,0.00132,0.00134,0.00136,0.00138,0.0014,0.00142,0.00144,0.00146,0.00148,0.0015,0.00152,0.00154,0.00156,0.00158,0.0016,0.00162,0.00164,0.00166,0.00168,0.0017,0.00172,0.00174,0.00176,0.00178,0.0018,0.00182,0.00184,0.00186,0.00188,0.0019,0.00192,0.00194,0.00196,0.00198],\"y\":[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1]},\"selected\":{\"id\":\"5608cf31-a549-4410-9b60-464e25cb5d25\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"975d33d6-5ebe-4f14-b46e-9748e0a518af\",\"type\":\"UnionRenderers\"}},\"id\":\"72a9372c-fe91-4338-ba1e-205dbf346522\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"72a9372c-fe91-4338-ba1e-205dbf346522\",\"type\":\"ColumnDataSource\"}},\"id\":\"4f373626-7085-4dc3-9fc8-0e9806da0d01\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"darkgreen\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"04b228be-54a5-44f2-a633-6af0ff7d0eb8\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"b75b8754-d91c-421a-9fda-6e29278f66d2\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[2e-05,4e-05,6e-05,8e-05,0.0001,0.00012,0.00014,0.00016,0.00018,0.0002,0.00022,0.00024,0.00026,0.00028,0.0003,0.00032,0.00034,0.00036,0.00038,0.0004,0.00042,0.00044,0.00046,0.00048,0.0005,0.00052,0.00054,0.00056,0.00058,0.0006,0.00062,0.00064,0.00066,0.00068,0.0007,0.00072,0.00074,0.00076,0.00078,0.0008,0.00082,0.00084,0.00086,0.00088,0.0009,0.00092,0.00094,0.00096,0.00098,0.001,0.00102,0.00104,0.00106,0.00108,0.0011,0.00112,0.00114,0.00116,0.00118,0.0012,0.00122,0.00124,0.00126,0.00128,0.0013,0.00132,0.00134,0.00136,0.00138,0.0014,0.00142,0.00144,0.00146,0.00148,0.0015,0.00152,0.00154,0.00156,0.00158,0.0016,0.00162,0.00164,0.00166,0.00168,0.0017,0.00172,0.00174,0.00176,0.00178,0.0018,0.00182,0.00184,0.00186,0.00188,0.0019,0.00192,0.00194,0.00196,0.00198],\"y\":[0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,-0.0,0.46499999999999997,1.0050000000000001,0.9045000000000001,0.912,0.8345,0.817,0.752,0.7230000000000001,0.663,0.6320000000000001,0.5695,0.5489999999999999,0.38899999999999996,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.752,1.0030000000000001,0.912,0.916,0.8494999999999999,0.8340000000000001,0.7689999999999999,0.752,0.6805,0.6725000000000001,0.578,0.609,0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.949,0.9410000000000001,0.9239999999999999,0.8805000000000001]},\"selected\":{\"id\":\"cacb0c2b-f6e1-490e-ac42-74c1b1c6f4b5\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"a7e09762-d040-44fe-b5a5-722dd6ec6aa9\",\"type\":\"UnionRenderers\"}},\"id\":\"138b0384-a29a-4e86-8f34-5fa1ee381e00\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"138b0384-a29a-4e86-8f34-5fa1ee381e00\",\"type\":\"ColumnDataSource\"}},\"id\":\"6617735d-3db6-48fb-bc58-5d2e5b862947\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"darkorange\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c8eb7f21-75bd-4d56-96db-b201ad1c7e0e\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7da23b5a-f37e-4107-a321-7a059154a282\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"dc3875b2-81fb-4597-b1a1-07e9ec62bb63\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"fb56922f-86a6-43af-a5cb-ec3590ab4e7f\",\"type\":\"CrosshairTool\"},{\"attributes\":{\"overlay\":{\"id\":\"96248975-12e4-42e0-b01c-767e3e80e40f\",\"type\":\"BoxAnnotation\"}},\"id\":\"e42d67ac-f5b8-4ec8-b79f-71cfbac08ae4\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"5f183d3e-4e61-4253-bb0c-06a37c82ccce\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"f16b5527-9ffb-4e63-b5e2-240f0c3ba8a8\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"49abfc12-546b-4a71-a45b-e37efb1124f5\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"renderers\":\"auto\"},\"id\":\"bd92e597-ce6c-45ee-ad29-e29cd4afad66\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"975d33d6-5ebe-4f14-b46e-9748e0a518af\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"5608cf31-a549-4410-9b60-464e25cb5d25\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"a7e09762-d040-44fe-b5a5-722dd6ec6aa9\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"cacb0c2b-f6e1-490e-ac42-74c1b1c6f4b5\",\"type\":\"Selection\"}],\"root_ids\":[\"29efd975-f383-4637-958b-f576217e375f\"]},\"title\":\"Bokeh Application\",\"version\":\"0.13.0\"}};\n", " var render_items = [{\"docid\":\"5cc53eae-b57e-47d6-bcf9-df94084fb541\",\"notebook_comms_target\":\"7c486e3a-3abf-4c48-90c7-cb10db99af99\",\"roots\":{\"29efd975-f383-4637-958b-f576217e375f\":\"4b4326e5-07df-44fe-9b7c-411716509ad2\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\")\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "29efd975-f383-4637-958b-f576217e375f" } }, "output_type": "display_data" } ], "source": [ "signal.scope(\n", " signal.stream2signal(\n", " signal.addmath( mdu.fetch(100), 'Masked [V]', expr = '5*V1*DI1'),\n", " ), title = 'First Plot with Math Channel', colors = [ None, 'darkgreen', 'darkorange']);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5. Real-time Scope\n", "\n", "Real-time updates require that a larger continuous stream of samples is fetched from the MonoDAQ. We achieve that by providing `fetch(2000000)` a sufficiently big number to run for some more time.\n", "\n", "To display the intermediate collected samples, we need to instruct the `stream2signal()` a `split` parameter with a number of samples to be displayed in one shot. Note that `fetch()` refers to analog samples and there may be a significantly larger number of digital samples at the output. In addition if you want, you can reset the time and start at zero each time a shot is made. Then you should set the `relative_time` to True.\n", "\n", "And last, we introduce a rising edge trigger function `signal.trigger`, which evaluates:\n", "\n", "- The precondition that must be met in order to search for a\n", "- trigger condition.\n", "- Trigger is set a `single_shot` mode by default.\n", "\n", "The example below shows how to wait for a rising edge on the `DI1` digital channel by specifying both the pre-condition and the condition. When the condition triggers, `P` pre-buffered samples are yielded and then continues for the remaining `N` samples." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(\"dd1bbe1f-8c1d-4e55-a18c-ad67177d7504\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n", " }\n", " finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };var element = document.getElementById(\"dd1bbe1f-8c1d-4e55-a18c-ad67177d7504\");\n", " if (element == null) {\n", " console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'dd1bbe1f-8c1d-4e55-a18c-ad67177d7504' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.13.0.min.js\"];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n", " }\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " var cell = $(document.getElementById(\"dd1bbe1f-8c1d-4e55-a18c-ad67177d7504\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(js_urls, function() {\n", " console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"dd1bbe1f-8c1d-4e55-a18c-ad67177d7504\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n }\n finally {\n delete root._bokeh_onload_callbacks\n }\n console.info(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(js_urls, callback) {\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = js_urls.length;\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var s = document.createElement('script');\n s.src = url;\n s.async = false;\n s.onreadystatechange = s.onload = function() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: all BokehJS libraries loaded\");\n run_callbacks()\n }\n };\n s.onerror = function() {\n console.warn(\"failed to load library \" + url);\n };\n console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n }\n };var element = document.getElementById(\"dd1bbe1f-8c1d-4e55-a18c-ad67177d7504\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'dd1bbe1f-8c1d-4e55-a18c-ad67177d7504' but no matching script tag was found. \")\n return false;\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.13.0.min.js\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.13.0.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.13.0.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.13.0.min.css\");\n }\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"dd1bbe1f-8c1d-4e55-a18c-ad67177d7504\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(js_urls, function() {\n console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"fa291401-4b92-44a4-8fd5-80b22371a433\":{\"roots\":{\"references\":[{\"attributes\":{\"background_fill_color\":{\"value\":\"white\"},\"below\":[{\"id\":\"eb2f5733-221e-4578-902c-2131fec799a7\",\"type\":\"LinearAxis\"}],\"border_fill_color\":{\"value\":\"white\"},\"left\":[{\"id\":\"e90f1bcf-e2e6-41bc-9545-fe69efa0ce20\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":700,\"renderers\":[{\"id\":\"eb2f5733-221e-4578-902c-2131fec799a7\",\"type\":\"LinearAxis\"},{\"id\":\"fd1d91fb-ea07-4c7b-9be9-155e48d1dd2d\",\"type\":\"Grid\"},{\"id\":\"e90f1bcf-e2e6-41bc-9545-fe69efa0ce20\",\"type\":\"LinearAxis\"},{\"id\":\"059283c3-6d11-4ac4-b7f3-a493f7ede289\",\"type\":\"Grid\"},{\"id\":\"f918bf36-2b9d-41a5-ad9c-a3c2064cf521\",\"type\":\"BoxAnnotation\"},{\"id\":\"0c702b2a-9f49-4361-af91-15542a2efc46\",\"type\":\"Legend\"},{\"id\":\"a36c906d-b735-4c27-a5b6-d2f8874dd71a\",\"type\":\"GlyphRenderer\"},{\"id\":\"380a8774-0123-4de2-af10-d9194bc35d93\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"5aa10b09-6ceb-4530-8b0b-b91686ee1edf\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"889b01ae-74f6-45f9-9823-fa9dbb0295af\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1ae0c94f-58ce-4a00-bd16-d3f033f3f124\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"18032143-e87f-4254-a569-29dbba82986b\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"24cfa65c-b07a-4315-bf9b-5e5e4239cd61\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"35cd2976-17ca-46cb-b2d1-939f05dd0b25\",\"type\":\"LinearScale\"}},\"id\":\"978235aa-ba95-4a7f-83d1-761886b6fb6b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"1ae0c94f-58ce-4a00-bd16-d3f033f3f124\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"end\":1.1,\"start\":-0.1},\"id\":\"24cfa65c-b07a-4315-bf9b-5e5e4239cd61\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"18032143-e87f-4254-a569-29dbba82986b\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"35cd2976-17ca-46cb-b2d1-939f05dd0b25\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"text\":\"Continous Mode - Rising Edge Trigger\"},\"id\":\"5aa10b09-6ceb-4530-8b0b-b91686ee1edf\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"s\",\"formatter\":{\"id\":\"97e46d28-b79b-47a6-9938-d592261c4978\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"978235aa-ba95-4a7f-83d1-761886b6fb6b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d9b2fd2f-1f44-45eb-bb8d-9256885c469f\",\"type\":\"BasicTicker\"}},\"id\":\"eb2f5733-221e-4578-902c-2131fec799a7\",\"type\":\"LinearAxis\"},{\"attributes\":{\"grid_line_color\":{\"value\":\"lightgray\"},\"plot\":{\"id\":\"978235aa-ba95-4a7f-83d1-761886b6fb6b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d9b2fd2f-1f44-45eb-bb8d-9256885c469f\",\"type\":\"BasicTicker\"}},\"id\":\"fd1d91fb-ea07-4c7b-9be9-155e48d1dd2d\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"708aba71-3c0a-4f3b-8b95-1ad7974fb6af\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"978235aa-ba95-4a7f-83d1-761886b6fb6b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7d31f710-63d4-491d-a391-d3a539297023\",\"type\":\"BasicTicker\"}},\"id\":\"e90f1bcf-e2e6-41bc-9545-fe69efa0ce20\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":{\"value\":\"lightgray\"},\"plot\":{\"id\":\"978235aa-ba95-4a7f-83d1-761886b6fb6b\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7d31f710-63d4-491d-a391-d3a539297023\",\"type\":\"BasicTicker\"}},\"id\":\"059283c3-6d11-4ac4-b7f3-a493f7ede289\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"f918bf36-2b9d-41a5-ad9c-a3c2064cf521\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"items\":[{\"id\":\"bd0d1bf3-1d08-4903-9f15-d236f05149a3\",\"type\":\"LegendItem\"},{\"id\":\"69326e1e-6175-4de6-bd93-c98069de315d\",\"type\":\"LegendItem\"}],\"plot\":{\"id\":\"978235aa-ba95-4a7f-83d1-761886b6fb6b\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"0c702b2a-9f49-4361-af91-15542a2efc46\",\"type\":\"Legend\"},{\"attributes\":{\"data_source\":{\"id\":\"2f616147-355c-48f6-bfcc-0816567e74ae\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c2484f5a-9ef6-4a35-a919-adeb8c2becfb\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"e0aa4054-c8a0-46aa-9b96-92b9856a2a5b\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"585132a3-0efc-49af-b4ac-fc1b1427679a\",\"type\":\"CDSView\"}},\"id\":\"a36c906d-b735-4c27-a5b6-d2f8874dd71a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"18be4fb0-1050-4b6e-9483-658d07edaa71\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2bd0f779-f421-44f9-b840-8241b0e149ef\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"d3ced549-4d91-4ab5-984d-f9dfaaef615b\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"2854c9a3-4bd2-46f2-abac-d989aae29a25\",\"type\":\"CDSView\"}},\"id\":\"380a8774-0123-4de2-af10-d9194bc35d93\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"698cda47-0023-4c84-804f-0061f11e4e95\",\"type\":\"PanTool\"},{\"id\":\"f548edb9-3290-4d8a-bc87-4993066fa187\",\"type\":\"CrosshairTool\"},{\"id\":\"48e5e558-c707-4ec3-b0c0-31610d08d98f\",\"type\":\"BoxZoomTool\"},{\"id\":\"77775770-70e2-429f-827e-ea8fd066c463\",\"type\":\"ResetTool\"},{\"id\":\"0c18c893-dc77-4d8b-ba9c-a847a170df7c\",\"type\":\"SaveTool\"},{\"id\":\"66fc89e7-8bea-4816-b565-72972a41e086\",\"type\":\"WheelZoomTool\"},{\"id\":\"ea7f1d32-27ba-46c8-abe8-a42fd9404d9c\",\"type\":\"HoverTool\"}]},\"id\":\"889b01ae-74f6-45f9-9823-fa9dbb0295af\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"d9b2fd2f-1f44-45eb-bb8d-9256885c469f\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"97e46d28-b79b-47a6-9938-d592261c4978\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"7d31f710-63d4-491d-a391-d3a539297023\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"708aba71-3c0a-4f3b-8b95-1ad7974fb6af\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"V1+ [V]\"},\"renderers\":[{\"id\":\"a36c906d-b735-4c27-a5b6-d2f8874dd71a\",\"type\":\"GlyphRenderer\"}]},\"id\":\"bd0d1bf3-1d08-4903-9f15-d236f05149a3\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"DI1 [V]\"},\"renderers\":[{\"id\":\"380a8774-0123-4de2-af10-d9194bc35d93\",\"type\":\"GlyphRenderer\"}]},\"id\":\"69326e1e-6175-4de6-bd93-c98069de315d\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0.0,1.999999999999997e-05,3.999999999999997e-05,5.999999999999997e-05,8.000000000000002e-05,0.00010000000000000002,0.00012000000000000002,0.00014000000000000001,0.00016,0.00018,0.0002,0.00022,0.00024,0.00026000000000000003,0.00028,0.00030000000000000003,0.00031999999999999997,0.00034,0.00035999999999999997,0.00038,0.0004000000000000001,0.00042,0.00044000000000000007,0.00046,0.00048000000000000007,0.0005,0.0005200000000000001,0.00054,0.0005600000000000001,0.00058,0.0006000000000000001,0.00062,0.00064,0.00066,0.00068,0.0007,0.00072,0.00074,0.00076,0.0007800000000000001,0.0007999999999999999,0.00082,0.00084,0.0008600000000000001,0.0008799999999999999,0.0009,0.00092,0.0009400000000000001,0.0009599999999999999,0.00098,0.001,0.00102,0.0010400000000000001,0.00106,0.00108,0.0011,0.0011200000000000001,0.00114,0.00116,0.00118,0.0012000000000000001,0.00122,0.00124,0.00126,0.00128,0.0013,0.00132,0.00134,0.00136,0.00138,0.0014,0.00142,0.00144,0.00146,0.00148,0.0015,0.00152,0.00154,0.00156,0.00158,0.0016,0.0016200000000000001,0.00164,0.00166,0.00168,0.0017000000000000001,0.00172,0.00174,0.00176,0.0017800000000000001,0.0018000000000000002,0.0018200000000000002,0.0018399999999999998,0.0018599999999999999,0.00188,0.0019,0.00192,0.00194,0.00196,0.00198,0.0019999999999999996,0.0020199999999999997,0.0020399999999999997,0.0020599999999999998,0.00208,0.0021,0.00212,0.00214,0.0021599999999999996,0.0021799999999999996,0.0021999999999999997,0.0022199999999999998,0.00224,0.00226,0.00228,0.0023,0.00232,0.0023399999999999996,0.0023599999999999997,0.0023799999999999997,0.0024,0.00242,0.00244,0.00246,0.00248,0.0024999999999999996,0.0025199999999999997,0.0025399999999999997,0.0025599999999999998,0.00258,0.0026,0.00262,0.00264,0.0026599999999999996,0.0026799999999999997,0.0026999999999999997,0.0027199999999999998,0.00274,0.00276,0.00278,0.0028,0.0028199999999999996,0.0028399999999999996,0.0028599999999999997,0.0028799999999999997,0.0029,0.00292,0.00294,0.00296,0.00298,0.0029999999999999996,0.0030199999999999997,0.0030399999999999997,0.00306,0.00308,0.0031,0.00312,0.00314,0.0031599999999999996,0.0031799999999999997,0.0031999999999999997,0.0032199999999999998,0.00324,0.00326,0.00328,0.0033,0.0033199999999999996,0.0033399999999999997,0.0033599999999999997,0.0033799999999999998,0.0034,0.00342,0.00344,0.00346,0.00348,0.0034999999999999996,0.0035199999999999997,0.0035399999999999997,0.00356,0.00358,0.0036,0.00362,0.00364,0.0036599999999999996,0.0036799999999999997,0.0036999999999999997,0.0037199999999999998,0.00374,0.00376,0.00378,0.0038,0.00382,0.00384,0.00386,0.00388,0.0038999999999999994,0.00392,0.00394,0.00396,0.00398],\"y\":[-0.004,-0.0033,-0.0029,-0.0025,-0.0018,-0.0009,-0.0017,-0.0004,-0.0011,0.0005,-0.0012,0.0011,-0.0018,0.0021,-0.0015,0.0044,-0.0017,0.131,0.2011,0.1798,0.1804,0.1649,0.1621,0.1481,0.1439,0.1286,0.1253,0.1075,0.1114,0.048,-0.0651,-0.0421,-0.0345,-0.023,-0.0202,-0.0138,-0.0125,-0.0086,-0.0074,-0.0046,-0.0043,-0.0032,-0.0025,-0.0014,-0.001,-0.0009,-0.0003,-0.0004,0.0,-0.0001,0.0003,-0.0001,0.0007,-0.0006,0.0008,-0.0009,0.0022,-0.0048,0.0289,0.1753,0.1884,0.1794,0.1749,0.1658,0.1595,0.1481,0.1423,0.129,0.1263,0.1098,0.1134,0.001,-0.0655,-0.0333,-0.0326,-0.0195,-0.0193,-0.0125,-0.0121,-0.0078,-0.0084,-0.0056,-0.0056,-0.0045,-0.0038,-0.0028,-0.0025,-0.0021,-0.0013,-0.0019,-0.0007,-0.0017,0.0002,-0.0017,0.001,-0.0023,0.0024,-0.0037,0.0064,-0.0092,0.0831,0.1985,0.1798,0.181,0.1662,0.162,0.1496,0.143,0.1314,0.125,0.1152,0.1102,0.0852,-0.0449,-0.0534,-0.0333,-0.0279,-0.0201,-0.0169,-0.0127,-0.0109,-0.008,-0.0063,-0.0047,-0.0041,-0.0037,-0.0033,-0.0025,-0.0019,-0.0013,-0.0008,-0.0011,-0.0008,-0.0012,0.0007,0.0,0.0014,-0.0006,0.0018,-0.0013,0.0028,0.002,0.141,0.2006,0.181,0.1813,0.1669,0.1642,0.1502,0.146,0.1309,0.1287,0.1106,0.115,0.0434,-0.0656,-0.0398,-0.0342,-0.0218,-0.0199,-0.0134,-0.0125,-0.0081,-0.0077,-0.0052,-0.0049,-0.0032,-0.0021,-0.0015,-0.0014,-0.0012,-0.0005,-0.0006,-0.0002,-0.001,0.0,-0.0008,0.0002,-0.0015,0.0011,-0.0019,0.0026,-0.0052,0.0343,0.1804,0.1898,0.1819,0.1755,0.1674,0.1605,0.1503,0.1446,0.1322,0.1284,0.1126,0.1146,-0.0015,-0.0641,-0.0326,-0.0319]},\"selected\":{\"id\":\"c1a1e504-09eb-4118-9b45-4d6efffd539c\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"44e4dd13-ea1c-4a5f-bd7b-d61ca29afd42\",\"type\":\"UnionRenderers\"}},\"id\":\"2f616147-355c-48f6-bfcc-0816567e74ae\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"2f616147-355c-48f6-bfcc-0816567e74ae\",\"type\":\"ColumnDataSource\"}},\"id\":\"585132a3-0efc-49af-b4ac-fc1b1427679a\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"blue\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c2484f5a-9ef6-4a35-a919-adeb8c2becfb\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e0aa4054-c8a0-46aa-9b96-92b9856a2a5b\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"data\":{\"x\":[0.0,9.999999999999999e-06,1.999999999999997e-05,2.9999999999999997e-05,3.999999999999997e-05,4.9999999999999996e-05,5.999999999999997e-05,7e-05,8.000000000000002e-05,8.999999999999999e-05,0.00010000000000000002,0.00010999999999999999,0.00012000000000000002,0.00013,0.00014000000000000001,0.00015,0.00016,0.00016999999999999999,0.00018,0.00018999999999999998,0.0002,0.00020999999999999998,0.00022,0.00022999999999999998,0.00024,0.00025,0.00026000000000000003,0.00027000000000000006,0.00028,0.00029,0.00030000000000000003,0.00031000000000000005,0.00031999999999999997,0.00033,0.00034,0.00035000000000000005,0.00035999999999999997,0.00037,0.00038,0.00039000000000000005,0.0004000000000000001,0.00041,0.00042,0.00043000000000000004,0.00044000000000000007,0.00045,0.00046,0.00047000000000000004,0.00048000000000000007,0.00049,0.0005,0.00051,0.0005200000000000001,0.00053,0.00054,0.00055,0.0005600000000000001,0.00057,0.00058,0.00059,0.0006000000000000001,0.00061,0.00062,0.00063,0.00064,0.00065,0.00066,0.00067,0.00068,0.0006900000000000001,0.0007,0.00071,0.00072,0.0007300000000000001,0.00074,0.00075,0.00076,0.0007700000000000001,0.0007800000000000001,0.0007900000000000001,0.0007999999999999999,0.00081,0.00082,0.00083,0.00084,0.0008500000000000001,0.0008600000000000001,0.0008700000000000001,0.0008799999999999999,0.00089,0.0009,0.00091,0.00092,0.00093,0.0009400000000000001,0.0009500000000000001,0.0009599999999999999,0.0009699999999999999,0.00098,0.00099,0.001,0.00101,0.00102,0.00103,0.0010400000000000001,0.00105,0.00106,0.00107,0.00108,0.00109,0.0011,0.00111,0.0011200000000000001,0.00113,0.00114,0.00115,0.00116,0.00117,0.00118,0.00119,0.0012000000000000001,0.00121,0.00122,0.00123,0.00124,0.00125,0.00126,0.00127,0.00128,0.00129,0.0013,0.00131,0.00132,0.00133,0.00134,0.00135,0.00136,0.0013700000000000001,0.00138,0.00139,0.0014,0.00141,0.00142,0.00143,0.00144,0.0014500000000000001,0.00146,0.00147,0.00148,0.00149,0.0015,0.00151,0.00152,0.0015300000000000001,0.00154,0.00155,0.00156,0.00157,0.00158,0.00159,0.0016,0.00161,0.0016200000000000001,0.00163,0.00164,0.00165,0.00166,0.00167,0.00168,0.00169,0.0017000000000000001,0.00171,0.00172,0.00173,0.00174,0.00175,0.00176,0.00177,0.0017800000000000001,0.0017900000000000001,0.0018000000000000002,0.0018100000000000002,0.0018200000000000002,0.0018299999999999998,0.0018399999999999998,0.0018499999999999999,0.0018599999999999999,0.00187,0.00188,0.00189,0.0019,0.00191,0.00192,0.00193,0.00194,0.0019500000000000001,0.00196,0.00197,0.00198,0.00199,0.0019999999999999996,0.0020099999999999996,0.0020199999999999997,0.0020299999999999997,0.0020399999999999997,0.0020499999999999997,0.0020599999999999998,0.00207,0.00208,0.00209,0.0021,0.00211,0.00212,0.00213,0.00214,0.00215,0.0021599999999999996,0.0021699999999999996,0.0021799999999999996,0.0021899999999999997,0.0021999999999999997,0.0022099999999999997,0.0022199999999999998,0.0022299999999999998,0.00224,0.00225,0.00226,0.00227,0.00228,0.00229,0.0023,0.00231,0.00232,0.0023299999999999996,0.0023399999999999996,0.0023499999999999997,0.0023599999999999997,0.0023699999999999997,0.0023799999999999997,0.0023899999999999998,0.0024,0.00241,0.00242,0.00243,0.00244,0.00245,0.00246,0.00247,0.00248,0.0024899999999999996,0.0024999999999999996,0.0025099999999999996,0.0025199999999999997,0.0025299999999999997,0.0025399999999999997,0.0025499999999999997,0.0025599999999999998,0.00257,0.00258,0.00259,0.0026,0.00261,0.00262,0.00263,0.00264,0.00265,0.0026599999999999996,0.0026699999999999996,0.0026799999999999997,0.0026899999999999997,0.0026999999999999997,0.0027099999999999997,0.0027199999999999998,0.00273,0.00274,0.00275,0.00276,0.00277,0.00278,0.00279,0.0028,0.00281,0.0028199999999999996,0.0028299999999999996,0.0028399999999999996,0.0028499999999999997,0.0028599999999999997,0.0028699999999999997,0.0028799999999999997,0.0028899999999999998,0.0029,0.00291,0.00292,0.00293,0.00294,0.00295,0.00296,0.00297,0.00298,0.0029899999999999996,0.0029999999999999996,0.0030099999999999997,0.0030199999999999997,0.0030299999999999997,0.0030399999999999997,0.0030499999999999998,0.00306,0.00307,0.00308,0.00309,0.0031,0.00311,0.00312,0.00313,0.00314,0.0031499999999999996,0.0031599999999999996,0.0031699999999999996,0.0031799999999999997,0.0031899999999999997,0.0031999999999999997,0.0032099999999999997,0.0032199999999999998,0.00323,0.00324,0.00325,0.00326,0.00327,0.00328,0.00329,0.0033,0.00331,0.0033199999999999996,0.0033299999999999996,0.0033399999999999997,0.0033499999999999997,0.0033599999999999997,0.0033699999999999997,0.0033799999999999998,0.00339,0.0034,0.00341,0.00342,0.00343,0.00344,0.00345,0.00346,0.00347,0.00348,0.0034899999999999996,0.0034999999999999996,0.0035099999999999997,0.0035199999999999997,0.0035299999999999997,0.0035399999999999997,0.0035499999999999998,0.00356,0.00357,0.00358,0.00359,0.0036,0.00361,0.00362,0.00363,0.00364,0.0036499999999999996,0.0036599999999999996,0.00367,0.0036799999999999997,0.00369,0.0036999999999999997,0.00371,0.0037199999999999998,0.0037299999999999994,0.00374,0.0037499999999999994,0.00376,0.0037699999999999995,0.00378,0.0037899999999999995,0.0038,0.0038099999999999996,0.00382,0.0038299999999999996,0.00384,0.0038499999999999997,0.00386,0.0038699999999999997,0.00388,0.00389,0.0038999999999999994,0.00391,0.00392,0.00393,0.00394,0.00395,0.00396,0.0039700000000000004,0.00398,0.0039900000000000005],\"y\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0]},\"selected\":{\"id\":\"5f6eb020-25cd-4ffe-932c-28b390234b62\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"8354813f-1718-434a-b51f-81ac857284b4\",\"type\":\"UnionRenderers\"}},\"id\":\"18be4fb0-1050-4b6e-9483-658d07edaa71\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"source\":{\"id\":\"18be4fb0-1050-4b6e-9483-658d07edaa71\",\"type\":\"ColumnDataSource\"}},\"id\":\"2854c9a3-4bd2-46f2-abac-d989aae29a25\",\"type\":\"CDSView\"},{\"attributes\":{\"line_color\":\"magenta\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2bd0f779-f421-44f9-b840-8241b0e149ef\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d3ced549-4d91-4ab5-984d-f9dfaaef615b\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"698cda47-0023-4c84-804f-0061f11e4e95\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"f548edb9-3290-4d8a-bc87-4993066fa187\",\"type\":\"CrosshairTool\"},{\"attributes\":{\"overlay\":{\"id\":\"f918bf36-2b9d-41a5-ad9c-a3c2064cf521\",\"type\":\"BoxAnnotation\"}},\"id\":\"48e5e558-c707-4ec3-b0c0-31610d08d98f\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"77775770-70e2-429f-827e-ea8fd066c463\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"0c18c893-dc77-4d8b-ba9c-a847a170df7c\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"66fc89e7-8bea-4816-b565-72972a41e086\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"renderers\":\"auto\"},\"id\":\"ea7f1d32-27ba-46c8-abe8-a42fd9404d9c\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"44e4dd13-ea1c-4a5f-bd7b-d61ca29afd42\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"c1a1e504-09eb-4118-9b45-4d6efffd539c\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"8354813f-1718-434a-b51f-81ac857284b4\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"5f6eb020-25cd-4ffe-932c-28b390234b62\",\"type\":\"Selection\"}],\"root_ids\":[\"978235aa-ba95-4a7f-83d1-761886b6fb6b\"]},\"title\":\"Bokeh Application\",\"version\":\"0.13.0\"}};\n", " var render_items = [{\"docid\":\"fa291401-4b92-44a4-8fd5-80b22371a433\",\"notebook_comms_target\":\"59c5fa4f-d844-46b5-bb5a-708344d034b2\",\"roots\":{\"978235aa-ba95-4a7f-83d1-761886b6fb6b\":\"b9a4b976-7a0c-4e17-aa00-4472fe6ba021\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\")\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "978235aa-ba95-4a7f-83d1-761886b6fb6b" } }, "output_type": "display_data" } ], "source": [ "data = signal.scope(\n", " signal.stream2signal(\n", " signal.trigger( mdu.fetch(2000000), precond='DI1 < 0.5', cond='DI1 > 0.5',\n", " P=200, N=200, single_shot=False, post_delay = 0.1),\n", " split=400, relative_time=True),\n", " title=\"Continous Mode - Rising Edge Trigger\", y_range = (-0.1,1.1) )\n", "if not data:\n", " print('Signal not detected')" ] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }