{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Bootstrap" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from itten.movie import Movie\n", "from itten.views import MultivariateSequence\n", "from itten.views import UnivariateSequence\n", "from itten.visuals import MultivariatePlot\n", "from itten.visuals import UnivariatePlot" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Instanziieren einer generellen Movie Instanz für einen Film\n", "movie = Movie(prefix='syriana_', folder='static/')\n", "\n", "# Berechnung eines Kontrastes innerhalb einer Kontrastdarstellung\n", "cont = UnivariateSequence(movie._frames,)\n", "FRAMESTEP = 20\n", "cont.seqmean(frm_stp=FRAMESTEP)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Bokeh Components" ] }, { "cell_type": "code", "execution_count": 3, "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 !== undefined) {\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 element_id = msg.content.text.trim();\n", " Bokeh.index[element_id].model.document.clear();\n", " delete Bokeh.index[element_id];\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[0].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[0].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[0]);\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(\"9dc880ad-0482-4aca-b1d8-b4f5035a7e29\");\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(\"9dc880ad-0482-4aca-b1d8-b4f5035a7e29\");\n", " if (element == null) {\n", " console.log(\"Bokeh: ERROR: autoload.js configured with elementid '9dc880ad-0482-4aca-b1d8-b4f5035a7e29' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.14.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.14.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.14.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.14.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.12.14.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.14.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.14.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.14.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.14.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.14.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(\"9dc880ad-0482-4aca-b1d8-b4f5035a7e29\")).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(\"9dc880ad-0482-4aca-b1d8-b4f5035a7e29\");\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(\"9dc880ad-0482-4aca-b1d8-b4f5035a7e29\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid '9dc880ad-0482-4aca-b1d8-b4f5035a7e29' but no matching script tag was found. \")\n return false;\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.14.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.14.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.14.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.14.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.12.14.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.14.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.14.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.14.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.14.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.14.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(\"9dc880ad-0482-4aca-b1d8-b4f5035a7e29\")).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" } ], "source": [ "from bokeh.models import ColumnDataSource\n", "from bokeh.plotting import figure, show\n", "from bokeh.io import output_notebook\n", "output_notebook()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Zeitwerte in Abhängigkeit von der Framehäufigkeit für die X-Achse setzen\n", "\n", "ctrst_data_len = len(cont)\n", "\n", "from datetime import timedelta\n", "now = timedelta(seconds=1)\n", "timestamps = []\n", "\n", "for _ in range(ctrst_data_len):\n", " now = now + timedelta(seconds=FRAMESTEP)\n", " timestamps.append(now)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"6aae79f2-8c96-4bd5-a32d-d904c2b025b1\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"0213e4b2-801f-4666-a3f6-1e4b26cae666\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0213e4b2-801f-4666-a3f6-1e4b26cae666\",\"type\":\"BasicTicker\"}},\"id\":\"a1f26702-8621-4a2a-90ec-1f88aff28910\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1af8c5fd-240c-4bb8-9021-bcc71dc77f39\",\"type\":\"DatetimeTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"c90c8f81-f663-41dd-b5eb-c3f03eeacf1b\",\"type\":\"ColumnDataSource\"}},\"id\":\"4ab87847-9742-426a-bfc0-50970ccc5d6d\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1512a921-3af0-4647-b6d8-2e54dfabb948\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"6ee94874-93e6-44a1-ad36-79aad9157bbd\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"c90c8f81-f663-41dd-b5eb-c3f03eeacf1b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fe48f9c6-61ab-480c-a0df-1b88ca62e431\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1512a921-3af0-4647-b6d8-2e54dfabb948\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"4ab87847-9742-426a-bfc0-50970ccc5d6d\",\"type\":\"CDSView\"}},\"id\":\"6616137f-6e41-4b92-82b6-d906c28298fb\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"e0076a8f-d56f-48ed-88f4-ad9468676b0c\",\"type\":\"BoxAnnotation\"},\"renderers\":[{\"id\":\"6616137f-6e41-4b92-82b6-d906c28298fb\",\"type\":\"GlyphRenderer\"}]},\"id\":\"bd898bf0-34a8-4931-811e-19a0fd0a3893\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"overlay\":{\"id\":\"31324d1e-ae81-4909-a937-e811ae84ebdb\",\"type\":\"BoxAnnotation\"}},\"id\":\"a4e83882-b12b-4d6b-94b5-03d7709f9b4a\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"b1970e09-b670-4a11-a6b7-8a6731d28576\",\"type\":\"ResetTool\"},{\"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\":\"e0076a8f-d56f-48ed-88f4-ad9468676b0c\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"days\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},\"id\":\"b619001a-a44d-4edb-998d-5a3e2af3fe78\",\"type\":\"DaysTicker\"},{\"attributes\":{\"line_color\":\"#1f77b4\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"fe48f9c6-61ab-480c-a0df-1b88ca62e431\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"cde8e5f2-dc41-4571-896b-03767d99ab72\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"6ee94874-93e6-44a1-ad36-79aad9157bbd\",\"type\":\"PanTool\"},{\"id\":\"bd898bf0-34a8-4931-811e-19a0fd0a3893\",\"type\":\"BoxSelectTool\"},{\"id\":\"a4e83882-b12b-4d6b-94b5-03d7709f9b4a\",\"type\":\"BoxZoomTool\"},{\"id\":\"b1970e09-b670-4a11-a6b7-8a6731d28576\",\"type\":\"ResetTool\"}]},\"id\":\"491b9f98-75e3-4c62-b09b-e4ee6891fc16\",\"type\":\"Toolbar\"},{\"attributes\":{\"mantissas\":[1,2,5],\"max_interval\":500.0,\"num_minor_ticks\":0},\"id\":\"3630b837-a3c0-4f47-9e76-c3b458aef23b\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"days\":[1,4,7,10,13,16,19,22,25,28]},\"id\":\"bf067ed3-933b-48ef-9e13-1e65b4013305\",\"type\":\"DaysTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"74827821-da80-478f-831f-13b6ea12393d\",\"type\":\"DataRange1d\"},{\"attributes\":{\"base\":60,\"mantissas\":[1,2,5,10,15,20,30],\"max_interval\":1800000.0,\"min_interval\":1000.0,\"num_minor_ticks\":0},\"id\":\"6edf7c06-543a-427b-966d-463887b05b0e\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"base\":24,\"mantissas\":[1,2,4,6,8,12],\"max_interval\":43200000.0,\"min_interval\":3600000.0,\"num_minor_ticks\":0},\"id\":\"b5b4e7a1-b137-4e52-8701-53bae6774339\",\"type\":\"AdaptiveTicker\"},{\"attributes\":{\"days\":[1,8,15,22]},\"id\":\"9d0e0f52-790f-43a7-a53c-d73b95934240\",\"type\":\"DaysTicker\"},{\"attributes\":{\"days\":[1,15]},\"id\":\"fd0abd1e-6257-4a7a-9199-ea4f7b41c465\",\"type\":\"DaysTicker\"},{\"attributes\":{\"months\":[0,1,2,3,4,5,6,7,8,9,10,11]},\"id\":\"adaf60ee-7409-422b-81a8-7373528bb4df\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"months\":[0,2,4,6,8,10]},\"id\":\"1176d198-69c2-41b0-8c87-21910f73f50c\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"plot\":{\"id\":\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"be13b29b-8f65-4fb5-a7d5-eded78673509\",\"type\":\"DatetimeTicker\"}},\"id\":\"0f3481ea-dc10-4c76-8687-b3f556b642ad\",\"type\":\"Grid\"},{\"attributes\":{\"below\":[{\"id\":\"546b2a81-b710-4dc9-984f-88a9d031634a\",\"type\":\"DatetimeAxis\"}],\"left\":[{\"id\":\"9da36e20-6247-4f70-9d66-b54ab8b2998c\",\"type\":\"LinearAxis\"}],\"plot_height\":300,\"plot_width\":2000,\"renderers\":[{\"id\":\"546b2a81-b710-4dc9-984f-88a9d031634a\",\"type\":\"DatetimeAxis\"},{\"id\":\"0f3481ea-dc10-4c76-8687-b3f556b642ad\",\"type\":\"Grid\"},{\"id\":\"9da36e20-6247-4f70-9d66-b54ab8b2998c\",\"type\":\"LinearAxis\"},{\"id\":\"a1f26702-8621-4a2a-90ec-1f88aff28910\",\"type\":\"Grid\"},{\"id\":\"e0076a8f-d56f-48ed-88f4-ad9468676b0c\",\"type\":\"BoxAnnotation\"},{\"id\":\"31324d1e-ae81-4909-a937-e811ae84ebdb\",\"type\":\"BoxAnnotation\"},{\"id\":\"6616137f-6e41-4b92-82b6-d906c28298fb\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"256cc08d-799f-4725-9a96-fcdb74969a73\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"491b9f98-75e3-4c62-b09b-e4ee6891fc16\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"75663a3c-d689-4605-a5c5-9fb90c8c33b1\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"159fe062-709f-4e5a-a279-a2abef29011d\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"74827821-da80-478f-831f-13b6ea12393d\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"357f3085-9be4-4a85-a833-9e68415b3655\",\"type\":\"LinearScale\"}},\"id\":\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"months\":[0,4,8]},\"id\":\"52e55322-0c50-4d5d-8d16-8d07af891c27\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[21000.0,41000.0,61000.0,81000.0,101000.0,121000.0,141000.0,161000.0,181000.0,201000.0,221000.0,241000.0,261000.0,281000.0,301000.0,321000.0,341000.0,361000.0,381000.0,401000.0,421000.0,441000.0,461000.0,481000.0,501000.0,521000.0,541000.0,561000.0,581000.0,601000.0,621000.0,641000.0,661000.0,681000.0,701000.0,721000.0,741000.0,761000.0,781000.0,801000.0,821000.0,841000.0,861000.0,881000.0,901000.0,921000.0,941000.0,961000.0,981000.0,1001000.0,1021000.0,1041000.0,1061000.0,1081000.0,1101000.0,1121000.0,1141000.0,1161000.0,1181000.0,1201000.0,1221000.0,1241000.0,1261000.0,1281000.0,1301000.0,1321000.0,1341000.0,1361000.0,1381000.0,1401000.0,1421000.0,1441000.0,1461000.0,1481000.0,1501000.0,1521000.0,1541000.0,1561000.0,1581000.0,1601000.0,1621000.0,1641000.0,1661000.0,1681000.0,1701000.0,1721000.0,1741000.0,1761000.0,1781000.0,1801000.0,1821000.0,1841000.0,1861000.0,1881000.0,1901000.0,1921000.0,1941000.0,1961000.0,1981000.0,2001000.0,2021000.0,2041000.0,2061000.0,2081000.0,2101000.0,2121000.0,2141000.0,2161000.0,2181000.0,2201000.0,2221000.0,2241000.0,2261000.0,2281000.0,2301000.0,2321000.0,2341000.0,2361000.0,2381000.0,2401000.0,2421000.0,2441000.0,2461000.0,2481000.0,2501000.0,2521000.0,2541000.0,2561000.0,2581000.0,2601000.0,2621000.0,2641000.0,2661000.0,2681000.0,2701000.0,2721000.0,2741000.0,2761000.0,2781000.0,2801000.0,2821000.0,2841000.0,2861000.0,2881000.0,2901000.0,2921000.0,2941000.0,2961000.0,2981000.0,3001000.0,3021000.0,3041000.0,3061000.0,3081000.0,3101000.0,3121000.0,3141000.0,3161000.0,3181000.0,3201000.0,3221000.0,3241000.0,3261000.0,3281000.0,3301000.0,3321000.0,3341000.0,3361000.0,3381000.0,3401000.0,3421000.0,3441000.0,3461000.0,3481000.0,3501000.0,3521000.0,3541000.0,3561000.0,3581000.0,3601000.0,3621000.0,3641000.0,3661000.0,3681000.0,3701000.0,3721000.0,3741000.0,3761000.0,3781000.0,3801000.0,3821000.0,3841000.0,3861000.0,3881000.0,3901000.0,3921000.0,3941000.0,3961000.0,3981000.0,4001000.0,4021000.0,4041000.0,4061000.0,4081000.0,4101000.0,4121000.0,4141000.0,4161000.0,4181000.0,4201000.0,4221000.0,4241000.0,4261000.0,4281000.0,4301000.0,4321000.0,4341000.0,4361000.0,4381000.0,4401000.0,4421000.0,4441000.0,4461000.0,4481000.0,4501000.0,4521000.0,4541000.0,4561000.0,4581000.0,4601000.0,4621000.0,4641000.0,4661000.0,4681000.0,4701000.0,4721000.0,4741000.0,4761000.0,4781000.0,4801000.0,4821000.0,4841000.0,4861000.0,4881000.0,4901000.0,4921000.0,4941000.0,4961000.0,4981000.0,5001000.0,5021000.0,5041000.0,5061000.0,5081000.0,5101000.0,5121000.0,5141000.0,5161000.0,5181000.0,5201000.0,5221000.0,5241000.0,5261000.0,5281000.0,5301000.0,5321000.0,5341000.0,5361000.0,5381000.0,5401000.0,5421000.0,5441000.0,5461000.0,5481000.0,5501000.0,5521000.0,5541000.0,5561000.0,5581000.0,5601000.0,5621000.0,5641000.0,5661000.0,5681000.0,5701000.0,5721000.0,5741000.0,5761000.0,5781000.0,5801000.0,5821000.0,5841000.0,5861000.0,5881000.0,5901000.0,5921000.0,5941000.0,5961000.0,5981000.0,6001000.0,6021000.0,6041000.0,6061000.0,6081000.0,6101000.0,6121000.0,6141000.0,6161000.0,6181000.0,6201000.0,6221000.0,6241000.0,6261000.0,6281000.0,6301000.0,6321000.0,6341000.0,6361000.0,6381000.0,6401000.0,6421000.0,6441000.0,6461000.0,6481000.0,6501000.0,6521000.0,6541000.0,6561000.0,6581000.0,6601000.0,6621000.0,6641000.0,6661000.0,6681000.0,6701000.0,6721000.0,6741000.0,6761000.0,6781000.0,6801000.0,6821000.0,6841000.0,6861000.0,6881000.0,6901000.0,6921000.0,6941000.0,6961000.0,6981000.0,7001000.0,7021000.0,7041000.0,7061000.0,7081000.0,7101000.0,7121000.0,7141000.0,7161000.0,7181000.0,7201000.0,7221000.0,7241000.0,7261000.0,7281000.0,7301000.0,7321000.0,7341000.0,7361000.0],\"y\":{\"__ndarray__\":\"AQAAAAEAAABFAAAAOAAAAAIAAAA3AAAABwAAAEAAAAA/AAAAKAAAAC4AAAAOAAAACgAAABYAAAAgAAAAHAAAACUAAABhAAAANgAAAD4AAABGAAAATwAAAFEAAABVAAAAPQAAAEUAAABkAAAATAAAADYAAAA3AAAASgAAAEMAAABMAAAAKQAAAD0AAAA+AAAAYQAAAEIAAAByAAAAcAAAAJcAAABVAAAAZQAAAHIAAAB7AAAAYgAAAC0AAAA4AAAAEgAAAEwAAAA1AAAADwAAABoAAAAZAAAAEAAAABsAAAAsAAAAHwAAADwAAAA5AAAASgAAAFkAAABUAAAAdQAAAGgAAAA/AAAASQAAAEMAAACaAAAAkAAAALAAAAAxAAAAQwAAACMAAAAiAAAAJAAAAB4AAAAcAAAAIgAAABsAAAAiAAAAIAAAABMAAABEAAAAUgAAACIAAAA4AAAAKwAAAD0AAABKAAAASQAAABoAAAAnAAAAQQAAAGcAAABbAAAAFAAAADEAAAAjAAAAOwAAABIAAABIAAAARwAAAE8AAAAxAAAAJAAAADIAAACLAAAAKgAAADMAAABVAAAAOQAAAGUAAAB0AAAAeQAAAGoAAAA/AAAASgAAAEIAAAATAAAAFQAAABkAAAAiAAAAHQAAAB8AAAAhAAAAHgAAADoAAAAXAAAADQAAAAwAAAASAAAAbAAAAGAAAABdAAAAaAAAAGcAAAB5AAAAiQAAAIkAAAB1AAAAcAAAAE4AAABdAAAAYQAAAA8AAAAIAAAALgAAAEIAAABSAAAARQAAAI0AAABFAAAAewAAAFkAAAA0AAAAMAAAABcAAAAkAAAAawAAAGYAAABnAAAAfQAAAHUAAABdAAAASQAAAFIAAABUAAAAVQAAAC8AAAA+AAAARAAAAGIAAAAqAAAANAAAAEQAAAA6AAAARwAAACgAAAAkAAAAegAAAAcAAAAjAAAAMwAAADAAAAAzAAAAIgAAACUAAAAhAAAAIwAAACAAAAApAAAAJgAAACAAAAAlAAAAGQAAAEgAAABBAAAARwAAADwAAAAcAAAAIAAAACAAAAAxAAAAKgAAAGIAAAA2AAAAMQAAABMAAAAQAAAAXAAAAB4AAAAhAAAAFwAAAD8AAAAiAAAANAAAADMAAABEAAAAEAAAABoAAAAdAAAAHAAAABwAAAAbAAAAVAAAAGIAAAA1AAAALgAAADEAAAAvAAAANAAAAEUAAABAAAAAOgAAADsAAABQAAAAYwAAAFMAAABIAAAAQwAAAD4AAAAkAAAAVQAAAEgAAABBAAAAOgAAADIAAAA9AAAARwAAAEAAAABBAAAAUwAAAEIAAABiAAAATQAAAFcAAABNAAAAUAAAAF8AAABmAAAAZgAAAIcAAABuAAAAXwAAAF4AAABNAAAAOQAAAD4AAAA3AAAAPgAAAAcAAAAIAAAACAAAAAYAAAAMAAAABgAAAAQAAAAUAAAACgAAADIAAAAyAAAAMgAAADkAAAAxAAAAOQAAADgAAABcAAAAZQAAAEgAAAB1AAAAeQAAAGsAAAA2AAAASwAAAEgAAAA7AAAAQAAAAGoAAACPAAAALQAAAEsAAAATAAAAHQAAABkAAABSAAAAUwAAAFsAAABtAAAAbQAAADIAAABWAAAALAAAAGAAAABVAAAAPAAAAGEAAAB4AAAAXAAAAHYAAAAjAAAAcwAAAG8AAAB7AAAAVAAAAEgAAAAwAAAAWwAAACUAAABNAAAASAAAACgAAAAzAAAAJwAAACcAAABwAAAAbAAAAHQAAABrAAAAcQAAAHgAAADyAAAAWgAAADYAAABfAAAAIwAAAA0AAAAOAAAAAwAAAAIAAAABAAAAAgAAAAQAAAAEAAAAAwAAAA8AAAAOAAAAEwAAABEAAAASAAAAEAAAAA4AAAALAAAADgAAAAgAAAAGAAAACwAAAAIAAAA=\",\"dtype\":\"uint32\",\"shape\":[368]}}},\"id\":\"c90c8f81-f663-41dd-b5eb-c3f03eeacf1b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"months\":[0,6]},\"id\":\"25f04121-e08f-467d-bcda-46a5d134272d\",\"type\":\"MonthsTicker\"},{\"attributes\":{\"plot\":null,\"text\":\"Mean of Luminostiy for Syriana\"},\"id\":\"256cc08d-799f-4725-9a96-fcdb74969a73\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"6baf4e73-4fc0-48be-8ad6-3147b334df19\",\"type\":\"YearsTicker\"},{\"attributes\":{},\"id\":\"159fe062-709f-4e5a-a279-a2abef29011d\",\"type\":\"LinearScale\"},{\"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\":\"31324d1e-ae81-4909-a937-e811ae84ebdb\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"357f3085-9be4-4a85-a833-9e68415b3655\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis_label\":\"Bin\",\"formatter\":{\"id\":\"cde8e5f2-dc41-4571-896b-03767d99ab72\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0213e4b2-801f-4666-a3f6-1e4b26cae666\",\"type\":\"BasicTicker\"}},\"id\":\"9da36e20-6247-4f70-9d66-b54ab8b2998c\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis_label\":\"Frame Number\",\"formatter\":{\"id\":\"1af8c5fd-240c-4bb8-9021-bcc71dc77f39\",\"type\":\"DatetimeTickFormatter\"},\"plot\":{\"id\":\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"be13b29b-8f65-4fb5-a7d5-eded78673509\",\"type\":\"DatetimeTicker\"}},\"id\":\"546b2a81-b710-4dc9-984f-88a9d031634a\",\"type\":\"DatetimeAxis\"},{\"attributes\":{\"num_minor_ticks\":5,\"tickers\":[{\"id\":\"3630b837-a3c0-4f47-9e76-c3b458aef23b\",\"type\":\"AdaptiveTicker\"},{\"id\":\"6edf7c06-543a-427b-966d-463887b05b0e\",\"type\":\"AdaptiveTicker\"},{\"id\":\"b5b4e7a1-b137-4e52-8701-53bae6774339\",\"type\":\"AdaptiveTicker\"},{\"id\":\"b619001a-a44d-4edb-998d-5a3e2af3fe78\",\"type\":\"DaysTicker\"},{\"id\":\"bf067ed3-933b-48ef-9e13-1e65b4013305\",\"type\":\"DaysTicker\"},{\"id\":\"9d0e0f52-790f-43a7-a53c-d73b95934240\",\"type\":\"DaysTicker\"},{\"id\":\"fd0abd1e-6257-4a7a-9199-ea4f7b41c465\",\"type\":\"DaysTicker\"},{\"id\":\"adaf60ee-7409-422b-81a8-7373528bb4df\",\"type\":\"MonthsTicker\"},{\"id\":\"1176d198-69c2-41b0-8c87-21910f73f50c\",\"type\":\"MonthsTicker\"},{\"id\":\"52e55322-0c50-4d5d-8d16-8d07af891c27\",\"type\":\"MonthsTicker\"},{\"id\":\"25f04121-e08f-467d-bcda-46a5d134272d\",\"type\":\"MonthsTicker\"},{\"id\":\"6baf4e73-4fc0-48be-8ad6-3147b334df19\",\"type\":\"YearsTicker\"}]},\"id\":\"be13b29b-8f65-4fb5-a7d5-eded78673509\",\"type\":\"DatetimeTicker\"},{\"attributes\":{\"callback\":null},\"id\":\"75663a3c-d689-4605-a5c5-9fb90c8c33b1\",\"type\":\"DataRange1d\"}],\"root_ids\":[\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.14\"}};\n", " var render_items = [{\"docid\":\"6aae79f2-8c96-4bd5-a32d-d904c2b025b1\",\"elementid\":\"5940f775-437c-433b-9a9c-64ff06361358\",\"modelid\":\"cef5b3ef-5638-41a4-8e97-26bfdaa083e3\"}];\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": "cef5b3ef-5638-41a4-8e97-26bfdaa083e3" } }, "output_type": "display_data" } ], "source": [ "# Lineplot for event type counts \n", "lineplot = figure(title='Mean of Luminostiy for Syriana',\n", " plot_width=2000,\n", " plot_height=300,\n", " x_axis_label='Frame Number',\n", " x_axis_type='datetime',\n", " y_axis_label='Bin',\n", " tools='pan,box_select,box_zoom,reset'\n", " )\n", "\n", "lineplot.line(x=timestamps, y=cont)\n", "show(lineplot)" ] } ], "metadata": { "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.7.3" }, "toc": { "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "toc_cell": false, "toc_position": {}, "toc_section_display": "block", "toc_window_display": true }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }