{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Get DESI LegacySurvey data"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"from oda_api.plot_tools import OdaImage\n",
"from oda_api.api import DispatcherAPI"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"disp=DispatcherAPI(url='https://www.astro.unige.ch/mmoda/dispatch-data', instrument='mock')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Image and source catalog"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"please beware that by default, in a typical setup, oda_api will not output much. To learn how to increase the verbosity, please refer to the documentation: https://oda-api.readthedocs.io/en/latest/user_guide/ScienceWindowList.html?highlight=logging#Let's-get-some-logging . \n",
"To disable this message you can pass `.get_product(..., silent=True)`\n",
"/home/dsavchenko/Projects/cloud/dispatcher-container/oda_api/oda_api/api.py:1046: UserWarning: \n",
"----------------------------------------------------------------------------\n",
"the parameter: T_format is not among valid ones:\n",
"['src_name', 'RA', 'DEC', 'T1', 'T2', 'token', 'data_release', 'image_band', 'image_size', 'pixel_size']\n",
"this will throw an error in a future version \n",
"and might break the current request!\n",
" ----------------------------------------------------------------------------\n",
"\n",
" warnings.warn(msg)\n"
]
}
],
"source": [
"par_dict={\n",
" \"DEC\": -0.013294166666667,\n",
" \"RA\": 40.66962125,\n",
" \"T1\": \"2017-03-06T13:26:48.000\",\n",
" \"T2\": \"2017-03-06T15:32:27.000\",\n",
" \"T_format\": \"isot\",\n",
" \"data_release\": 9,\n",
" \"image_band\": \"g\",\n",
" \"image_size\": 3.0,\n",
" \"instrument\": \"legacysurvey\",\n",
" \"pixel_size\": 1.0,\n",
" \"product\": \"legacy_survey_image\",\n",
" \"product_type\": \"Real\",\n",
" \"src_name\": \"NGC1068\"\n",
"}\n",
"\n",
"data_collection = disp.get_product(**par_dict)\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ID=0 prod_name=mosaic_image_0_mosaic meta_data: {'product': 'mosaic'}\n",
"\n",
"ID=1 prod_name=dispatcher_catalog_1 meta_data: \n",
"\n"
]
}
],
"source": [
"data_collection.show()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"im = OdaImage(data_collection)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"/* global mpl */\n",
"window.mpl = {};\n",
"\n",
"mpl.get_websocket_type = function () {\n",
" if (typeof WebSocket !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof MozWebSocket !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert(\n",
" 'Your browser does not have WebSocket support. ' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.'\n",
" );\n",
" }\n",
"};\n",
"\n",
"mpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = this.ws.binaryType !== undefined;\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById('mpl-warnings');\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent =\n",
" 'This browser does not support binary websocket messages. ' +\n",
" 'Performance may be slow.';\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = document.createElement('div');\n",
" this.root.setAttribute('style', 'display: inline-block');\n",
" this._root_extra_style(this.root);\n",
"\n",
" parent_element.appendChild(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message('supports_binary', { value: fig.supports_binary });\n",
" fig.send_message('send_image_mode', {});\n",
" if (fig.ratio !== 1) {\n",
" fig.send_message('set_device_pixel_ratio', {\n",
" device_pixel_ratio: fig.ratio,\n",
" });\n",
" }\n",
" fig.send_message('refresh', {});\n",
" };\n",
"\n",
" this.imageObj.onload = function () {\n",
" if (fig.image_mode === 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function () {\n",
" fig.ws.close();\n",
" };\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"};\n",
"\n",
"mpl.figure.prototype._init_header = function () {\n",
" var titlebar = document.createElement('div');\n",
" titlebar.classList =\n",
" 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n",
" var titletext = document.createElement('div');\n",
" titletext.classList = 'ui-dialog-title';\n",
" titletext.setAttribute(\n",
" 'style',\n",
" 'width: 100%; text-align: center; padding: 3px;'\n",
" );\n",
" titlebar.appendChild(titletext);\n",
" this.root.appendChild(titlebar);\n",
" this.header = titletext;\n",
"};\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n",
"\n",
"mpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n",
"\n",
"mpl.figure.prototype._init_canvas = function () {\n",
" var fig = this;\n",
"\n",
" var canvas_div = (this.canvas_div = document.createElement('div'));\n",
" canvas_div.setAttribute(\n",
" 'style',\n",
" 'border: 1px solid #ddd;' +\n",
" 'box-sizing: content-box;' +\n",
" 'clear: both;' +\n",
" 'min-height: 1px;' +\n",
" 'min-width: 1px;' +\n",
" 'outline: 0;' +\n",
" 'overflow: hidden;' +\n",
" 'position: relative;' +\n",
" 'resize: both;'\n",
" );\n",
"\n",
" function on_keyboard_event_closure(name) {\n",
" return function (event) {\n",
" return fig.key_event(event, name);\n",
" };\n",
" }\n",
"\n",
" canvas_div.addEventListener(\n",
" 'keydown',\n",
" on_keyboard_event_closure('key_press')\n",
" );\n",
" canvas_div.addEventListener(\n",
" 'keyup',\n",
" on_keyboard_event_closure('key_release')\n",
" );\n",
"\n",
" this._canvas_extra_style(canvas_div);\n",
" this.root.appendChild(canvas_div);\n",
"\n",
" var canvas = (this.canvas = document.createElement('canvas'));\n",
" canvas.classList.add('mpl-canvas');\n",
" canvas.setAttribute('style', 'box-sizing: content-box;');\n",
"\n",
" this.context = canvas.getContext('2d');\n",
"\n",
" var backingStore =\n",
" this.context.backingStorePixelRatio ||\n",
" this.context.webkitBackingStorePixelRatio ||\n",
" this.context.mozBackingStorePixelRatio ||\n",
" this.context.msBackingStorePixelRatio ||\n",
" this.context.oBackingStorePixelRatio ||\n",
" this.context.backingStorePixelRatio ||\n",
" 1;\n",
"\n",
" this.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband_canvas = (this.rubberband_canvas = document.createElement(\n",
" 'canvas'\n",
" ));\n",
" rubberband_canvas.setAttribute(\n",
" 'style',\n",
" 'box-sizing: content-box; position: absolute; left: 0; top: 0; z-index: 1;'\n",
" );\n",
"\n",
" // Apply a ponyfill if ResizeObserver is not implemented by browser.\n",
" if (this.ResizeObserver === undefined) {\n",
" if (window.ResizeObserver !== undefined) {\n",
" this.ResizeObserver = window.ResizeObserver;\n",
" } else {\n",
" var obs = _JSXTOOLS_RESIZE_OBSERVER({});\n",
" this.ResizeObserver = obs.ResizeObserver;\n",
" }\n",
" }\n",
"\n",
" this.resizeObserverInstance = new this.ResizeObserver(function (entries) {\n",
" var nentries = entries.length;\n",
" for (var i = 0; i < nentries; i++) {\n",
" var entry = entries[i];\n",
" var width, height;\n",
" if (entry.contentBoxSize) {\n",
" if (entry.contentBoxSize instanceof Array) {\n",
" // Chrome 84 implements new version of spec.\n",
" width = entry.contentBoxSize[0].inlineSize;\n",
" height = entry.contentBoxSize[0].blockSize;\n",
" } else {\n",
" // Firefox implements old version of spec.\n",
" width = entry.contentBoxSize.inlineSize;\n",
" height = entry.contentBoxSize.blockSize;\n",
" }\n",
" } else {\n",
" // Chrome <84 implements even older version of spec.\n",
" width = entry.contentRect.width;\n",
" height = entry.contentRect.height;\n",
" }\n",
"\n",
" // Keep the size of the canvas and rubber band canvas in sync with\n",
" // the canvas container.\n",
" if (entry.devicePixelContentBoxSize) {\n",
" // Chrome 84 implements new version of spec.\n",
" canvas.setAttribute(\n",
" 'width',\n",
" entry.devicePixelContentBoxSize[0].inlineSize\n",
" );\n",
" canvas.setAttribute(\n",
" 'height',\n",
" entry.devicePixelContentBoxSize[0].blockSize\n",
" );\n",
" } else {\n",
" canvas.setAttribute('width', width * fig.ratio);\n",
" canvas.setAttribute('height', height * fig.ratio);\n",
" }\n",
" canvas.setAttribute(\n",
" 'style',\n",
" 'width: ' + width + 'px; height: ' + height + 'px;'\n",
" );\n",
"\n",
" rubberband_canvas.setAttribute('width', width);\n",
" rubberband_canvas.setAttribute('height', height);\n",
"\n",
" // And update the size in Python. We ignore the initial 0/0 size\n",
" // that occurs as the element is placed into the DOM, which should\n",
" // otherwise not happen due to the minimum size styling.\n",
" if (fig.ws.readyState == 1 && width != 0 && height != 0) {\n",
" fig.request_resize(width, height);\n",
" }\n",
" }\n",
" });\n",
" this.resizeObserverInstance.observe(canvas_div);\n",
"\n",
" function on_mouse_event_closure(name) {\n",
" return function (event) {\n",
" return fig.mouse_event(event, name);\n",
" };\n",
" }\n",
"\n",
" rubberband_canvas.addEventListener(\n",
" 'mousedown',\n",
" on_mouse_event_closure('button_press')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseup',\n",
" on_mouse_event_closure('button_release')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'dblclick',\n",
" on_mouse_event_closure('dblclick')\n",
" );\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband_canvas.addEventListener(\n",
" 'mousemove',\n",
" on_mouse_event_closure('motion_notify')\n",
" );\n",
"\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseenter',\n",
" on_mouse_event_closure('figure_enter')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseleave',\n",
" on_mouse_event_closure('figure_leave')\n",
" );\n",
"\n",
" canvas_div.addEventListener('wheel', function (event) {\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" on_mouse_event_closure('scroll')(event);\n",
" });\n",
"\n",
" canvas_div.appendChild(canvas);\n",
" canvas_div.appendChild(rubberband_canvas);\n",
"\n",
" this.rubberband_context = rubberband_canvas.getContext('2d');\n",
" this.rubberband_context.strokeStyle = '#000000';\n",
"\n",
" this._resize_canvas = function (width, height, forward) {\n",
" if (forward) {\n",
" canvas_div.style.width = width + 'px';\n",
" canvas_div.style.height = height + 'px';\n",
" }\n",
" };\n",
"\n",
" // Disable right mouse context menu.\n",
" this.rubberband_canvas.addEventListener('contextmenu', function (_e) {\n",
" event.preventDefault();\n",
" return false;\n",
" });\n",
"\n",
" function set_focus() {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"};\n",
"\n",
"mpl.figure.prototype._init_toolbar = function () {\n",
" var fig = this;\n",
"\n",
" var toolbar = document.createElement('div');\n",
" toolbar.classList = 'mpl-toolbar';\n",
" this.root.appendChild(toolbar);\n",
"\n",
" function on_click_closure(name) {\n",
" return function (_event) {\n",
" return fig.toolbar_button_onclick(name);\n",
" };\n",
" }\n",
"\n",
" function on_mouseover_closure(tooltip) {\n",
" return function (event) {\n",
" if (!event.currentTarget.disabled) {\n",
" return fig.toolbar_button_onmouseover(tooltip);\n",
" }\n",
" };\n",
" }\n",
"\n",
" fig.buttons = {};\n",
" var buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'mpl-button-group';\n",
" for (var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" /* Instead of a spacer, we start a new button group. */\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
" buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'mpl-button-group';\n",
" continue;\n",
" }\n",
"\n",
" var button = (fig.buttons[name] = document.createElement('button'));\n",
" button.classList = 'mpl-widget';\n",
" button.setAttribute('role', 'button');\n",
" button.setAttribute('aria-disabled', 'false');\n",
" button.addEventListener('click', on_click_closure(method_name));\n",
" button.addEventListener('mouseover', on_mouseover_closure(tooltip));\n",
"\n",
" var icon_img = document.createElement('img');\n",
" icon_img.src = '_images/' + image + '.png';\n",
" icon_img.srcset = '_images/' + image + '_large.png 2x';\n",
" icon_img.alt = tooltip;\n",
" button.appendChild(icon_img);\n",
"\n",
" buttonGroup.appendChild(button);\n",
" }\n",
"\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
"\n",
" var fmt_picker = document.createElement('select');\n",
" fmt_picker.classList = 'mpl-widget';\n",
" toolbar.appendChild(fmt_picker);\n",
" this.format_dropdown = fmt_picker;\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = document.createElement('option');\n",
" option.selected = fmt === mpl.default_extension;\n",
" option.innerHTML = fmt;\n",
" fmt_picker.appendChild(option);\n",
" }\n",
"\n",
" var status_bar = document.createElement('span');\n",
" status_bar.classList = 'mpl-message';\n",
" toolbar.appendChild(status_bar);\n",
" this.message = status_bar;\n",
"};\n",
"\n",
"mpl.figure.prototype.request_resize = function (x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', { width: x_pixels, height: y_pixels });\n",
"};\n",
"\n",
"mpl.figure.prototype.send_message = function (type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"};\n",
"\n",
"mpl.figure.prototype.send_draw_message = function () {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({ type: 'draw', figure_id: this.id }));\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_save = function (fig, _msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_resize = function (fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] !== fig.canvas.width || size[1] !== fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1], msg['forward']);\n",
" fig.send_message('refresh', {});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function (fig, msg) {\n",
" var x0 = msg['x0'] / fig.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / fig.ratio;\n",
" var x1 = msg['x1'] / fig.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / fig.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0,\n",
" 0,\n",
" fig.canvas.width / fig.ratio,\n",
" fig.canvas.height / fig.ratio\n",
" );\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function (fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_cursor = function (fig, msg) {\n",
" fig.rubberband_canvas.style.cursor = msg['cursor'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_message = function (fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_draw = function (fig, _msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function (fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_history_buttons = function (fig, msg) {\n",
" for (var key in msg) {\n",
" if (!(key in fig.buttons)) {\n",
" continue;\n",
" }\n",
" fig.buttons[key].disabled = !msg[key];\n",
" fig.buttons[key].setAttribute('aria-disabled', !msg[key]);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_navigate_mode = function (fig, msg) {\n",
" if (msg['mode'] === 'PAN') {\n",
" fig.buttons['Pan'].classList.add('active');\n",
" fig.buttons['Zoom'].classList.remove('active');\n",
" } else if (msg['mode'] === 'ZOOM') {\n",
" fig.buttons['Pan'].classList.remove('active');\n",
" fig.buttons['Zoom'].classList.add('active');\n",
" } else {\n",
" fig.buttons['Pan'].classList.remove('active');\n",
" fig.buttons['Zoom'].classList.remove('active');\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function () {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message('ack', {});\n",
"};\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function (fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" var img = evt.data;\n",
" if (img.type !== 'image/png') {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" img.type = 'image/png';\n",
" }\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src\n",
" );\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" img\n",
" );\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" } else if (\n",
" typeof evt.data === 'string' &&\n",
" evt.data.slice(0, 21) === 'data:image/png;base64'\n",
" ) {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig['handle_' + msg_type];\n",
" } catch (e) {\n",
" console.log(\n",
" \"No handler for the '\" + msg_type + \"' message type: \",\n",
" msg\n",
" );\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\n",
" \"Exception inside the 'handler_\" + msg_type + \"' callback:\",\n",
" e,\n",
" e.stack,\n",
" msg\n",
" );\n",
" }\n",
" }\n",
" };\n",
"};\n",
"\n",
"// from https://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function (e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e) {\n",
" e = window.event;\n",
" }\n",
" if (e.target) {\n",
" targ = e.target;\n",
" } else if (e.srcElement) {\n",
" targ = e.srcElement;\n",
" }\n",
" if (targ.nodeType === 3) {\n",
" // defeat Safari bug\n",
" targ = targ.parentNode;\n",
" }\n",
"\n",
" // pageX,Y are the mouse positions relative to the document\n",
" var boundingRect = targ.getBoundingClientRect();\n",
" var x = e.pageX - (boundingRect.left + document.body.scrollLeft);\n",
" var y = e.pageY - (boundingRect.top + document.body.scrollTop);\n",
"\n",
" return { x: x, y: y };\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * https://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys(original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object') {\n",
" obj[key] = original[key];\n",
" }\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function (event, name) {\n",
" var canvas_pos = mpl.findpos(event);\n",
"\n",
" if (name === 'button_press') {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * this.ratio;\n",
" var y = canvas_pos.y * this.ratio;\n",
"\n",
" this.send_message(name, {\n",
" x: x,\n",
" y: y,\n",
" button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event),\n",
" });\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"};\n",
"\n",
"mpl.figure.prototype._key_event_extra = function (_event, _name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"};\n",
"\n",
"mpl.figure.prototype.key_event = function (event, name) {\n",
" // Prevent repeat events\n",
" if (name === 'key_press') {\n",
" if (event.key === this._key) {\n",
" return;\n",
" } else {\n",
" this._key = event.key;\n",
" }\n",
" }\n",
" if (name === 'key_release') {\n",
" this._key = null;\n",
" }\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.key !== 'Control') {\n",
" value += 'ctrl+';\n",
" }\n",
" else if (event.altKey && event.key !== 'Alt') {\n",
" value += 'alt+';\n",
" }\n",
" else if (event.shiftKey && event.key !== 'Shift') {\n",
" value += 'shift+';\n",
" }\n",
"\n",
" value += 'k' + event.key;\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, { key: value, guiEvent: simpleKeys(event) });\n",
" return false;\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function (name) {\n",
" if (name === 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message('toolbar_button', { name: name });\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function (tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"\n",
"///////////////// REMAINING CONTENT GENERATED BY embed_js.py /////////////////\n",
"// prettier-ignore\n",
"var _JSXTOOLS_RESIZE_OBSERVER=function(A){var t,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,o=new Set;function s(e){if(!(this instanceof s))throw new TypeError(\"Constructor requires 'new' operator\");i.set(this,e)}function h(){throw new TypeError(\"Function is not a constructor\")}function c(e,t,i,n){e=0 in arguments?Number(arguments[0]):0,t=1 in arguments?Number(arguments[1]):0,i=2 in arguments?Number(arguments[2]):0,n=3 in arguments?Number(arguments[3]):0,this.right=(this.x=this.left=e)+(this.width=i),this.bottom=(this.y=this.top=t)+(this.height=n),Object.freeze(this)}function d(){t=requestAnimationFrame(d);var s=new WeakMap,p=new Set;o.forEach((function(t){r.get(t).forEach((function(i){var r=t instanceof window.SVGElement,o=a.get(t),d=r?0:parseFloat(o.paddingTop),f=r?0:parseFloat(o.paddingRight),l=r?0:parseFloat(o.paddingBottom),u=r?0:parseFloat(o.paddingLeft),g=r?0:parseFloat(o.borderTopWidth),m=r?0:parseFloat(o.borderRightWidth),w=r?0:parseFloat(o.borderBottomWidth),b=u+f,F=d+l,v=(r?0:parseFloat(o.borderLeftWidth))+m,W=g+w,y=r?0:t.offsetHeight-W-t.clientHeight,E=r?0:t.offsetWidth-v-t.clientWidth,R=b+v,z=F+W,M=r?t.width:parseFloat(o.width)-R-E,O=r?t.height:parseFloat(o.height)-z-y;if(n.has(t)){var k=n.get(t);if(k[0]===M&&k[1]===O)return}n.set(t,[M,O]);var S=Object.create(h.prototype);S.target=t,S.contentRect=new c(u,d,M,O),s.has(i)||(s.set(i,[]),p.add(i)),s.get(i).push(S)}))})),p.forEach((function(e){i.get(e).call(e,s.get(e),e)}))}return s.prototype.observe=function(i){if(i instanceof window.Element){r.has(i)||(r.set(i,new Set),o.add(i),a.set(i,window.getComputedStyle(i)));var n=r.get(i);n.has(this)||n.add(this),cancelAnimationFrame(t),t=requestAnimationFrame(d)}},s.prototype.unobserve=function(i){if(i instanceof window.Element&&r.has(i)){var n=r.get(i);n.has(this)&&(n.delete(this),n.size||(r.delete(i),o.delete(i))),n.size||r.delete(i),o.size||cancelAnimationFrame(t)}},A.DOMRectReadOnly=c,A.ResizeObserver=s,A.ResizeObserverEntry=h,A}; // eslint-disable-line\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Left button pans, Right button zooms\\nx/y fixes axis, CTRL fixes aspect\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\\nx/y fixes axis\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"jpeg\", \"pgf\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
"\n",
"mpl.default_extension = \"png\";/* global mpl */\n",
"\n",
"var comm_websocket_adapter = function (comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.binaryType = comm.kernel.ws.binaryType;\n",
" ws.readyState = comm.kernel.ws.readyState;\n",
" function updateReadyState(_event) {\n",
" if (comm.kernel.ws) {\n",
" ws.readyState = comm.kernel.ws.readyState;\n",
" } else {\n",
" ws.readyState = 3; // Closed state.\n",
" }\n",
" }\n",
" comm.kernel.ws.addEventListener('open', updateReadyState);\n",
" comm.kernel.ws.addEventListener('close', updateReadyState);\n",
" comm.kernel.ws.addEventListener('error', updateReadyState);\n",
"\n",
" ws.close = function () {\n",
" comm.close();\n",
" };\n",
" ws.send = function (m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function (msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" var data = msg['content']['data'];\n",
" if (data['blob'] !== undefined) {\n",
" data = {\n",
" data: new Blob(msg['buffers'], { type: data['blob'] }),\n",
" };\n",
" }\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(data);\n",
" });\n",
" return ws;\n",
"};\n",
"\n",
"mpl.mpl_figure_comm = function (comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = document.getElementById(id);\n",
" var ws_proxy = comm_websocket_adapter(comm);\n",
"\n",
" function ondownload(figure, _format) {\n",
" window.open(figure.canvas.toDataURL());\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy, ondownload, element);\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element;\n",
" fig.cell_info = mpl.find_output_cell(\"
\");\n",
" if (!fig.cell_info) {\n",
" console.error('Failed to find cell for figure', id, fig);\n",
" return;\n",
" }\n",
" fig.cell_info[0].output_area.element.on(\n",
" 'cleared',\n",
" { fig: fig },\n",
" fig._remove_fig_handler\n",
" );\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function (fig, msg) {\n",
" var width = fig.canvas.width / fig.ratio;\n",
" fig.cell_info[0].output_area.element.off(\n",
" 'cleared',\n",
" fig._remove_fig_handler\n",
" );\n",
" fig.resizeObserverInstance.unobserve(fig.canvas_div);\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable();\n",
" fig.parent_element.innerHTML =\n",
" '
';\n",
" fig.close_ws(fig, msg);\n",
"};\n",
"\n",
"mpl.figure.prototype.close_ws = function (fig, msg) {\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"};\n",
"\n",
"mpl.figure.prototype.push_to_output = function (_remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width / this.ratio;\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] =\n",
" '
';\n",
"};\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function () {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message('ack', {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () {\n",
" fig.push_to_output();\n",
" }, 1000);\n",
"};\n",
"\n",
"mpl.figure.prototype._init_toolbar = function () {\n",
" var fig = this;\n",
"\n",
" var toolbar = document.createElement('div');\n",
" toolbar.classList = 'btn-toolbar';\n",
" this.root.appendChild(toolbar);\n",
"\n",
" function on_click_closure(name) {\n",
" return function (_event) {\n",
" return fig.toolbar_button_onclick(name);\n",
" };\n",
" }\n",
"\n",
" function on_mouseover_closure(tooltip) {\n",
" return function (event) {\n",
" if (!event.currentTarget.disabled) {\n",
" return fig.toolbar_button_onmouseover(tooltip);\n",
" }\n",
" };\n",
" }\n",
"\n",
" fig.buttons = {};\n",
" var buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'btn-group';\n",
" var button;\n",
" for (var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" /* Instead of a spacer, we start a new button group. */\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
" buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'btn-group';\n",
" continue;\n",
" }\n",
"\n",
" button = fig.buttons[name] = document.createElement('button');\n",
" button.classList = 'btn btn-default';\n",
" button.href = '#';\n",
" button.title = name;\n",
" button.innerHTML = '';\n",
" button.addEventListener('click', on_click_closure(method_name));\n",
" button.addEventListener('mouseover', on_mouseover_closure(tooltip));\n",
" buttonGroup.appendChild(button);\n",
" }\n",
"\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = document.createElement('span');\n",
" status_bar.classList = 'mpl-message pull-right';\n",
" toolbar.appendChild(status_bar);\n",
" this.message = status_bar;\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = document.createElement('div');\n",
" buttongrp.classList = 'btn-group inline pull-right';\n",
" button = document.createElement('button');\n",
" button.classList = 'btn btn-mini btn-primary';\n",
" button.href = '#';\n",
" button.title = 'Stop Interaction';\n",
" button.innerHTML = '';\n",
" button.addEventListener('click', function (_evt) {\n",
" fig.handle_close(fig, {});\n",
" });\n",
" button.addEventListener(\n",
" 'mouseover',\n",
" on_mouseover_closure('Stop Interaction')\n",
" );\n",
" buttongrp.appendChild(button);\n",
" var titlebar = this.root.querySelector('.ui-dialog-titlebar');\n",
" titlebar.insertBefore(buttongrp, titlebar.firstChild);\n",
"};\n",
"\n",
"mpl.figure.prototype._remove_fig_handler = function (event) {\n",
" var fig = event.data.fig;\n",
" if (event.target !== this) {\n",
" // Ignore bubbled events from children.\n",
" return;\n",
" }\n",
" fig.close_ws(fig, {});\n",
"};\n",
"\n",
"mpl.figure.prototype._root_extra_style = function (el) {\n",
" el.style.boxSizing = 'content-box'; // override notebook setting of border-box.\n",
"};\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function (el) {\n",
" // this is important to make the div 'focusable\n",
" el.setAttribute('tabindex', 0);\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" } else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype._key_event_extra = function (event, _name) {\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which === 13) {\n",
" this.canvas_div.blur();\n",
" // select the cell after this one\n",
" var index = IPython.notebook.find_cell_index(this.cell_info[0]);\n",
" IPython.notebook.select(index + 1);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_save = function (fig, _msg) {\n",
" fig.ondownload(fig, null);\n",
"};\n",
"\n",
"mpl.find_output_cell = function (html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i = 0; i < ncells; i++) {\n",
" var cell = cells[i];\n",
" if (cell.cell_type === 'code') {\n",
" for (var j = 0; j < cell.output_area.outputs.length; j++) {\n",
" var data = cell.output_area.outputs[j];\n",
" if (data.data) {\n",
" // IPython >= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] === html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"};\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel !== null) {\n",
" IPython.notebook.kernel.comm_manager.register_target(\n",
" 'matplotlib',\n",
" mpl.mpl_figure_comm\n",
" );\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"_ = im.show(unit_ID=0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"or without source positions"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"/* global mpl */\n",
"window.mpl = {};\n",
"\n",
"mpl.get_websocket_type = function () {\n",
" if (typeof WebSocket !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof MozWebSocket !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert(\n",
" 'Your browser does not have WebSocket support. ' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.'\n",
" );\n",
" }\n",
"};\n",
"\n",
"mpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = this.ws.binaryType !== undefined;\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById('mpl-warnings');\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent =\n",
" 'This browser does not support binary websocket messages. ' +\n",
" 'Performance may be slow.';\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = document.createElement('div');\n",
" this.root.setAttribute('style', 'display: inline-block');\n",
" this._root_extra_style(this.root);\n",
"\n",
" parent_element.appendChild(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message('supports_binary', { value: fig.supports_binary });\n",
" fig.send_message('send_image_mode', {});\n",
" if (fig.ratio !== 1) {\n",
" fig.send_message('set_device_pixel_ratio', {\n",
" device_pixel_ratio: fig.ratio,\n",
" });\n",
" }\n",
" fig.send_message('refresh', {});\n",
" };\n",
"\n",
" this.imageObj.onload = function () {\n",
" if (fig.image_mode === 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function () {\n",
" fig.ws.close();\n",
" };\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"};\n",
"\n",
"mpl.figure.prototype._init_header = function () {\n",
" var titlebar = document.createElement('div');\n",
" titlebar.classList =\n",
" 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n",
" var titletext = document.createElement('div');\n",
" titletext.classList = 'ui-dialog-title';\n",
" titletext.setAttribute(\n",
" 'style',\n",
" 'width: 100%; text-align: center; padding: 3px;'\n",
" );\n",
" titlebar.appendChild(titletext);\n",
" this.root.appendChild(titlebar);\n",
" this.header = titletext;\n",
"};\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n",
"\n",
"mpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n",
"\n",
"mpl.figure.prototype._init_canvas = function () {\n",
" var fig = this;\n",
"\n",
" var canvas_div = (this.canvas_div = document.createElement('div'));\n",
" canvas_div.setAttribute(\n",
" 'style',\n",
" 'border: 1px solid #ddd;' +\n",
" 'box-sizing: content-box;' +\n",
" 'clear: both;' +\n",
" 'min-height: 1px;' +\n",
" 'min-width: 1px;' +\n",
" 'outline: 0;' +\n",
" 'overflow: hidden;' +\n",
" 'position: relative;' +\n",
" 'resize: both;'\n",
" );\n",
"\n",
" function on_keyboard_event_closure(name) {\n",
" return function (event) {\n",
" return fig.key_event(event, name);\n",
" };\n",
" }\n",
"\n",
" canvas_div.addEventListener(\n",
" 'keydown',\n",
" on_keyboard_event_closure('key_press')\n",
" );\n",
" canvas_div.addEventListener(\n",
" 'keyup',\n",
" on_keyboard_event_closure('key_release')\n",
" );\n",
"\n",
" this._canvas_extra_style(canvas_div);\n",
" this.root.appendChild(canvas_div);\n",
"\n",
" var canvas = (this.canvas = document.createElement('canvas'));\n",
" canvas.classList.add('mpl-canvas');\n",
" canvas.setAttribute('style', 'box-sizing: content-box;');\n",
"\n",
" this.context = canvas.getContext('2d');\n",
"\n",
" var backingStore =\n",
" this.context.backingStorePixelRatio ||\n",
" this.context.webkitBackingStorePixelRatio ||\n",
" this.context.mozBackingStorePixelRatio ||\n",
" this.context.msBackingStorePixelRatio ||\n",
" this.context.oBackingStorePixelRatio ||\n",
" this.context.backingStorePixelRatio ||\n",
" 1;\n",
"\n",
" this.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband_canvas = (this.rubberband_canvas = document.createElement(\n",
" 'canvas'\n",
" ));\n",
" rubberband_canvas.setAttribute(\n",
" 'style',\n",
" 'box-sizing: content-box; position: absolute; left: 0; top: 0; z-index: 1;'\n",
" );\n",
"\n",
" // Apply a ponyfill if ResizeObserver is not implemented by browser.\n",
" if (this.ResizeObserver === undefined) {\n",
" if (window.ResizeObserver !== undefined) {\n",
" this.ResizeObserver = window.ResizeObserver;\n",
" } else {\n",
" var obs = _JSXTOOLS_RESIZE_OBSERVER({});\n",
" this.ResizeObserver = obs.ResizeObserver;\n",
" }\n",
" }\n",
"\n",
" this.resizeObserverInstance = new this.ResizeObserver(function (entries) {\n",
" var nentries = entries.length;\n",
" for (var i = 0; i < nentries; i++) {\n",
" var entry = entries[i];\n",
" var width, height;\n",
" if (entry.contentBoxSize) {\n",
" if (entry.contentBoxSize instanceof Array) {\n",
" // Chrome 84 implements new version of spec.\n",
" width = entry.contentBoxSize[0].inlineSize;\n",
" height = entry.contentBoxSize[0].blockSize;\n",
" } else {\n",
" // Firefox implements old version of spec.\n",
" width = entry.contentBoxSize.inlineSize;\n",
" height = entry.contentBoxSize.blockSize;\n",
" }\n",
" } else {\n",
" // Chrome <84 implements even older version of spec.\n",
" width = entry.contentRect.width;\n",
" height = entry.contentRect.height;\n",
" }\n",
"\n",
" // Keep the size of the canvas and rubber band canvas in sync with\n",
" // the canvas container.\n",
" if (entry.devicePixelContentBoxSize) {\n",
" // Chrome 84 implements new version of spec.\n",
" canvas.setAttribute(\n",
" 'width',\n",
" entry.devicePixelContentBoxSize[0].inlineSize\n",
" );\n",
" canvas.setAttribute(\n",
" 'height',\n",
" entry.devicePixelContentBoxSize[0].blockSize\n",
" );\n",
" } else {\n",
" canvas.setAttribute('width', width * fig.ratio);\n",
" canvas.setAttribute('height', height * fig.ratio);\n",
" }\n",
" canvas.setAttribute(\n",
" 'style',\n",
" 'width: ' + width + 'px; height: ' + height + 'px;'\n",
" );\n",
"\n",
" rubberband_canvas.setAttribute('width', width);\n",
" rubberband_canvas.setAttribute('height', height);\n",
"\n",
" // And update the size in Python. We ignore the initial 0/0 size\n",
" // that occurs as the element is placed into the DOM, which should\n",
" // otherwise not happen due to the minimum size styling.\n",
" if (fig.ws.readyState == 1 && width != 0 && height != 0) {\n",
" fig.request_resize(width, height);\n",
" }\n",
" }\n",
" });\n",
" this.resizeObserverInstance.observe(canvas_div);\n",
"\n",
" function on_mouse_event_closure(name) {\n",
" return function (event) {\n",
" return fig.mouse_event(event, name);\n",
" };\n",
" }\n",
"\n",
" rubberband_canvas.addEventListener(\n",
" 'mousedown',\n",
" on_mouse_event_closure('button_press')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseup',\n",
" on_mouse_event_closure('button_release')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'dblclick',\n",
" on_mouse_event_closure('dblclick')\n",
" );\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband_canvas.addEventListener(\n",
" 'mousemove',\n",
" on_mouse_event_closure('motion_notify')\n",
" );\n",
"\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseenter',\n",
" on_mouse_event_closure('figure_enter')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseleave',\n",
" on_mouse_event_closure('figure_leave')\n",
" );\n",
"\n",
" canvas_div.addEventListener('wheel', function (event) {\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" on_mouse_event_closure('scroll')(event);\n",
" });\n",
"\n",
" canvas_div.appendChild(canvas);\n",
" canvas_div.appendChild(rubberband_canvas);\n",
"\n",
" this.rubberband_context = rubberband_canvas.getContext('2d');\n",
" this.rubberband_context.strokeStyle = '#000000';\n",
"\n",
" this._resize_canvas = function (width, height, forward) {\n",
" if (forward) {\n",
" canvas_div.style.width = width + 'px';\n",
" canvas_div.style.height = height + 'px';\n",
" }\n",
" };\n",
"\n",
" // Disable right mouse context menu.\n",
" this.rubberband_canvas.addEventListener('contextmenu', function (_e) {\n",
" event.preventDefault();\n",
" return false;\n",
" });\n",
"\n",
" function set_focus() {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"};\n",
"\n",
"mpl.figure.prototype._init_toolbar = function () {\n",
" var fig = this;\n",
"\n",
" var toolbar = document.createElement('div');\n",
" toolbar.classList = 'mpl-toolbar';\n",
" this.root.appendChild(toolbar);\n",
"\n",
" function on_click_closure(name) {\n",
" return function (_event) {\n",
" return fig.toolbar_button_onclick(name);\n",
" };\n",
" }\n",
"\n",
" function on_mouseover_closure(tooltip) {\n",
" return function (event) {\n",
" if (!event.currentTarget.disabled) {\n",
" return fig.toolbar_button_onmouseover(tooltip);\n",
" }\n",
" };\n",
" }\n",
"\n",
" fig.buttons = {};\n",
" var buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'mpl-button-group';\n",
" for (var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" /* Instead of a spacer, we start a new button group. */\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
" buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'mpl-button-group';\n",
" continue;\n",
" }\n",
"\n",
" var button = (fig.buttons[name] = document.createElement('button'));\n",
" button.classList = 'mpl-widget';\n",
" button.setAttribute('role', 'button');\n",
" button.setAttribute('aria-disabled', 'false');\n",
" button.addEventListener('click', on_click_closure(method_name));\n",
" button.addEventListener('mouseover', on_mouseover_closure(tooltip));\n",
"\n",
" var icon_img = document.createElement('img');\n",
" icon_img.src = '_images/' + image + '.png';\n",
" icon_img.srcset = '_images/' + image + '_large.png 2x';\n",
" icon_img.alt = tooltip;\n",
" button.appendChild(icon_img);\n",
"\n",
" buttonGroup.appendChild(button);\n",
" }\n",
"\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
"\n",
" var fmt_picker = document.createElement('select');\n",
" fmt_picker.classList = 'mpl-widget';\n",
" toolbar.appendChild(fmt_picker);\n",
" this.format_dropdown = fmt_picker;\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = document.createElement('option');\n",
" option.selected = fmt === mpl.default_extension;\n",
" option.innerHTML = fmt;\n",
" fmt_picker.appendChild(option);\n",
" }\n",
"\n",
" var status_bar = document.createElement('span');\n",
" status_bar.classList = 'mpl-message';\n",
" toolbar.appendChild(status_bar);\n",
" this.message = status_bar;\n",
"};\n",
"\n",
"mpl.figure.prototype.request_resize = function (x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', { width: x_pixels, height: y_pixels });\n",
"};\n",
"\n",
"mpl.figure.prototype.send_message = function (type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"};\n",
"\n",
"mpl.figure.prototype.send_draw_message = function () {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({ type: 'draw', figure_id: this.id }));\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_save = function (fig, _msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_resize = function (fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] !== fig.canvas.width || size[1] !== fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1], msg['forward']);\n",
" fig.send_message('refresh', {});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function (fig, msg) {\n",
" var x0 = msg['x0'] / fig.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / fig.ratio;\n",
" var x1 = msg['x1'] / fig.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / fig.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0,\n",
" 0,\n",
" fig.canvas.width / fig.ratio,\n",
" fig.canvas.height / fig.ratio\n",
" );\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function (fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_cursor = function (fig, msg) {\n",
" fig.rubberband_canvas.style.cursor = msg['cursor'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_message = function (fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_draw = function (fig, _msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function (fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_history_buttons = function (fig, msg) {\n",
" for (var key in msg) {\n",
" if (!(key in fig.buttons)) {\n",
" continue;\n",
" }\n",
" fig.buttons[key].disabled = !msg[key];\n",
" fig.buttons[key].setAttribute('aria-disabled', !msg[key]);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_navigate_mode = function (fig, msg) {\n",
" if (msg['mode'] === 'PAN') {\n",
" fig.buttons['Pan'].classList.add('active');\n",
" fig.buttons['Zoom'].classList.remove('active');\n",
" } else if (msg['mode'] === 'ZOOM') {\n",
" fig.buttons['Pan'].classList.remove('active');\n",
" fig.buttons['Zoom'].classList.add('active');\n",
" } else {\n",
" fig.buttons['Pan'].classList.remove('active');\n",
" fig.buttons['Zoom'].classList.remove('active');\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function () {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message('ack', {});\n",
"};\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function (fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" var img = evt.data;\n",
" if (img.type !== 'image/png') {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" img.type = 'image/png';\n",
" }\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src\n",
" );\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" img\n",
" );\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" } else if (\n",
" typeof evt.data === 'string' &&\n",
" evt.data.slice(0, 21) === 'data:image/png;base64'\n",
" ) {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig['handle_' + msg_type];\n",
" } catch (e) {\n",
" console.log(\n",
" \"No handler for the '\" + msg_type + \"' message type: \",\n",
" msg\n",
" );\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\n",
" \"Exception inside the 'handler_\" + msg_type + \"' callback:\",\n",
" e,\n",
" e.stack,\n",
" msg\n",
" );\n",
" }\n",
" }\n",
" };\n",
"};\n",
"\n",
"// from https://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function (e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e) {\n",
" e = window.event;\n",
" }\n",
" if (e.target) {\n",
" targ = e.target;\n",
" } else if (e.srcElement) {\n",
" targ = e.srcElement;\n",
" }\n",
" if (targ.nodeType === 3) {\n",
" // defeat Safari bug\n",
" targ = targ.parentNode;\n",
" }\n",
"\n",
" // pageX,Y are the mouse positions relative to the document\n",
" var boundingRect = targ.getBoundingClientRect();\n",
" var x = e.pageX - (boundingRect.left + document.body.scrollLeft);\n",
" var y = e.pageY - (boundingRect.top + document.body.scrollTop);\n",
"\n",
" return { x: x, y: y };\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * https://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys(original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object') {\n",
" obj[key] = original[key];\n",
" }\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function (event, name) {\n",
" var canvas_pos = mpl.findpos(event);\n",
"\n",
" if (name === 'button_press') {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * this.ratio;\n",
" var y = canvas_pos.y * this.ratio;\n",
"\n",
" this.send_message(name, {\n",
" x: x,\n",
" y: y,\n",
" button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event),\n",
" });\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"};\n",
"\n",
"mpl.figure.prototype._key_event_extra = function (_event, _name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"};\n",
"\n",
"mpl.figure.prototype.key_event = function (event, name) {\n",
" // Prevent repeat events\n",
" if (name === 'key_press') {\n",
" if (event.key === this._key) {\n",
" return;\n",
" } else {\n",
" this._key = event.key;\n",
" }\n",
" }\n",
" if (name === 'key_release') {\n",
" this._key = null;\n",
" }\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.key !== 'Control') {\n",
" value += 'ctrl+';\n",
" }\n",
" else if (event.altKey && event.key !== 'Alt') {\n",
" value += 'alt+';\n",
" }\n",
" else if (event.shiftKey && event.key !== 'Shift') {\n",
" value += 'shift+';\n",
" }\n",
"\n",
" value += 'k' + event.key;\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, { key: value, guiEvent: simpleKeys(event) });\n",
" return false;\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function (name) {\n",
" if (name === 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message('toolbar_button', { name: name });\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function (tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"\n",
"///////////////// REMAINING CONTENT GENERATED BY embed_js.py /////////////////\n",
"// prettier-ignore\n",
"var _JSXTOOLS_RESIZE_OBSERVER=function(A){var t,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,o=new Set;function s(e){if(!(this instanceof s))throw new TypeError(\"Constructor requires 'new' operator\");i.set(this,e)}function h(){throw new TypeError(\"Function is not a constructor\")}function c(e,t,i,n){e=0 in arguments?Number(arguments[0]):0,t=1 in arguments?Number(arguments[1]):0,i=2 in arguments?Number(arguments[2]):0,n=3 in arguments?Number(arguments[3]):0,this.right=(this.x=this.left=e)+(this.width=i),this.bottom=(this.y=this.top=t)+(this.height=n),Object.freeze(this)}function d(){t=requestAnimationFrame(d);var s=new WeakMap,p=new Set;o.forEach((function(t){r.get(t).forEach((function(i){var r=t instanceof window.SVGElement,o=a.get(t),d=r?0:parseFloat(o.paddingTop),f=r?0:parseFloat(o.paddingRight),l=r?0:parseFloat(o.paddingBottom),u=r?0:parseFloat(o.paddingLeft),g=r?0:parseFloat(o.borderTopWidth),m=r?0:parseFloat(o.borderRightWidth),w=r?0:parseFloat(o.borderBottomWidth),b=u+f,F=d+l,v=(r?0:parseFloat(o.borderLeftWidth))+m,W=g+w,y=r?0:t.offsetHeight-W-t.clientHeight,E=r?0:t.offsetWidth-v-t.clientWidth,R=b+v,z=F+W,M=r?t.width:parseFloat(o.width)-R-E,O=r?t.height:parseFloat(o.height)-z-y;if(n.has(t)){var k=n.get(t);if(k[0]===M&&k[1]===O)return}n.set(t,[M,O]);var S=Object.create(h.prototype);S.target=t,S.contentRect=new c(u,d,M,O),s.has(i)||(s.set(i,[]),p.add(i)),s.get(i).push(S)}))})),p.forEach((function(e){i.get(e).call(e,s.get(e),e)}))}return s.prototype.observe=function(i){if(i instanceof window.Element){r.has(i)||(r.set(i,new Set),o.add(i),a.set(i,window.getComputedStyle(i)));var n=r.get(i);n.has(this)||n.add(this),cancelAnimationFrame(t),t=requestAnimationFrame(d)}},s.prototype.unobserve=function(i){if(i instanceof window.Element&&r.has(i)){var n=r.get(i);n.has(this)&&(n.delete(this),n.size||(r.delete(i),o.delete(i))),n.size||r.delete(i),o.size||cancelAnimationFrame(t)}},A.DOMRectReadOnly=c,A.ResizeObserver=s,A.ResizeObserverEntry=h,A}; // eslint-disable-line\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Left button pans, Right button zooms\\nx/y fixes axis, CTRL fixes aspect\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\\nx/y fixes axis\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"jpeg\", \"pgf\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
"\n",
"mpl.default_extension = \"png\";/* global mpl */\n",
"\n",
"var comm_websocket_adapter = function (comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.binaryType = comm.kernel.ws.binaryType;\n",
" ws.readyState = comm.kernel.ws.readyState;\n",
" function updateReadyState(_event) {\n",
" if (comm.kernel.ws) {\n",
" ws.readyState = comm.kernel.ws.readyState;\n",
" } else {\n",
" ws.readyState = 3; // Closed state.\n",
" }\n",
" }\n",
" comm.kernel.ws.addEventListener('open', updateReadyState);\n",
" comm.kernel.ws.addEventListener('close', updateReadyState);\n",
" comm.kernel.ws.addEventListener('error', updateReadyState);\n",
"\n",
" ws.close = function () {\n",
" comm.close();\n",
" };\n",
" ws.send = function (m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function (msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" var data = msg['content']['data'];\n",
" if (data['blob'] !== undefined) {\n",
" data = {\n",
" data: new Blob(msg['buffers'], { type: data['blob'] }),\n",
" };\n",
" }\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(data);\n",
" });\n",
" return ws;\n",
"};\n",
"\n",
"mpl.mpl_figure_comm = function (comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = document.getElementById(id);\n",
" var ws_proxy = comm_websocket_adapter(comm);\n",
"\n",
" function ondownload(figure, _format) {\n",
" window.open(figure.canvas.toDataURL());\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy, ondownload, element);\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element;\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error('Failed to find cell for figure', id, fig);\n",
" return;\n",
" }\n",
" fig.cell_info[0].output_area.element.on(\n",
" 'cleared',\n",
" { fig: fig },\n",
" fig._remove_fig_handler\n",
" );\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function (fig, msg) {\n",
" var width = fig.canvas.width / fig.ratio;\n",
" fig.cell_info[0].output_area.element.off(\n",
" 'cleared',\n",
" fig._remove_fig_handler\n",
" );\n",
" fig.resizeObserverInstance.unobserve(fig.canvas_div);\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable();\n",
" fig.parent_element.innerHTML =\n",
" '
';\n",
" fig.close_ws(fig, msg);\n",
"};\n",
"\n",
"mpl.figure.prototype.close_ws = function (fig, msg) {\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"};\n",
"\n",
"mpl.figure.prototype.push_to_output = function (_remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width / this.ratio;\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] =\n",
" '
';\n",
"};\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function () {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message('ack', {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () {\n",
" fig.push_to_output();\n",
" }, 1000);\n",
"};\n",
"\n",
"mpl.figure.prototype._init_toolbar = function () {\n",
" var fig = this;\n",
"\n",
" var toolbar = document.createElement('div');\n",
" toolbar.classList = 'btn-toolbar';\n",
" this.root.appendChild(toolbar);\n",
"\n",
" function on_click_closure(name) {\n",
" return function (_event) {\n",
" return fig.toolbar_button_onclick(name);\n",
" };\n",
" }\n",
"\n",
" function on_mouseover_closure(tooltip) {\n",
" return function (event) {\n",
" if (!event.currentTarget.disabled) {\n",
" return fig.toolbar_button_onmouseover(tooltip);\n",
" }\n",
" };\n",
" }\n",
"\n",
" fig.buttons = {};\n",
" var buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'btn-group';\n",
" var button;\n",
" for (var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" /* Instead of a spacer, we start a new button group. */\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
" buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'btn-group';\n",
" continue;\n",
" }\n",
"\n",
" button = fig.buttons[name] = document.createElement('button');\n",
" button.classList = 'btn btn-default';\n",
" button.href = '#';\n",
" button.title = name;\n",
" button.innerHTML = '';\n",
" button.addEventListener('click', on_click_closure(method_name));\n",
" button.addEventListener('mouseover', on_mouseover_closure(tooltip));\n",
" buttonGroup.appendChild(button);\n",
" }\n",
"\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = document.createElement('span');\n",
" status_bar.classList = 'mpl-message pull-right';\n",
" toolbar.appendChild(status_bar);\n",
" this.message = status_bar;\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = document.createElement('div');\n",
" buttongrp.classList = 'btn-group inline pull-right';\n",
" button = document.createElement('button');\n",
" button.classList = 'btn btn-mini btn-primary';\n",
" button.href = '#';\n",
" button.title = 'Stop Interaction';\n",
" button.innerHTML = '';\n",
" button.addEventListener('click', function (_evt) {\n",
" fig.handle_close(fig, {});\n",
" });\n",
" button.addEventListener(\n",
" 'mouseover',\n",
" on_mouseover_closure('Stop Interaction')\n",
" );\n",
" buttongrp.appendChild(button);\n",
" var titlebar = this.root.querySelector('.ui-dialog-titlebar');\n",
" titlebar.insertBefore(buttongrp, titlebar.firstChild);\n",
"};\n",
"\n",
"mpl.figure.prototype._remove_fig_handler = function (event) {\n",
" var fig = event.data.fig;\n",
" if (event.target !== this) {\n",
" // Ignore bubbled events from children.\n",
" return;\n",
" }\n",
" fig.close_ws(fig, {});\n",
"};\n",
"\n",
"mpl.figure.prototype._root_extra_style = function (el) {\n",
" el.style.boxSizing = 'content-box'; // override notebook setting of border-box.\n",
"};\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function (el) {\n",
" // this is important to make the div 'focusable\n",
" el.setAttribute('tabindex', 0);\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" } else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype._key_event_extra = function (event, _name) {\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which === 13) {\n",
" this.canvas_div.blur();\n",
" // select the cell after this one\n",
" var index = IPython.notebook.find_cell_index(this.cell_info[0]);\n",
" IPython.notebook.select(index + 1);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_save = function (fig, _msg) {\n",
" fig.ondownload(fig, null);\n",
"};\n",
"\n",
"mpl.find_output_cell = function (html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i = 0; i < ncells; i++) {\n",
" var cell = cells[i];\n",
" if (cell.cell_type === 'code') {\n",
" for (var j = 0; j < cell.output_area.outputs.length; j++) {\n",
" var data = cell.output_area.outputs[j];\n",
" if (data.data) {\n",
" // IPython >= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] === html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"};\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel !== null) {\n",
" IPython.notebook.kernel.comm_manager.register_target(\n",
" 'matplotlib',\n",
" mpl.mpl_figure_comm\n",
" );\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"_ = im.show(unit_ID=0, sources=[])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"access table of point sources with full information"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Table length=1774\n",
"
\n",
"| index | ls_id | dec | ra | elat | elon | glat | glon | mjd_max | mjd_min | ref_id | brickid | blob_nea_g | blob_nea_r | blob_nea_z | bx | by | dchisq_1 | dchisq_2 | dchisq_3 | dchisq_4 | dchisq_5 | dec_ivar | dered_flux_g | dered_flux_r | dered_flux_w1 | dered_flux_w2 | dered_flux_w3 | dered_flux_w4 | dered_flux_z | dered_mag_g | dered_mag_r | dered_mag_w1 | dered_mag_w2 | dered_mag_w3 | dered_mag_w4 | dered_mag_z | ebv | fiberflux_g | fiberflux_r | fiberflux_z | fibertotflux_g | fibertotflux_r | fibertotflux_z | flux_g | flux_ivar_g | flux_ivar_r | flux_ivar_w1 | flux_ivar_w2 | flux_ivar_w3 | flux_ivar_w4 | flux_ivar_z | flux_r | flux_w1 | flux_w2 | flux_w3 | flux_w4 | flux_z | fracflux_g | fracflux_r | fracflux_w1 | fracflux_w2 | fracflux_w3 | fracflux_w4 | fracflux_z | fracin_g | fracin_r | fracin_z | fracmasked_g | fracmasked_r | fracmasked_z | gaia_a_g_val | gaia_astrometric_excess_noise | gaia_astrometric_excess_noise_sig | gaia_astrometric_sigma5d_max | gaia_astrometric_weight_al | gaia_e_bp_min_rp_val | gaia_phot_bp_mean_flux_over_error | gaia_phot_bp_mean_mag | gaia_phot_bp_rp_excess_factor | gaia_phot_g_mean_flux_over_error | gaia_phot_g_mean_mag | gaia_phot_rp_mean_flux_over_error | gaia_phot_rp_mean_mag | galdepth_g | galdepth_r | galdepth_z | g_r | htm9 | mag_g | mag_r | mag_w1 | mag_w2 | mag_w3 | mag_w4 | mag_z | mw_transmission_g | mw_transmission_r | mw_transmission_w1 | mw_transmission_w2 | mw_transmission_w3 | mw_transmission_w4 | mw_transmission_z | nea_g | nea_r | nea_z | nest4096 | objid | parallax_ivar | parallax | pmdec_ivar | pmdec | pmra_ivar | pmra | psfdepth_g | psfdepth_r | psfdepth_w1 | psfdepth_w2 | psfdepth_w3 | psfdepth_w4 | psfdepth_z | psfsize_g | psfsize_r | psfsize_z | ra_ivar | random_id | rchisq_g | rchisq_r | rchisq_w1 | rchisq_w2 | rchisq_w3 | rchisq_w4 | rchisq_z | ref_epoch | ring256 | r_z | sersic_ivar | sersic | shape_e1_ivar | shape_e1 | shape_e2_ivar | shape_e2 | shape_r_ivar | shape_r | snr_g | snr_r | snr_w1 | snr_w2 | snr_w3 | snr_w4 | snr_z | w1_w2 | w2_w3 | w3_w4 | wise_x | wise_y | z_w1 | allmask_g | allmask_r | allmask_z | anymask_g | anymask_r | anymask_z | brick_primary | fitbits | gaia_astrometric_n_good_obs_al | gaia_astrometric_n_obs_al | gaia_astrometric_params_solved | gaia_duplicated_source | gaia_phot_bp_n_obs | gaia_phot_g_n_obs | gaia_phot_rp_n_obs | gaia_phot_variable_flag | maskbits | nobs_g | nobs_r | nobs_w1 | nobs_w2 | nobs_w3 | nobs_w4 | nobs_z | release | wisemask_w1 | wisemask_w2 | brickname | ref_cat | type | wise_coadd_id |
\n",
"| int64 | int64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | int64 | int64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object | object | object | object | object | object | object | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object | float64 | float64 | float64 | float64 | object | object | object | object | float64 | float64 | object | object | float64 | float64 | float64 | object | int64 | object | object | object | object | object | object | object | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | int64 | int64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | int64 | object | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object | object | object | float64 | float64 | object | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | int64 | str8 | object | str3 | object |
\n",
"| 0 | 9906621427880926 | -0.0596966442535656 | 40.62011924313649 | -15.065612076628272 | 38.18117059409122 | -52.0014302658619 | 172.09502453470583 | 58383.33571984074 | 56609.15719128259 | 0 | 330530 | 467.8855285644531 | 477.57861328125 | 417.7110595703125 | 1866.5638427734375 | 979.240478515625 | 1646.1456298828125 | 2892.973876953125 | 2660.22607421875 | 2921.70654296875 | 3046.53955078125 | 1947283840.0 | 5.162485122680664 | 10.754593849182129 | 15.756853103637695 | -4.964320182800293 | -457.8344421386719 | -9338.2890625 | 21.07285499572754 | 20.717853546142578 | 19.9210147857666 | 19.50632667541504 | None | None | None | 19.190690994262695 | 0.0330439992249012 | 0.09433600306510925 | 0.20289699733257294 | 0.40927499532699585 | 0.12358000129461288 | 0.2589919865131378 | 0.5081660151481628 | 4.681422233581543 | 32.071346282958984 | 21.32268714904785 | 0.4657230079174042 | 0.1146709993481636 | 0.00048600000445730984 | 1.2000000424450263e-05 | 2.234360933303833 | 10.06881046295166 | 15.668862342834473 | -4.947277069091797 | -457.4987487792969 | -9335.703125 | 20.310331344604492 | 3.1861159801483154 | 3.967729091644287 | 2.5384230613708496 | 12.349665641784668 | 1.4074350595474243 | 1.1688940525054932 | 2.0946359634399414 | 0.6620759963989258 | 0.7054960131645203 | 0.8268700242042542 | 0.012373999692499638 | 0.006049999967217445 | 0.02180200070142746 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2114.56298828125 | 1714.4019775390625 | 169.06390380859375 | 0.8315010070800781 | 2130208 | 20.824054718017578 | 19.9925537109375 | 19.512405395507812 | None | None | None | 19.2307071685791 | 0.9068160057067871 | 0.9362329840660095 | 0.9944159984588623 | 0.9965670108795166 | 0.9992669820785522 | 0.9997230172157288 | 0.9638149738311768 | 454.9129638671875 | 466.2625732421875 | 472.42828369140625 | 72721713 | 5086 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3617.357421875 | 3292.601318359375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 338.22430419921875 | 1.3830150365829468 | 1.1824350357055664 | 1.1319890022277832 | 3666780416.0 | 17.915620803833008 | 1.057433009147644 | 1.0654560327529907 | 1.1137609481811523 | 0.5439130067825317 | 0.7047290205955505 | 0.19718900322914124 | 1.0607190132141113 | 0.0 | 392819 | 0.7618470191955566 | 865.250244140625 | 1.7043520212173462 | 6438.40771484375 | 0.18450599908828735 | 3010.94873046875 | -0.07660800218582153 | 45.1015625 | 9.851200103759766 | 26.511629104614258 | 46.49423599243164 | 10.693039894104004 | -1.6753029823303223 | -10.086878776550293 | -32.346343994140625 | 30.35943603515625 | None | None | None | 178.0042266845703 | 93.36387634277344 | -0.28169798851013184 | 0 | 0 | 0 | 2048 | 0 | 2048 | 1 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 10 | 190 | 186 | 32 | 32 | 10 | 9010 | 0 | 0 | 0406p000 | None | SER | 0408p000 |
\n",
"| 1 | 9906621427881087 | -0.0623163272297477 | 40.623065402091356 | -15.06902159391584 | 38.183220400882455 | -52.00138313276128 | 172.10142781051195 | 58383.33571984074 | 56609.15719128259 | 0 | 330530 | 24.246191024780273 | 22.495155334472656 | 22.58504867553711 | 1826.082275390625 | 943.2448120117188 | 43.216400146484375 | 56.24619674682617 | 50.48946762084961 | 56.78189468383789 | 0.0 | 339563200.0 | 0.24495400488376617 | 0.30178600549697876 | -1.4492039680480957 | -0.9096350073814392 | -62.076988220214844 | 10265.884765625 | 0.27090099453926086 | 24.02729034423828 | 23.800750732421875 | None | None | None | 12.471508979797363 | 23.917972564697266 | 0.03309100121259689 | 0.0439319983124733 | 0.055883001536130905 | 0.05164400115609169 | 0.08324000239372253 | 0.13166899979114532 | 0.18930600583553314 | 0.2220969945192337 | 661.2816772460938 | 455.6537170410156 | 2.655272960662842 | 0.5815430283546448 | 0.0017229999648407102 | 2.499999936844688e-05 | 49.88501739501953 | 0.2825160026550293 | -1.441100001335144 | -0.9065070152282715 | -62.03140640258789 | 10263.0380859375 | 0.26108500361442566 | 2.6867940425872803 | 3.7322990894317627 | 4.522994041442871 | 11.496638298034668 | 3.9386661052703857 | 1.0164799690246582 | 7.244499206542969 | 0.9999619722366333 | 0.9999920129776001 | 0.9999909996986389 | 1.4000000192027073e-05 | 5.500000042957254e-05 | 9.999999974752427e-07 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2242.47802734375 | 1714.4019775390625 | 191.19973754882812 | 0.26124998927116394 | 2130208 | 24.133644104003906 | 23.872394561767578 | None | None | None | 12.471810340881348 | 23.958045959472656 | 0.9066879749298096 | 0.936145007610321 | 0.9944080114364624 | 0.9965620040893555 | 0.9992660284042358 | 0.9997230172157288 | 0.9637640118598938 | 24.24436378479004 | 22.494373321533203 | 22.584474563598633 | 72721691 | 5247 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3776.75146484375 | 3292.601318359375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 388.1197509765625 | 1.3830150365829468 | 1.1824350357055664 | 1.1319890022277832 | 342490176.0 | 60.75627899169922 | 1.034140944480896 | 1.0320279598236084 | 0.5530589818954468 | 0.7939940094947815 | 0.7103189826011658 | 0.18145999312400818 | 1.0766299962997437 | 0.0 | 392819 | -0.08565100282430649 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 35.12828826904297 | 1.3452750444412231 | 5.711305141448975 | 6.03059196472168 | -2.348273992538452 | -0.6912930011749268 | -2.574662923812866 | 51.52722930908203 | 1.8440239429473877 | None | None | None | 174.1473846435547 | 89.93446350097656 | None | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 8192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 10 | 190 | 188 | 32 | 32 | 10 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 2 | 9906621427881150 | -0.0617126599008883 | 40.624169605736974 | -15.068793438627758 | 38.18450206004308 | -52.000193278354445 | 172.10209342588374 | 58383.33571984074 | 56609.15719128259 | 0 | 330530 | 14.634927749633789 | 13.11308765411377 | 13.067346572875977 | 1810.9100341796875 | 951.5394897460938 | 150.77816772460938 | 220.9669952392578 | 221.67379760742188 | 223.13836669921875 | 0.0 | 1766679936.0 | 0.292136013507843 | 0.4450330138206482 | -0.6003980040550232 | -5.130126953125 | -81.71771240234375 | -20939.10546875 | 0.4696210026741028 | 23.836036682128906 | 23.379018783569336 | None | None | None | None | 23.320632934570312 | 0.033107999712228775 | 0.08127900213003159 | 0.12784400582313538 | 0.13888899981975555 | 0.13926300406455994 | 0.23452900350093842 | 0.3369689881801605 | 0.2648639976978302 | 1083.849609375 | 772.7154541015625 | 2.9491159915924072 | 0.6424890160560608 | 0.0018479999853298068 | 2.5999999706982635e-05 | 86.09394073486328 | 0.4166019856929779 | -0.597038984298706 | -5.112481117248535 | -81.65767669677734 | -20933.294921875 | 0.4525949954986572 | 1.9915679693222046 | 2.0565381050109863 | 10.177206039428711 | 2.3827788829803467 | 2.520124912261963 | 1.0310930013656616 | 3.4471280574798584 | 1.0 | 1.0 | 1.0 | 0.0001140000022132881 | 0.00018099999579135329 | 5.900000178371556e-05 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2242.47802734375 | 1714.4019775390625 | 191.19973754882812 | 0.4917469918727875 | 2130208 | 23.94244384765625 | 23.45069694519043 | None | None | None | None | 23.36072540283203 | 0.9066439867019653 | 0.9361140131950378 | 0.9944049715995789 | 0.9965599775314331 | 0.9992650151252747 | 0.9997230172157288 | 0.9637460112571716 | 14.634770393371582 | 13.112796783447266 | 13.067222595214844 | 72721691 | 5310 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3776.75146484375 | 3292.601318359375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 388.1197509765625 | 1.3830150365829468 | 1.1824350357055664 | 1.1319890022277832 | 1763787648.0 | 88.2330551147461 | 1.0551890134811401 | 1.0314769744873047 | 0.4325700104236603 | 0.9510769844055176 | 0.6041510105133057 | 0.2155040055513382 | 1.0371739864349365 | 0.0 | 392819 | 0.08997199684381485 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 181.111572265625 | 0.9221069812774658 | 8.719809532165527 | 11.580602645874023 | -1.0252939462661743 | -4.097931861877441 | -3.510672092437744 | -107.08924102783203 | 4.199485778808594 | None | None | None | 172.7018585205078 | 90.7247314453125 | None | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 10 | 190 | 186 | 32 | 32 | 10 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 3 | 9906621427881200 | -0.06202417998442 | 40.62505067249319 | -15.069364815699263 | 38.185267888074726 | -51.999830243709134 | 172.10349211762343 | 58383.33571984074 | 56609.15719128259 | 0 | 330530 | 42.928157806396484 | 40.891326904296875 | 41.187660217285156 | 1798.8037109375 | 947.259033203125 | 34.448726654052734 | 51.054630279541016 | 43.0936164855957 | 51.06391525268555 | 0.0 | 267216784.0 | 0.44961801171302795 | 0.3388569951057434 | -0.3797760009765625 | 0.5928159952163696 | 109.0291976928711 | 27077.255859375 | 0.639303982257843 | 23.367889404296875 | 23.674959182739258 | None | 23.06770133972168 | 17.406143188476562 | 11.418489456176758 | 22.98573112487793 | 0.03312100097537041 | 0.048454999923706055 | 0.03770599886775017 | 0.07323899865150452 | 0.10356300324201584 | 0.14082500338554382 | 0.2633950114250183 | 0.40762799978256226 | 371.26324462890625 | 249.342529296875 | 2.268620014190674 | 0.5069530010223389 | 0.0015510000521317124 | 2.4000000848900527e-05 | 27.289613723754883 | 0.3172000050544739 | -0.3776499927043915 | 0.5907760262489319 | 108.94906616210938 | 27069.740234375 | 0.616117000579834 | 3.8528060913085938 | 8.755197525024414 | 21.591487884521484 | 16.595314025878906 | 3.9890670776367188 | 0.9876180291175842 | 8.2838134765625 | 0.9999319911003113 | 0.9999840259552002 | 0.9999849796295166 | 1.4999999621068127e-05 | 1.4999999621068127e-05 | 0.0026320000179111958 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2242.47802734375 | 1714.4019775390625 | 191.19973754882812 | -0.2723259925842285 | 2130208 | 23.474340438842773 | 23.746665954589844 | None | 23.071443557739258 | 17.406940460205078 | 11.418789863586426 | 23.025840759277344 | 0.906607985496521 | 0.9360889792442322 | 0.9944030046463013 | 0.9965590238571167 | 0.9992650151252747 | 0.9997220039367676 | 0.9637320041656494 | 42.92242431640625 | 40.88931655883789 | 41.186256408691406 | 72721691 | 5360 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3776.75146484375 | 3292.601318359375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 388.1197509765625 | 1.3830150365829468 | 1.1824350357055664 | 1.1319890022277832 | 264750992.0 | 20.306846618652344 | 1.0184669494628906 | 1.0251020193099976 | 0.42803698778152466 | 0.7318800091743469 | 0.6768569946289062 | 0.27713900804519653 | 1.071571946144104 | 0.0 | 392819 | 0.7208250164985657 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 26.90282440185547 | 1.9484490156173706 | 7.854246139526367 | 5.008780002593994 | -0.5688149929046631 | 0.42063599824905396 | 4.290902137756348 | 133.4690399169922 | 3.218564987182617 | None | 5.66450309753418 | 5.9881510734558105 | 171.54844665527344 | 90.31692504882812 | None | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 8192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 10 | 190 | 187 | 32 | 32 | 10 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 4 | 9906621427881283 | -0.0620412573141515 | 40.62658864667505 | -15.069861893768735 | 38.18677525519102 | -51.99880713873107 | 172.10535746162319 | 58383.33571984074 | 56609.15719128259 | 0 | 330530 | 23.34120750427246 | 21.434358596801758 | 21.464996337890625 | 1777.6712646484375 | 947.0243530273438 | 118.29243469238281 | 162.1683807373047 | 171.34913635253906 | 182.4162139892578 | 182.3571014404297 | 1828070656.0 | 0.16673900187015533 | 0.4597789943218231 | 0.9479979872703552 | -0.36546701192855835 | -118.06358337402344 | -11059.818359375 | 1.3762990236282349 | 24.444904327392578 | 23.343626022338867 | 22.557981491088867 | None | None | None | 22.153217315673828 | 0.03314400091767311 | 0.03036700002849102 | 0.08646100014448166 | 0.26645800471305847 | 0.0974079966545105 | 0.2087710052728653 | 0.4941990077495575 | 0.15115700662136078 | 683.7384033203125 | 474.40863037109375 | 2.613168954849243 | 0.5692660212516785 | 0.0016919999616220593 | 2.499999936844688e-05 | 52.22922897338867 | 0.43037500977516174 | 0.94268798828125 | -0.36420801281929016 | -117.97676086425781 | -11056.74609375 | 1.3263490200042725 | 6.236969947814941 | 3.636876106262207 | 7.983317852020264 | 31.3293514251709 | 1.7209839820861816 | 1.1774159669876099 | 2.171905994415283 | 0.9999970197677612 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0006810000049881637 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2242.47802734375 | 1714.4019775390625 | 191.19973754882812 | 1.1360470056533813 | 2130208 | 24.551429748535156 | 23.415382385253906 | 22.56407928466797 | None | None | None | 22.193355560302734 | 0.9065459966659546 | 0.9360460042953491 | 0.9943990111351013 | 0.9965559840202332 | 0.9992650151252747 | 0.9997220039367676 | 0.9637069702148438 | 23.34088706970215 | 21.43387222290039 | 21.464786529541016 | 72721691 | 5443 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3776.75146484375 | 3292.601318359375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 388.1197509765625 | 1.3830150365829468 | 1.1824350357055664 | 1.1319890022277832 | 641656832.0 | 25.80420684814453 | 1.0280499458312988 | 1.0711489915847778 | 0.9517470002174377 | 0.45686599612236023 | 0.6882460117340088 | 0.35150599479675293 | 1.0902299880981445 | 0.0 | 392819 | 1.2220269441604614 | 0.0 | 1.0 | 210.86279296875 | -0.3664950132369995 | 164.17054748535156 | -0.25637900829315186 | 40.8438720703125 | 2.005995988845825 | 3.9525110721588135 | 9.3739595413208 | 1.5238829851150513 | -0.2747940123081207 | -4.852910995483398 | -55.2876091003418 | 9.58549690246582 | None | None | None | 169.5350799560547 | 90.29457092285156 | -0.37072399258613586 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 10 | 190 | 187 | 32 | 32 | 10 | 9010 | 0 | 0 | 0406p000 | None | EXP | 0408p000 |
\n",
"| 5 | 9906621427881091 | -0.0599341852412997 | 40.623128293757084 | -15.066778549503692 | 38.18405360191605 | -51.99957970395104 | 172.09889777847022 | 58383.33571984074 | 56609.15719128259 | 0 | 330530 | 21.521671295166016 | 19.836315155029297 | 19.8989315032959 | 1825.2181396484375 | 975.9765625 | 223.02261352539062 | 344.62677001953125 | 322.39666748046875 | 349.4620361328125 | 0.0 | 1987116800.0 | 0.5151659846305847 | 0.6646919846534729 | 0.03342499956488609 | -4.550840854644775 | -82.14376068115234 | -536.8516235351562 | 0.5908600091934204 | 23.22013282775879 | 22.943449020385742 | 26.189815521240234 | None | None | None | 23.0712890625 | 0.03309100121259689 | 0.10256200283765793 | 0.13662999868392944 | 0.12503699958324432 | 0.15845300257205963 | 0.24638499319553375 | 0.3249329924583435 | 0.4670960009098053 | 736.6183471679688 | 510.68011474609375 | 2.6836400032043457 | 0.5949029922485352 | 0.0017500000540167093 | 2.5999999706982635e-05 | 56.46744155883789 | 0.6222479939460754 | 0.0332380011677742 | -4.5351948738098145 | -82.08344268798828 | -536.7027587890625 | 0.5694500207901001 | 1.6265619993209839 | 2.2097890377044678 | 76.92623901367188 | 3.0910120010375977 | 2.8471179008483887 | 3.042140007019043 | 4.396245002746582 | 0.9996880292892456 | 1.0 | 1.0 | 1.2999999853491317e-05 | 1.9999999949504854e-06 | 7.000000096013537e-06 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2242.47802734375 | 1714.4019775390625 | 191.19973754882812 | 0.31139400601387024 | 2130208 | 23.32648468017578 | 23.015090942382812 | 26.195903778076172 | None | None | None | 23.111360549926758 | 0.9066900014877319 | 0.9361460208892822 | 0.9944080114364624 | 0.9965620040893555 | 0.9992660284042358 | 0.9997230172157288 | 0.9637640118598938 | 21.512657165527344 | 19.83587646484375 | 19.898765563964844 | 72721691 | 5251 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3776.75146484375 | 3292.601318359375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 388.1197509765625 | 1.3830150365829468 | 1.1824350357055664 | 1.1319890022277832 | 2008306688.0 | 30.959442138671875 | 1.078266978263855 | 1.0355050563812256 | 0.4374620020389557 | 0.658748984336853 | 0.5706790089607239 | 0.23492099344730377 | 1.0980219841003418 | 0.0 | 392819 | -0.09627000242471695 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 204.90603637695312 | 1.2377020120620728 | 12.677310943603516 | 14.061710357666016 | 0.05445000156760216 | -3.4979939460754395 | -3.4342219829559326 | -2.7189440727233887 | 4.279120922088623 | None | None | None | 174.06504821777344 | 93.05292510986328 | -3.084542989730835 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 10 | 188 | 187 | 32 | 32 | 10 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
\n",
"| 1767 | 9906621427885021 | 0.0343632667844006 | 40.71359938052103 | -15.005464740673053 | 38.303546851030106 | -51.86894437813492 | 172.10438264485038 | 58379.39080122075 | 56609.15719128259 | 0 | 330530 | 75.77909088134766 | 75.1276626586914 | 82.82982635498047 | 582.1029663085938 | 2271.667724609375 | 36.69354248046875 | 64.14915466308594 | 49.796573638916016 | 64.4947280883789 | 0.0 | 236581248.0 | 0.417385995388031 | 1.3655019998550415 | 4.278507232666016 | 4.283473014831543 | 401.3929748535156 | 6506.18505859375 | 1.3207080364227295 | 23.44865608215332 | 22.16176986694336 | 20.921770095825195 | 20.920509338378906 | 15.991076469421387 | 12.966684341430664 | 22.197982788085938 | 0.0340920016169548 | 0.02679399959743023 | 0.09059300273656845 | 0.09028500318527222 | 0.08175600320100784 | 0.1966789960861206 | 0.2842879891395569 | 0.37731999158859253 | 89.43973541259766 | 72.6101303100586 | 1.7315560579299927 | 0.39238399267196655 | 0.0011210000375285745 | 1.8000000636675395e-05 | 8.338361740112305 | 1.2757600545883179 | 4.253859043121338 | 4.268301010131836 | 401.08935546875 | 6504.326171875 | 1.2714320421218872 | 12.423064231872559 | 6.465582847595215 | 1.5644129514694214 | 3.823193073272705 | 2.160912036895752 | 0.9840289950370789 | 8.259774208068848 | 0.5014320015907288 | 0.607200026512146 | 0.7700430154800415 | 9.999999974752427e-07 | 4.999999873689376e-06 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 928.189453125 | 869.8348388671875 | 124.22787475585938 | 1.322646975517273 | 4080144 | 23.558225631713867 | 22.235578536987305 | 20.928041458129883 | 20.924362182617188 | 15.991897583007812 | 12.966994285583496 | 22.239267349243164 | 0.9040070176124573 | 0.9342790246009827 | 0.9942389726638794 | 0.9964579939842224 | 0.999243974685669 | 0.9997140169143677 | 0.9626889824867249 | 75.49812316894531 | 74.41145324707031 | 59.113197326660156 | 72721780 | 9181 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1552.956298828125 | 1702.255859375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 266.4612731933594 | 1.4062299728393555 | 1.206292986869812 | 1.0679409503936768 | 239587856.0 | 36.457340240478516 | 0.9367859959602356 | 0.9464390277862549 | 1.5287450551986694 | 0.6029450297355652 | 1.6302160024642944 | 0.19573700428009033 | 1.0429019927978516 | 0.0 | 392819 | -0.00368899991735816 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 32.23133087158203 | 2.7248001098632812 | 3.5684120655059814 | 10.870951652526855 | 5.597592830657959 | 2.6736879348754883 | 13.428531646728516 | 27.972782135009766 | 3.6714138984680176 | 0.00367900007404387 | 4.932465076446533 | 3.0249030590057373 | 55.629085540771484 | 216.49757385253906 | 1.3112260103225708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 8196 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 6 | 185 | 182 | 27 | 26 | 7 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 1768 | 9906621427885089 | 0.0352290038022054 | 40.71469931521928 | -15.004985603972438 | 38.30490849271063 | -51.86756364950615 | 172.1047552896533 | 58379.39080122075 | 56637.176398432595 | 0 | 330530 | 124.04808044433594 | 133.07015991210938 | 113.72339630126953 | 566.9893188476562 | 2283.563232421875 | 692.6819458007812 | 732.9837036132812 | 843.3509521484375 | 758.1797485351562 | 843.3512573242188 | 6414627328.0 | 1.4480849504470825 | 2.884779930114746 | -2.652904987335205 | -3.0344390869140625 | -519.8920288085938 | -1644.1492919921875 | 10.165831565856934 | 22.09801483154297 | 21.34971809387207 | None | None | None | None | 19.98214340209961 | 0.03412200137972832 | 0.11918199807405472 | 0.24538399279117584 | 0.8910419940948486 | 0.17469200491905212 | 0.3520430028438568 | 1.0564539432525635 | 1.3089599609375 | 54.37126159667969 | 47.91218566894531 | 0.8499730229377747 | 0.19398599863052368 | 0.0006140000186860561 | 1.2000000424450263e-05 | 4.9767961502075195 | 2.6950249671936035 | -2.6376090049743652 | -3.023682117462158 | -519.4984130859375 | -1643.67919921875 | 9.786200523376465 | 45.942344665527344 | 36.16743087768555 | 13.302993774414062 | 15.153066635131836 | 1.205888032913208 | 2.265007972717285 | 6.61246919631958 | 0.3682340085506439 | 0.4744589924812317 | 0.552685022354126 | 0.0010219999821856618 | 0.002302000066265464 | 0.0010679999832063913 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 928.189453125 | 953.9509887695312 | 101.44552612304688 | 0.784089982509613 | 4080144 | 22.207683563232422 | 21.423593521118164 | None | None | None | None | 20.02346420288086 | 0.9039250016212463 | 0.9342219829559326 | 0.994234025478363 | 0.9964550137519836 | 0.9992430210113525 | 0.9997140169143677 | 0.9626560211181641 | 133.98582458496094 | 118.55158996582031 | 110.22134399414062 | 72721780 | 9249 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1552.956298828125 | 1814.5594482421875 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 218.00839233398438 | 1.4062299728393555 | 1.2660930156707764 | 1.0747710466384888 | 4876993024.0 | 5.3856000900268555 | 0.984142005443573 | 1.0097969770431519 | 1.3211309909820557 | 0.624504029750824 | 1.4381730556488037 | 0.16069099307060242 | 1.0717970132827759 | 0.0 | 392819 | 1.400128960609436 | 0.0 | 4.0 | 1530.4237060546875 | -0.13646399974822998 | 1421.578857421875 | 0.05745000019669533 | 912.3961181640625 | 5.868800163269043 | 9.651865005493164 | 18.65459442138672 | -2.431715965270996 | -1.331747055053711 | -12.874268531799316 | -5.7384490966796875 | 21.83177375793457 | None | None | None | 54.18916320800781 | 217.6309051513672 | None | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 7 | 184 | 180 | 27 | 26 | 6 | 9010 | 0 | 0 | 0406p000 | None | DEV | 0408p000 |
\n",
"| 1769 | 9906621427885010 | 0.0365739652454537 | 40.71342126210118 | -15.003308904820534 | 38.3040860865869 | -51.86743005365373 | 172.10175837982993 | 58379.39080122075 | 56609.15719128259 | 0 | 330530 | 67.98094940185547 | 67.39523315429688 | 69.71142578125 | 584.5504150390625 | 2302.043701171875 | 88.94351196289062 | 150.88339233398438 | 138.6069793701172 | 162.2813262939453 | 0.0 | 401885216.0 | 0.7327389717102051 | 1.4268879890441895 | -2.783869981765747 | 0.8308590054512024 | -105.31672668457031 | 866.69921875 | 1.932239055633545 | 22.837627410888672 | 22.114025115966797 | None | 22.701181411743164 | None | 15.155328750610352 | 21.784847259521484 | 0.03410999849438667 | 0.051927000284194946 | 0.10450699925422668 | 0.14582599699497223 | 0.10110700130462646 | 0.20015600323677063 | 0.30870500206947327 | 0.6623650193214417 | 99.9150161743164 | 81.1334457397461 | 1.8355419635772705 | 0.41266700625419617 | 0.001155999954789877 | 1.8999999156221747e-05 | 9.892309188842773 | 1.333063006401062 | -2.7678239345550537 | 0.8279150128364563 | -105.23701477050781 | 866.4514770507812 | 1.8601069450378418 | 5.0328688621521 | 4.5657501220703125 | 4.276737213134766 | 21.637113571166992 | 3.5367720127105713 | 2.537398099899292 | 4.03259801864624 | 0.5006669759750366 | 0.6042709946632385 | 0.8027160167694092 | 0.0 | 0.0 | 9.000000318337698e-06 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 928.189453125 | 869.8348388671875 | 124.22787475585938 | 0.7593820095062256 | 4080144 | 22.947256088256836 | 22.18787384033203 | None | 22.705036163330078 | None | 15.1556396484375 | 21.826154708862305 | 0.9039580225944519 | 0.9342449903488159 | 0.9942359924316406 | 0.9964560270309448 | 0.9992430210113525 | 0.9997140169143677 | 0.9626690149307251 | 67.84654235839844 | 66.95738983154297 | 55.98678970336914 | 72721782 | 9170 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1552.956298828125 | 1702.255859375 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 266.4612731933594 | 1.4062299728393555 | 1.206292986869812 | 1.0679409503936768 | 402443360.0 | 96.10211944580078 | 0.9811199903488159 | 0.9764789938926697 | 1.0834180116653442 | 0.6053789854049683 | 0.9673579931259155 | 0.19862399995326996 | 1.0192320346832275 | 0.0 | 392819 | 0.361719012260437 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 46.17560958862305 | 2.5599119663238525 | 6.6208319664001465 | 12.007442474365234 | -3.7499070167541504 | 0.531844973564148 | -3.57851505279541 | 3.748948097229004 | 5.85041618347168 | None | None | None | 55.86225891113281 | 219.39158630371094 | None | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 6 | 186 | 183 | 27 | 26 | 7 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 1770 | 9906621427885104 | 0.0362756713991508 | 40.714927950222716 | -15.004062600324781 | 38.30547161423829 | -51.866635934479326 | 172.10388750413452 | 58379.39080122075 | 56637.176398432595 | 0 | 330530 | 73.46151733398438 | 78.65818786621094 | 72.81626892089844 | 563.8477783203125 | 2297.945068359375 | 34.85002899169922 | 80.08702850341797 | 53.797325134277344 | 80.81307983398438 | 0.0 | 246363952.0 | 0.7220979928970337 | 1.1754339933395386 | 0.23305100202560425 | 0.18852199614048004 | 299.42156982421875 | -4161.88330078125 | 1.406520962715149 | 22.8535099029541 | 22.324504852294922 | 24.081371307373047 | 24.311595916748047 | 16.30929183959961 | None | 22.129634857177734 | 0.034136999398469925 | 0.04690900072455406 | 0.07891900092363358 | 0.09730999916791916 | 0.10248400270938873 | 0.18646399676799774 | 0.2946929931640625 | 0.6526939868927002 | 92.13147735595703 | 81.60848236083984 | 1.7464770078659058 | 0.3899669945240021 | 0.0011139999842271209 | 1.8000000636675395e-05 | 7.837000846862793 | 1.0980839729309082 | 0.23170700669288635 | 0.18785299360752106 | 299.19476318359375 | -4160.6923828125 | 1.3539739847183228 | 5.737536907196045 | 5.7239460945129395 | 47.080101013183594 | 90.81819915771484 | 2.573812961578369 | 1.1929279565811157 | 8.402780532836914 | 0.5232539772987366 | 0.6610850095748901 | 0.7545639872550964 | 0.0 | 9.999999974752427e-07 | 1.9999999949504854e-06 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 928.189453125 | 953.9509887695312 | 101.44552612304688 | 0.5648159980773926 | 4080144 | 22.963226318359375 | 22.39841079711914 | 24.0876522064209 | 24.315452575683594 | 16.310115814208984 | None | 22.170974731445312 | 0.903885006904602 | 0.934194028377533 | 0.9942309856414795 | 0.9964529871940613 | 0.9992430210113525 | 0.9997140169143677 | 0.9626399874687195 | 71.5634765625 | 69.7564468383789 | 71.8677749633789 | 72721780 | 9264 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1552.956298828125 | 1814.5594482421875 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 218.00839233398438 | 1.4062299728393555 | 1.2660930156707764 | 1.0747710466384888 | 255372240.0 | 97.8615493774414 | 0.987729012966156 | 0.9839119911193848 | 1.2551709413528442 | 0.5994330048561096 | 1.0351450443267822 | 0.14302000403404236 | 1.0221220254898071 | 0.0 | 392819 | 0.22743600606918335 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 32.18492126464844 | 2.7041800022125244 | 6.264890193939209 | 9.919805526733398 | 0.306210994720459 | 0.11730899661779404 | 9.986048698425293 | -17.859115600585938 | 3.790400981903076 | -0.22779999673366547 | 8.00533676147461 | None | 53.88985824584961 | 219.00108337402344 | -1.9166769981384277 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 8192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 7 | 184 | 180 | 27 | 26 | 6 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 1771 | 9906621427885330 | 0.0339645305720009 | 40.71857574001522 | -15.007396878678943 | 38.30831263708318 | -51.865887704074446 | 172.11077494009248 | 58379.39080122075 | 56637.176398432595 | 0 | 330530 | 299.2601623535156 | 285.0848083496094 | 307.6664733886719 | 513.725341796875 | 2266.18896484375 | 14050.7890625 | 35409.46484375 | 37588.86328125 | 35528.11328125 | 37626.26953125 | 125965008896.0 | 23.515390396118164 | 36.3426399230957 | 0.07495500147342682 | -5.373929023742676 | -862.2980346679688 | -3545.82080078125 | 49.19404602050781 | 19.071619033813477 | 18.59895896911621 | 25.312997817993164 | None | None | None | 18.270217895507812 | 0.03418700024485588 | 0.9927240014076233 | 1.5857599973678589 | 2.211970090866089 | 1.024737000465393 | 1.6500600576400757 | 2.329941987991333 | 21.252098083496094 | 26.42991065979004 | 20.978235244750977 | 0.44944098591804504 | 0.10625199973583221 | 0.000375000003259629 | 9.000000318337698e-06 | 1.826225996017456 | 33.94773864746094 | 0.074522003531456 | -5.354842185974121 | -861.6439819335938 | -3544.804931640625 | 47.35354995727539 | 4.734735012054443 | 4.630583763122559 | 1238.972412109375 | 18.341552734375 | 0.9381380081176758 | 1.8909740447998047 | 6.499423027038574 | 0.4557499885559082 | 0.531944990158081 | 0.4663589894771576 | 0.02070399932563305 | 0.02774300053715706 | 0.01868700049817562 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1062.288818359375 | 953.9509887695312 | 101.44552612304688 | 0.5085219740867615 | 4080144 | 19.181495666503906 | 18.6729736328125 | 25.31928825378418 | None | None | None | 18.31161880493164 | 0.9037529826164246 | 0.9341019988059998 | 0.9942229986190796 | 0.9964479804039001 | 0.9992409944534302 | 0.9997130036354065 | 0.9625869989395142 | 301.6131591796875 | 276.80413818359375 | 305.4925537109375 | 72721780 | 9490 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1720.8885498046875 | 1814.5594482421875 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 218.00839233398438 | 1.5080360174179077 | 1.2660930156707764 | 1.0747710466384888 | 129698824192.0 | 60.819786071777344 | 1.0118199586868286 | 1.0126080513000488 | 1.7950060367584229 | 0.6516309976577759 | 1.4471759796142578 | 0.18490399420261383 | 1.0321500301361084 | 0.0 | 392819 | 0.3613550066947937 | 1411.2440185546875 | 3.6423580646514893 | 74907.6875 | -0.04349900037050247 | 102543.359375 | 0.052886001765728 | 53652.07421875 | 9.456720352172852 | 109.25709533691406 | 155.48744201660156 | 0.049959998577833176 | -1.7454839944839478 | -16.67528533935547 | -10.364204406738281 | 63.99260330200195 | None | None | None | 49.11454772949219 | 215.9755859375 | -7.007668972015381 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 7 | 185 | 180 | 27 | 26 | 6 | 9010 | 0 | 0 | 0406p000 | None | SER | 0408p000 |
\n",
"| 1772 | 9906621427885159 | 0.0362750460534613 | 40.715927105330636 | -15.00437507125113 | 38.30645414990661 | -51.86596352775241 | 172.1050843326959 | 58379.39080122075 | 56637.176398432595 | 0 | 330530 | 22.777883529663086 | 21.031858444213867 | 19.226781845092773 | 550.118896484375 | 2297.9365234375 | 98.87203979492188 | 152.26747131347656 | 151.30484008789062 | 156.5274658203125 | 0.0 | 865932096.0 | 0.31279799342155457 | 0.5988730192184448 | 0.10562100261449814 | -0.13466300070285797 | -163.84344482421875 | 2591.39013671875 | 1.1920000314712524 | 23.761838912963867 | 23.056663513183594 | 24.94062614440918 | None | None | 13.966168403625488 | 22.309309005737305 | 0.03415700048208237 | 0.06339400261640549 | 0.12544499337673187 | 0.2572929859161377 | 0.1226319968700409 | 0.23677599430084229 | 0.4467400014400482 | 0.2827169895172119 | 378.27374267578125 | 304.7899475097656 | 2.716197967529297 | 0.576125979423523 | 0.001478999969549477 | 2.099999983329326e-05 | 29.61675262451172 | 0.5594419836997986 | 0.1050110012292862 | -0.13418500125408173 | -163.71926879882812 | 2590.6484375 | 1.1474419832229614 | 3.785533905029297 | 3.15720796585083 | 80.30736541748047 | 81.6451416015625 | 1.210407018661499 | 1.1694010496139526 | 2.3305439949035645 | 0.599727988243103 | 0.699292004108429 | 0.7500090003013611 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1062.288818359375 | 953.9509887695312 | 101.44552612304688 | 0.7410069704055786 | 4080144 | 23.871620178222656 | 23.130613327026367 | 24.946910858154297 | None | None | 13.96647834777832 | 22.35067367553711 | 0.9038320183753967 | 0.9341570138931274 | 0.9942280054092407 | 0.9964510202407837 | 0.9992420077323914 | 0.9997140169143677 | 0.9626190066337585 | 20.963794708251953 | 20.99135398864746 | 19.226377487182617 | 72721780 | 9319 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1720.8885498046875 | 1814.5594482421875 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 218.00839233398438 | 1.5080360174179077 | 1.2660930156707764 | 1.0747710466384888 | 869271296.0 | 72.71266174316406 | 0.9824910163879395 | 0.9388589859008789 | 1.0256919860839844 | 0.6262819766998291 | 1.0651559829711914 | 0.17060600221157074 | 1.0427039861679077 | 0.0 | 392819 | 0.7799400091171265 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 90.18597412109375 | 1.2165780067443848 | 5.498635768890381 | 9.766861915588379 | 0.17306800186634064 | -0.1018500030040741 | -6.296734809875488 | 11.894451141357422 | 6.244524002075195 | None | None | None | 52.58186721801758 | 219.00027465820312 | -2.5962369441986084 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 7 | 184 | 180 | 27 | 26 | 6 | 9010 | 0 | 0 | 0406p000 | None | REX | 0408p000 |
\n",
"| 1773 | 9906621427885380 | 0.0347008224043375 | 40.719417727401215 | -15.006960179952708 | 38.30937873713056 | -51.864776367641156 | 172.11097977682363 | 58379.39080122075 | 56637.176398432595 | 0 | 330530 | 4.470592021942139 | 3.3521180152893066 | 2.6641650199890137 | 502.156005859375 | 2276.305908203125 | 33.25917053222656 | 31.90662384033203 | 0.0 | 0.0 | 0.0 | 966680128.0 | 0.1022540032863617 | 0.05175299942493439 | 1.3805040121078491 | 0.21447600424289703 | 61.110042572021484 | 2080.1845703125 | 0.05801599845290184 | 24.97580337524414 | 25.715166091918945 | 22.149906158447266 | 24.171554565429688 | 18.034719467163086 | 14.204745292663574 | 25.59113121032715 | 0.03421099856495857 | 0.07195000350475311 | 0.03763899952173233 | 0.04348199814558029 | 0.2023259997367859 | 0.25828200578689575 | 0.37011900544166565 | 0.09240499883890152 | 3157.16064453125 | 2741.422119140625 | 3.1083500385284424 | 0.6537500023841858 | 0.0016580000519752502 | 2.2000000171829015e-05 | 213.0670623779297 | 0.048340000212192535 | 1.3725240230560303 | 0.21371300518512726 | 61.063655853271484 | 2079.588134765625 | 0.05584400147199631 | 4.568105220794678 | 12.941338539123535 | 7.9180989265441895 | 51.84758758544922 | 6.31870698928833 | 1.103742003440857 | 12.619765281677246 | 0.9849709868431091 | 0.9971449971199036 | 1.0 | 0.0 | 0.08126900345087051 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2002.48828125 | 1494.6295166015625 | 101.44552612304688 | -0.7034760117530823 | 4080144 | 25.085756301879883 | 25.78923225402832 | 22.156200408935547 | 24.1754207611084 | 18.03554344177246 | 14.205057144165039 | 25.63256072998047 | 0.9036890268325806 | 0.9340569972991943 | 0.9942190051078796 | 0.9964460134506226 | 0.9992409944534302 | 0.9997130036354065 | 0.9625610113143921 | 4.33040189743042 | 3.431334972381592 | 2.6641180515289307 | 72721781 | 9540 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3324.9697265625 | 2863.93017578125 | 4.136185169219971 | 0.7482050061225891 | 0.0018469999777153134 | 2.499999936844688e-05 | 218.00839233398438 | 1.413915991783142 | 1.2327289581298828 | 1.0747710466384888 | 927159872.0 | 79.35669708251953 | 0.9237470030784607 | 0.9635390043258667 | 1.2210220098495483 | 0.3903310000896454 | 0.7064099907875061 | 0.10528499633073807 | 0.9970179796218872 | 0.0 | 392819 | 0.15667200088500977 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 5.192130088806152 | 2.5310161113739014 | 2.419830083847046 | 0.17279799282550812 | 2.4860620498657227 | 9.723958015441895 | 0.8151440024375916 | -2.0192201137542725 | 6.139876842498779 | 3.8304860591888428 | 48.01230239868164 | 216.939453125 | 3.4763600826263428 | 0 | 0 | 0 | 0 | 2048 | 0 | 1 | 8192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 10 | 184 | 180 | 27 | 26 | 6 | 9010 | 0 | 0 | 0406p000 | None | PSF | 0408p000 |
\n",
"
"
],
"text/plain": [
"\n",
"index ls_id dec ... ref_cat type wise_coadd_id\n",
"int64 int64 float64 ... object str3 object \n",
"----- ---------------- ------------------- ... ------- ---- -------------\n",
" 0 9906621427880926 -0.0596966442535656 ... None SER 0408p000\n",
" 1 9906621427881087 -0.0623163272297477 ... None REX 0408p000\n",
" 2 9906621427881150 -0.0617126599008883 ... None REX 0408p000\n",
" 3 9906621427881200 -0.06202417998442 ... None REX 0408p000\n",
" 4 9906621427881283 -0.0620412573141515 ... None EXP 0408p000\n",
" 5 9906621427881091 -0.0599341852412997 ... None REX 0408p000\n",
" ... ... ... ... ... ... ...\n",
" 1767 9906621427885021 0.0343632667844006 ... None REX 0408p000\n",
" 1768 9906621427885089 0.0352290038022054 ... None DEV 0408p000\n",
" 1769 9906621427885010 0.0365739652454537 ... None REX 0408p000\n",
" 1770 9906621427885104 0.0362756713991508 ... None REX 0408p000\n",
" 1771 9906621427885330 0.0339645305720009 ... None SER 0408p000\n",
" 1772 9906621427885159 0.0362750460534613 ... None REX 0408p000\n",
" 1773 9906621427885380 0.0347008224043375 ... None PSF 0408p000"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_collection.dispatcher_catalog_1.table"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Photometry data"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"please beware that by default, in a typical setup, oda_api will not output much. To learn how to increase the verbosity, please refer to the documentation: https://oda-api.readthedocs.io/en/latest/user_guide/ScienceWindowList.html?highlight=logging#Let's-get-some-logging . \n",
"To disable this message you can pass `.get_product(..., silent=True)`\n",
"/home/dsavchenko/Projects/cloud/dispatcher-container/oda_api/oda_api/api.py:1046: UserWarning: \n",
"----------------------------------------------------------------------------\n",
"the parameter: T_format is not among valid ones:\n",
"['src_name', 'RA', 'DEC', 'T1', 'T2', 'token', 'data_release', 'radius_photometry']\n",
"this will throw an error in a future version \n",
"and might break the current request!\n",
" ----------------------------------------------------------------------------\n",
"\n",
" warnings.warn(msg)\n"
]
}
],
"source": [
"par_dict={\n",
" \"DEC\": -0.013294166666667,\n",
" \"RA\": 40.66962125,\n",
" \"T1\": \"2017-03-06T13:26:48.000\",\n",
" \"T2\": \"2017-03-06T15:32:27.000\",\n",
" \"T_format\": \"isot\",\n",
" \"data_release\": 9,\n",
" \"instrument\": \"legacysurvey\",\n",
" \"product\": \"legacy_survey_photometry\",\n",
" \"product_type\": \"Real\",\n",
" \"radius_photometry\": 1.0,\n",
" \"src_name\": \"NGC1068\"\n",
"}\n",
"\n",
"data_collection = disp.get_product(**par_dict)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ID=0 prod_name=legacy_survey_photometry_0 meta_data: OrderedDict()\n",
"\n"
]
}
],
"source": [
"data_collection.show()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Table length=7\n",
"
\n",
"| E | nuFnu | nuFnu_err |
\n",
"| eV | erg / (cm2 s) | erg / (cm2 s) |
\n",
"| float64 | float64 | float64 |
\n",
"| 2.6010488659898483 | 3.577386033401825e-09 | 6.891867799656037e-14 |
\n",
"| 1.9911736624573224 | 5.1539002648992134e-09 | 6.463046950134752e-14 |
\n",
"| 1.3583318470299512 | 5.885992256374001e-09 | 8.391345448800664e-14 |
\n",
"| 0.36837895162623446 | 5.252805568437323e-10 | 9.874500806718558e-14 |
\n",
"| 0.268666156144902 | 1.7949798087414824e-10 | 1.512230428245725e-13 |
\n",
"| 0.10268997757632492 | 2.723142536544446e-09 | 2.069919112844245e-13 |
\n",
"| 0.0559025100962944 | 3.793626668689848e-09 | 4.909453055210824e-13 |
\n",
"
"
],
"text/plain": [
"\n",
" E nuFnu nuFnu_err \n",
" eV erg / (cm2 s) erg / (cm2 s) \n",
" float64 float64 float64 \n",
"------------------- ---------------------- ---------------------\n",
" 2.6010488659898483 3.577386033401825e-09 6.891867799656037e-14\n",
" 1.9911736624573224 5.1539002648992134e-09 6.463046950134752e-14\n",
" 1.3583318470299512 5.885992256374001e-09 8.391345448800664e-14\n",
"0.36837895162623446 5.252805568437323e-10 9.874500806718558e-14\n",
" 0.268666156144902 1.7949798087414824e-10 1.512230428245725e-13\n",
"0.10268997757632492 2.723142536544446e-09 2.069919112844245e-13\n",
" 0.0559025100962944 3.793626668689848e-09 4.909453055210824e-13"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ph_data = data_collection.legacy_survey_photometry_0\n",
"ph_data"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"/* global mpl */\n",
"window.mpl = {};\n",
"\n",
"mpl.get_websocket_type = function () {\n",
" if (typeof WebSocket !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof MozWebSocket !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert(\n",
" 'Your browser does not have WebSocket support. ' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.'\n",
" );\n",
" }\n",
"};\n",
"\n",
"mpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = this.ws.binaryType !== undefined;\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById('mpl-warnings');\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent =\n",
" 'This browser does not support binary websocket messages. ' +\n",
" 'Performance may be slow.';\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = document.createElement('div');\n",
" this.root.setAttribute('style', 'display: inline-block');\n",
" this._root_extra_style(this.root);\n",
"\n",
" parent_element.appendChild(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message('supports_binary', { value: fig.supports_binary });\n",
" fig.send_message('send_image_mode', {});\n",
" if (fig.ratio !== 1) {\n",
" fig.send_message('set_device_pixel_ratio', {\n",
" device_pixel_ratio: fig.ratio,\n",
" });\n",
" }\n",
" fig.send_message('refresh', {});\n",
" };\n",
"\n",
" this.imageObj.onload = function () {\n",
" if (fig.image_mode === 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function () {\n",
" fig.ws.close();\n",
" };\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"};\n",
"\n",
"mpl.figure.prototype._init_header = function () {\n",
" var titlebar = document.createElement('div');\n",
" titlebar.classList =\n",
" 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n",
" var titletext = document.createElement('div');\n",
" titletext.classList = 'ui-dialog-title';\n",
" titletext.setAttribute(\n",
" 'style',\n",
" 'width: 100%; text-align: center; padding: 3px;'\n",
" );\n",
" titlebar.appendChild(titletext);\n",
" this.root.appendChild(titlebar);\n",
" this.header = titletext;\n",
"};\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n",
"\n",
"mpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n",
"\n",
"mpl.figure.prototype._init_canvas = function () {\n",
" var fig = this;\n",
"\n",
" var canvas_div = (this.canvas_div = document.createElement('div'));\n",
" canvas_div.setAttribute(\n",
" 'style',\n",
" 'border: 1px solid #ddd;' +\n",
" 'box-sizing: content-box;' +\n",
" 'clear: both;' +\n",
" 'min-height: 1px;' +\n",
" 'min-width: 1px;' +\n",
" 'outline: 0;' +\n",
" 'overflow: hidden;' +\n",
" 'position: relative;' +\n",
" 'resize: both;'\n",
" );\n",
"\n",
" function on_keyboard_event_closure(name) {\n",
" return function (event) {\n",
" return fig.key_event(event, name);\n",
" };\n",
" }\n",
"\n",
" canvas_div.addEventListener(\n",
" 'keydown',\n",
" on_keyboard_event_closure('key_press')\n",
" );\n",
" canvas_div.addEventListener(\n",
" 'keyup',\n",
" on_keyboard_event_closure('key_release')\n",
" );\n",
"\n",
" this._canvas_extra_style(canvas_div);\n",
" this.root.appendChild(canvas_div);\n",
"\n",
" var canvas = (this.canvas = document.createElement('canvas'));\n",
" canvas.classList.add('mpl-canvas');\n",
" canvas.setAttribute('style', 'box-sizing: content-box;');\n",
"\n",
" this.context = canvas.getContext('2d');\n",
"\n",
" var backingStore =\n",
" this.context.backingStorePixelRatio ||\n",
" this.context.webkitBackingStorePixelRatio ||\n",
" this.context.mozBackingStorePixelRatio ||\n",
" this.context.msBackingStorePixelRatio ||\n",
" this.context.oBackingStorePixelRatio ||\n",
" this.context.backingStorePixelRatio ||\n",
" 1;\n",
"\n",
" this.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband_canvas = (this.rubberband_canvas = document.createElement(\n",
" 'canvas'\n",
" ));\n",
" rubberband_canvas.setAttribute(\n",
" 'style',\n",
" 'box-sizing: content-box; position: absolute; left: 0; top: 0; z-index: 1;'\n",
" );\n",
"\n",
" // Apply a ponyfill if ResizeObserver is not implemented by browser.\n",
" if (this.ResizeObserver === undefined) {\n",
" if (window.ResizeObserver !== undefined) {\n",
" this.ResizeObserver = window.ResizeObserver;\n",
" } else {\n",
" var obs = _JSXTOOLS_RESIZE_OBSERVER({});\n",
" this.ResizeObserver = obs.ResizeObserver;\n",
" }\n",
" }\n",
"\n",
" this.resizeObserverInstance = new this.ResizeObserver(function (entries) {\n",
" var nentries = entries.length;\n",
" for (var i = 0; i < nentries; i++) {\n",
" var entry = entries[i];\n",
" var width, height;\n",
" if (entry.contentBoxSize) {\n",
" if (entry.contentBoxSize instanceof Array) {\n",
" // Chrome 84 implements new version of spec.\n",
" width = entry.contentBoxSize[0].inlineSize;\n",
" height = entry.contentBoxSize[0].blockSize;\n",
" } else {\n",
" // Firefox implements old version of spec.\n",
" width = entry.contentBoxSize.inlineSize;\n",
" height = entry.contentBoxSize.blockSize;\n",
" }\n",
" } else {\n",
" // Chrome <84 implements even older version of spec.\n",
" width = entry.contentRect.width;\n",
" height = entry.contentRect.height;\n",
" }\n",
"\n",
" // Keep the size of the canvas and rubber band canvas in sync with\n",
" // the canvas container.\n",
" if (entry.devicePixelContentBoxSize) {\n",
" // Chrome 84 implements new version of spec.\n",
" canvas.setAttribute(\n",
" 'width',\n",
" entry.devicePixelContentBoxSize[0].inlineSize\n",
" );\n",
" canvas.setAttribute(\n",
" 'height',\n",
" entry.devicePixelContentBoxSize[0].blockSize\n",
" );\n",
" } else {\n",
" canvas.setAttribute('width', width * fig.ratio);\n",
" canvas.setAttribute('height', height * fig.ratio);\n",
" }\n",
" canvas.setAttribute(\n",
" 'style',\n",
" 'width: ' + width + 'px; height: ' + height + 'px;'\n",
" );\n",
"\n",
" rubberband_canvas.setAttribute('width', width);\n",
" rubberband_canvas.setAttribute('height', height);\n",
"\n",
" // And update the size in Python. We ignore the initial 0/0 size\n",
" // that occurs as the element is placed into the DOM, which should\n",
" // otherwise not happen due to the minimum size styling.\n",
" if (fig.ws.readyState == 1 && width != 0 && height != 0) {\n",
" fig.request_resize(width, height);\n",
" }\n",
" }\n",
" });\n",
" this.resizeObserverInstance.observe(canvas_div);\n",
"\n",
" function on_mouse_event_closure(name) {\n",
" return function (event) {\n",
" return fig.mouse_event(event, name);\n",
" };\n",
" }\n",
"\n",
" rubberband_canvas.addEventListener(\n",
" 'mousedown',\n",
" on_mouse_event_closure('button_press')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseup',\n",
" on_mouse_event_closure('button_release')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'dblclick',\n",
" on_mouse_event_closure('dblclick')\n",
" );\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband_canvas.addEventListener(\n",
" 'mousemove',\n",
" on_mouse_event_closure('motion_notify')\n",
" );\n",
"\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseenter',\n",
" on_mouse_event_closure('figure_enter')\n",
" );\n",
" rubberband_canvas.addEventListener(\n",
" 'mouseleave',\n",
" on_mouse_event_closure('figure_leave')\n",
" );\n",
"\n",
" canvas_div.addEventListener('wheel', function (event) {\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" on_mouse_event_closure('scroll')(event);\n",
" });\n",
"\n",
" canvas_div.appendChild(canvas);\n",
" canvas_div.appendChild(rubberband_canvas);\n",
"\n",
" this.rubberband_context = rubberband_canvas.getContext('2d');\n",
" this.rubberband_context.strokeStyle = '#000000';\n",
"\n",
" this._resize_canvas = function (width, height, forward) {\n",
" if (forward) {\n",
" canvas_div.style.width = width + 'px';\n",
" canvas_div.style.height = height + 'px';\n",
" }\n",
" };\n",
"\n",
" // Disable right mouse context menu.\n",
" this.rubberband_canvas.addEventListener('contextmenu', function (_e) {\n",
" event.preventDefault();\n",
" return false;\n",
" });\n",
"\n",
" function set_focus() {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"};\n",
"\n",
"mpl.figure.prototype._init_toolbar = function () {\n",
" var fig = this;\n",
"\n",
" var toolbar = document.createElement('div');\n",
" toolbar.classList = 'mpl-toolbar';\n",
" this.root.appendChild(toolbar);\n",
"\n",
" function on_click_closure(name) {\n",
" return function (_event) {\n",
" return fig.toolbar_button_onclick(name);\n",
" };\n",
" }\n",
"\n",
" function on_mouseover_closure(tooltip) {\n",
" return function (event) {\n",
" if (!event.currentTarget.disabled) {\n",
" return fig.toolbar_button_onmouseover(tooltip);\n",
" }\n",
" };\n",
" }\n",
"\n",
" fig.buttons = {};\n",
" var buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'mpl-button-group';\n",
" for (var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" /* Instead of a spacer, we start a new button group. */\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
" buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'mpl-button-group';\n",
" continue;\n",
" }\n",
"\n",
" var button = (fig.buttons[name] = document.createElement('button'));\n",
" button.classList = 'mpl-widget';\n",
" button.setAttribute('role', 'button');\n",
" button.setAttribute('aria-disabled', 'false');\n",
" button.addEventListener('click', on_click_closure(method_name));\n",
" button.addEventListener('mouseover', on_mouseover_closure(tooltip));\n",
"\n",
" var icon_img = document.createElement('img');\n",
" icon_img.src = '_images/' + image + '.png';\n",
" icon_img.srcset = '_images/' + image + '_large.png 2x';\n",
" icon_img.alt = tooltip;\n",
" button.appendChild(icon_img);\n",
"\n",
" buttonGroup.appendChild(button);\n",
" }\n",
"\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
"\n",
" var fmt_picker = document.createElement('select');\n",
" fmt_picker.classList = 'mpl-widget';\n",
" toolbar.appendChild(fmt_picker);\n",
" this.format_dropdown = fmt_picker;\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = document.createElement('option');\n",
" option.selected = fmt === mpl.default_extension;\n",
" option.innerHTML = fmt;\n",
" fmt_picker.appendChild(option);\n",
" }\n",
"\n",
" var status_bar = document.createElement('span');\n",
" status_bar.classList = 'mpl-message';\n",
" toolbar.appendChild(status_bar);\n",
" this.message = status_bar;\n",
"};\n",
"\n",
"mpl.figure.prototype.request_resize = function (x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', { width: x_pixels, height: y_pixels });\n",
"};\n",
"\n",
"mpl.figure.prototype.send_message = function (type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"};\n",
"\n",
"mpl.figure.prototype.send_draw_message = function () {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({ type: 'draw', figure_id: this.id }));\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_save = function (fig, _msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_resize = function (fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] !== fig.canvas.width || size[1] !== fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1], msg['forward']);\n",
" fig.send_message('refresh', {});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function (fig, msg) {\n",
" var x0 = msg['x0'] / fig.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / fig.ratio;\n",
" var x1 = msg['x1'] / fig.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / fig.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0,\n",
" 0,\n",
" fig.canvas.width / fig.ratio,\n",
" fig.canvas.height / fig.ratio\n",
" );\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function (fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_cursor = function (fig, msg) {\n",
" fig.rubberband_canvas.style.cursor = msg['cursor'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_message = function (fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_draw = function (fig, _msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function (fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_history_buttons = function (fig, msg) {\n",
" for (var key in msg) {\n",
" if (!(key in fig.buttons)) {\n",
" continue;\n",
" }\n",
" fig.buttons[key].disabled = !msg[key];\n",
" fig.buttons[key].setAttribute('aria-disabled', !msg[key]);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_navigate_mode = function (fig, msg) {\n",
" if (msg['mode'] === 'PAN') {\n",
" fig.buttons['Pan'].classList.add('active');\n",
" fig.buttons['Zoom'].classList.remove('active');\n",
" } else if (msg['mode'] === 'ZOOM') {\n",
" fig.buttons['Pan'].classList.remove('active');\n",
" fig.buttons['Zoom'].classList.add('active');\n",
" } else {\n",
" fig.buttons['Pan'].classList.remove('active');\n",
" fig.buttons['Zoom'].classList.remove('active');\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function () {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message('ack', {});\n",
"};\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function (fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" var img = evt.data;\n",
" if (img.type !== 'image/png') {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" img.type = 'image/png';\n",
" }\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src\n",
" );\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" img\n",
" );\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" } else if (\n",
" typeof evt.data === 'string' &&\n",
" evt.data.slice(0, 21) === 'data:image/png;base64'\n",
" ) {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig['handle_' + msg_type];\n",
" } catch (e) {\n",
" console.log(\n",
" \"No handler for the '\" + msg_type + \"' message type: \",\n",
" msg\n",
" );\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\n",
" \"Exception inside the 'handler_\" + msg_type + \"' callback:\",\n",
" e,\n",
" e.stack,\n",
" msg\n",
" );\n",
" }\n",
" }\n",
" };\n",
"};\n",
"\n",
"// from https://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function (e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e) {\n",
" e = window.event;\n",
" }\n",
" if (e.target) {\n",
" targ = e.target;\n",
" } else if (e.srcElement) {\n",
" targ = e.srcElement;\n",
" }\n",
" if (targ.nodeType === 3) {\n",
" // defeat Safari bug\n",
" targ = targ.parentNode;\n",
" }\n",
"\n",
" // pageX,Y are the mouse positions relative to the document\n",
" var boundingRect = targ.getBoundingClientRect();\n",
" var x = e.pageX - (boundingRect.left + document.body.scrollLeft);\n",
" var y = e.pageY - (boundingRect.top + document.body.scrollTop);\n",
"\n",
" return { x: x, y: y };\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * https://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys(original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object') {\n",
" obj[key] = original[key];\n",
" }\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function (event, name) {\n",
" var canvas_pos = mpl.findpos(event);\n",
"\n",
" if (name === 'button_press') {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * this.ratio;\n",
" var y = canvas_pos.y * this.ratio;\n",
"\n",
" this.send_message(name, {\n",
" x: x,\n",
" y: y,\n",
" button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event),\n",
" });\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"};\n",
"\n",
"mpl.figure.prototype._key_event_extra = function (_event, _name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"};\n",
"\n",
"mpl.figure.prototype.key_event = function (event, name) {\n",
" // Prevent repeat events\n",
" if (name === 'key_press') {\n",
" if (event.key === this._key) {\n",
" return;\n",
" } else {\n",
" this._key = event.key;\n",
" }\n",
" }\n",
" if (name === 'key_release') {\n",
" this._key = null;\n",
" }\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.key !== 'Control') {\n",
" value += 'ctrl+';\n",
" }\n",
" else if (event.altKey && event.key !== 'Alt') {\n",
" value += 'alt+';\n",
" }\n",
" else if (event.shiftKey && event.key !== 'Shift') {\n",
" value += 'shift+';\n",
" }\n",
"\n",
" value += 'k' + event.key;\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, { key: value, guiEvent: simpleKeys(event) });\n",
" return false;\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function (name) {\n",
" if (name === 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message('toolbar_button', { name: name });\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function (tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"\n",
"///////////////// REMAINING CONTENT GENERATED BY embed_js.py /////////////////\n",
"// prettier-ignore\n",
"var _JSXTOOLS_RESIZE_OBSERVER=function(A){var t,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,o=new Set;function s(e){if(!(this instanceof s))throw new TypeError(\"Constructor requires 'new' operator\");i.set(this,e)}function h(){throw new TypeError(\"Function is not a constructor\")}function c(e,t,i,n){e=0 in arguments?Number(arguments[0]):0,t=1 in arguments?Number(arguments[1]):0,i=2 in arguments?Number(arguments[2]):0,n=3 in arguments?Number(arguments[3]):0,this.right=(this.x=this.left=e)+(this.width=i),this.bottom=(this.y=this.top=t)+(this.height=n),Object.freeze(this)}function d(){t=requestAnimationFrame(d);var s=new WeakMap,p=new Set;o.forEach((function(t){r.get(t).forEach((function(i){var r=t instanceof window.SVGElement,o=a.get(t),d=r?0:parseFloat(o.paddingTop),f=r?0:parseFloat(o.paddingRight),l=r?0:parseFloat(o.paddingBottom),u=r?0:parseFloat(o.paddingLeft),g=r?0:parseFloat(o.borderTopWidth),m=r?0:parseFloat(o.borderRightWidth),w=r?0:parseFloat(o.borderBottomWidth),b=u+f,F=d+l,v=(r?0:parseFloat(o.borderLeftWidth))+m,W=g+w,y=r?0:t.offsetHeight-W-t.clientHeight,E=r?0:t.offsetWidth-v-t.clientWidth,R=b+v,z=F+W,M=r?t.width:parseFloat(o.width)-R-E,O=r?t.height:parseFloat(o.height)-z-y;if(n.has(t)){var k=n.get(t);if(k[0]===M&&k[1]===O)return}n.set(t,[M,O]);var S=Object.create(h.prototype);S.target=t,S.contentRect=new c(u,d,M,O),s.has(i)||(s.set(i,[]),p.add(i)),s.get(i).push(S)}))})),p.forEach((function(e){i.get(e).call(e,s.get(e),e)}))}return s.prototype.observe=function(i){if(i instanceof window.Element){r.has(i)||(r.set(i,new Set),o.add(i),a.set(i,window.getComputedStyle(i)));var n=r.get(i);n.has(this)||n.add(this),cancelAnimationFrame(t),t=requestAnimationFrame(d)}},s.prototype.unobserve=function(i){if(i instanceof window.Element&&r.has(i)){var n=r.get(i);n.has(this)&&(n.delete(this),n.size||(r.delete(i),o.delete(i))),n.size||r.delete(i),o.size||cancelAnimationFrame(t)}},A.DOMRectReadOnly=c,A.ResizeObserver=s,A.ResizeObserverEntry=h,A}; // eslint-disable-line\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Left button pans, Right button zooms\\nx/y fixes axis, CTRL fixes aspect\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\\nx/y fixes axis\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"jpeg\", \"pgf\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
"\n",
"mpl.default_extension = \"png\";/* global mpl */\n",
"\n",
"var comm_websocket_adapter = function (comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.binaryType = comm.kernel.ws.binaryType;\n",
" ws.readyState = comm.kernel.ws.readyState;\n",
" function updateReadyState(_event) {\n",
" if (comm.kernel.ws) {\n",
" ws.readyState = comm.kernel.ws.readyState;\n",
" } else {\n",
" ws.readyState = 3; // Closed state.\n",
" }\n",
" }\n",
" comm.kernel.ws.addEventListener('open', updateReadyState);\n",
" comm.kernel.ws.addEventListener('close', updateReadyState);\n",
" comm.kernel.ws.addEventListener('error', updateReadyState);\n",
"\n",
" ws.close = function () {\n",
" comm.close();\n",
" };\n",
" ws.send = function (m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function (msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" var data = msg['content']['data'];\n",
" if (data['blob'] !== undefined) {\n",
" data = {\n",
" data: new Blob(msg['buffers'], { type: data['blob'] }),\n",
" };\n",
" }\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(data);\n",
" });\n",
" return ws;\n",
"};\n",
"\n",
"mpl.mpl_figure_comm = function (comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = document.getElementById(id);\n",
" var ws_proxy = comm_websocket_adapter(comm);\n",
"\n",
" function ondownload(figure, _format) {\n",
" window.open(figure.canvas.toDataURL());\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy, ondownload, element);\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element;\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error('Failed to find cell for figure', id, fig);\n",
" return;\n",
" }\n",
" fig.cell_info[0].output_area.element.on(\n",
" 'cleared',\n",
" { fig: fig },\n",
" fig._remove_fig_handler\n",
" );\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function (fig, msg) {\n",
" var width = fig.canvas.width / fig.ratio;\n",
" fig.cell_info[0].output_area.element.off(\n",
" 'cleared',\n",
" fig._remove_fig_handler\n",
" );\n",
" fig.resizeObserverInstance.unobserve(fig.canvas_div);\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable();\n",
" fig.parent_element.innerHTML =\n",
" '
';\n",
" fig.close_ws(fig, msg);\n",
"};\n",
"\n",
"mpl.figure.prototype.close_ws = function (fig, msg) {\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"};\n",
"\n",
"mpl.figure.prototype.push_to_output = function (_remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width / this.ratio;\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] =\n",
" '
';\n",
"};\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function () {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message('ack', {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () {\n",
" fig.push_to_output();\n",
" }, 1000);\n",
"};\n",
"\n",
"mpl.figure.prototype._init_toolbar = function () {\n",
" var fig = this;\n",
"\n",
" var toolbar = document.createElement('div');\n",
" toolbar.classList = 'btn-toolbar';\n",
" this.root.appendChild(toolbar);\n",
"\n",
" function on_click_closure(name) {\n",
" return function (_event) {\n",
" return fig.toolbar_button_onclick(name);\n",
" };\n",
" }\n",
"\n",
" function on_mouseover_closure(tooltip) {\n",
" return function (event) {\n",
" if (!event.currentTarget.disabled) {\n",
" return fig.toolbar_button_onmouseover(tooltip);\n",
" }\n",
" };\n",
" }\n",
"\n",
" fig.buttons = {};\n",
" var buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'btn-group';\n",
" var button;\n",
" for (var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" /* Instead of a spacer, we start a new button group. */\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
" buttonGroup = document.createElement('div');\n",
" buttonGroup.classList = 'btn-group';\n",
" continue;\n",
" }\n",
"\n",
" button = fig.buttons[name] = document.createElement('button');\n",
" button.classList = 'btn btn-default';\n",
" button.href = '#';\n",
" button.title = name;\n",
" button.innerHTML = '';\n",
" button.addEventListener('click', on_click_closure(method_name));\n",
" button.addEventListener('mouseover', on_mouseover_closure(tooltip));\n",
" buttonGroup.appendChild(button);\n",
" }\n",
"\n",
" if (buttonGroup.hasChildNodes()) {\n",
" toolbar.appendChild(buttonGroup);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = document.createElement('span');\n",
" status_bar.classList = 'mpl-message pull-right';\n",
" toolbar.appendChild(status_bar);\n",
" this.message = status_bar;\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = document.createElement('div');\n",
" buttongrp.classList = 'btn-group inline pull-right';\n",
" button = document.createElement('button');\n",
" button.classList = 'btn btn-mini btn-primary';\n",
" button.href = '#';\n",
" button.title = 'Stop Interaction';\n",
" button.innerHTML = '';\n",
" button.addEventListener('click', function (_evt) {\n",
" fig.handle_close(fig, {});\n",
" });\n",
" button.addEventListener(\n",
" 'mouseover',\n",
" on_mouseover_closure('Stop Interaction')\n",
" );\n",
" buttongrp.appendChild(button);\n",
" var titlebar = this.root.querySelector('.ui-dialog-titlebar');\n",
" titlebar.insertBefore(buttongrp, titlebar.firstChild);\n",
"};\n",
"\n",
"mpl.figure.prototype._remove_fig_handler = function (event) {\n",
" var fig = event.data.fig;\n",
" if (event.target !== this) {\n",
" // Ignore bubbled events from children.\n",
" return;\n",
" }\n",
" fig.close_ws(fig, {});\n",
"};\n",
"\n",
"mpl.figure.prototype._root_extra_style = function (el) {\n",
" el.style.boxSizing = 'content-box'; // override notebook setting of border-box.\n",
"};\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function (el) {\n",
" // this is important to make the div 'focusable\n",
" el.setAttribute('tabindex', 0);\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" } else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype._key_event_extra = function (event, _name) {\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which === 13) {\n",
" this.canvas_div.blur();\n",
" // select the cell after this one\n",
" var index = IPython.notebook.find_cell_index(this.cell_info[0]);\n",
" IPython.notebook.select(index + 1);\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_save = function (fig, _msg) {\n",
" fig.ondownload(fig, null);\n",
"};\n",
"\n",
"mpl.find_output_cell = function (html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i = 0; i < ncells; i++) {\n",
" var cell = cells[i];\n",
" if (cell.cell_type === 'code') {\n",
" for (var j = 0; j < cell.output_area.outputs.length; j++) {\n",
" var data = cell.output_area.outputs[j];\n",
" if (data.data) {\n",
" // IPython >= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] === html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"};\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel !== null) {\n",
" IPython.notebook.kernel.comm_manager.register_target(\n",
" 'matplotlib',\n",
" mpl.mpl_figure_comm\n",
" );\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure()\n",
"plt.errorbar(ph_data['E'], ph_data['nuFnu'], ph_data['nuFnu_err'], fmt='.')\n",
"plt.xscale('log')\n",
"plt.yscale('log')\n",
"plt.xlabel(ph_data['E'].unit)\n",
"plt.ylabel(ph_data['nuFnu'].unit)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"interpreter": {
"hash": "2b1b54e6312af405e38466a1a3adb7b6de382010f094f7a0b75863d56a8dc243"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
}