diff --git a/notebooks/02-intro-to-uxarray/grid.ipynb b/notebooks/02-intro-to-uxarray/grid.ipynb index d5e302b..3ea7449 100644 --- a/notebooks/02-intro-to-uxarray/grid.ipynb +++ b/notebooks/02-intro-to-uxarray/grid.ipynb @@ -48,9 +48,7 @@ "cell_type": "markdown", "id": "a2041dc5-06c0-4cae-bbfb-4f62bfb3b7ab", "metadata": {}, - "source": [ - "We have already stated in the previous section that ``Grid`` is the UXarray class that ensures awareness of the unstructured grid topology. Exploring the grid geometry can be helpful throughout analysis and visualization workflows, and it can be done through either checking one of ``UxDataset.Grid`` and ``UxDataArray.Grid``, or looking at a standalone ``Grid`` object that can also be created with UXarray. " - ] + "source": "In the previous section, we briefly introduced the ``Grid`` class, which stores unstructured grid variables such as coordinates and connectivity. This class is the foundation of UXarray, which ensures awareness of the unstructured grid topology between operations. Exploring the grid geometry can be helpful throughout analysis and visualization workflows. \n" }, { "cell_type": "markdown", @@ -75,9 +73,7 @@ "cell_type": "markdown", "id": "13319a80-c211-43b5-b7d1-dad74d4b6d94", "metadata": {}, - "source": [ - "In the following sections, we will look into loading a standalone grid-specific file as follows with UXarray and then explore some of the ``Grid`` features." - ] + "source": "In the following sections, we will look into loading a standalone grid-specific file. The coordinates and connectivity variables of an unstructured grid are often stored as a separate unstructured grid file. " }, { "cell_type": "code", @@ -106,9 +102,7 @@ "cell_type": "markdown", "id": "4e5f564a-3fb2-4fcc-b010-94a2631011a8", "metadata": {}, - "source": [ - "The suggested way to construct a **standalone** `ux.Grid` is by using the `uxarray.open_grid()` method. Note that this way, you'd only be able to explore the grid topology and use only grid-specific functionality, i.e. you would not explore any actual data, which will be covered in the next section." - ] + "source": "The suggested way to construct a **standalone** `Grid` is by using the `uxarray.open_grid()` method. When constructing a standalone grid, only topology variables such as coordinates and connectivity are used to construct the grid. This means that any data variables that reside on the unstructured grid, such as temperature, would not be stored in a `Grid`. Pairing the grid definiton with data variables will be covered in the next notebook. \n" }, { "cell_type": "code", @@ -1153,10 +1147,16 @@ "source": [ "import uxarray as ux\n", "\n", - "uxgrid = ux.open_grid(\"../../meshfiles/outCSne30.grid.ug\")\n", + "uxgrid = ux.open_grid(grid_path)\n", "uxgrid" ] }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "Printing a `Grid` displays the contents of our newly created grid object. If you are coming from an Xarray background, this output will look very similar to what one might see when constructing an `xarray.Dataset`. ", + "id": "df239b4dac17e91f" + }, { "cell_type": "markdown", "id": "a5a24484-e5c3-4d38-829f-359d9b3a23cb", @@ -1169,9 +1169,7 @@ "cell_type": "markdown", "id": "fefc4cad-d68e-4385-8b16-ecf32cc00185", "metadata": {}, - "source": [ - "Different types of coordinates for the geometric elements of a ``Grid`` are either constructed upfront the the grid instantiation or generated at the time of use." - ] + "source": "Different types of coordinates for the geometric elements of a ``Grid`` are either constructed upfront during the grid instantiation or generated at the time of use." }, { "cell_type": "markdown", @@ -2450,11 +2448,11 @@ "id": "f8e5bca1-ea3d-46ea-bb4b-354f48576690", "metadata": {}, "source": [ - "In an unstructured grid geometry, connectivity information between each type of geometric elements can be defined, e.g. face-node, node-edge, edge-face, etc. UXarray requires only the **face-node** connectivity, either coming from the grid definition or being constructed by UXarray in special cases, in addition to the node coordinates to represent the topology. \n", + "In unstructured grid geometry, connectivity information between each type of geometric elements can be defined, e.g. face-node, node-edge, edge-face, etc. UXarray requires only the **face-node** connectivity, either coming from the grid definition or being constructed by UXarray in special cases, in addition to the node coordinates to represent the topology. \n", "\n", - "All the other connectivity information can also be generated by UXarray when prompted.\n", + "UXarray can also generate all the other connectivity information when prompted.\n", "\n", - "Let us look at the face-node connectivity for example:" + "Let us look at the face-node connectivity, for example:" ] }, { diff --git a/notebooks/03-plotting-with-uxarray/data-viz.ipynb b/notebooks/03-plotting-with-uxarray/data-viz.ipynb index 0ede17a..976b274 100644 --- a/notebooks/03-plotting-with-uxarray/data-viz.ipynb +++ b/notebooks/03-plotting-with-uxarray/data-viz.ipynb @@ -57,23 +57,147 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-12-18T05:16:11.865827Z", - "start_time": "2024-12-18T05:16:11.862611Z" + "end_time": "2024-12-20T18:26:33.210670Z", + "start_time": "2024-12-20T18:26:26.665753Z" } }, "cell_type": "code", "source": "import uxarray as ux", "id": "ac01a35ccd9136f1", - "outputs": [], - "execution_count": 10 + "outputs": [ + { + "data": { + "text/html": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/javascript": "(function(root) {\n function now() {\n return new Date();\n }\n\n const force = true;\n const py_version = '3.5.2'.replace('rc', '-rc.').replace('.dev', '-dev.');\n const reloading = false;\n const Bokeh = root.Bokeh;\n\n // Set a timeout for this load but only if we are not already initializing\n if (typeof (root._bokeh_timeout) === \"undefined\" || (force || !root._bokeh_is_initializing)) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks;\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, js_modules, js_exports, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n if (js_exports == null) js_exports = {};\n\n root._bokeh_onload_callbacks.push(callback);\n\n if (root._bokeh_is_loading > 0) {\n // Don't load bokeh if it is still initializing\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n } else if (js_urls.length === 0 && js_modules.length === 0 && Object.keys(js_exports).length === 0) {\n // There is nothing to load\n run_callbacks();\n return null;\n }\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n window._bokeh_on_load = on_load\n\n function on_error(e) {\n const src_el = e.srcElement\n console.error(\"failed to load \" + (src_el.href || src_el.src));\n }\n\n const skip = [];\n if (window.requirejs) {\n window.requirejs.config({'packages': {}, 'paths': {}, 'shim': {}});\n root._bokeh_is_loading = css_urls.length + 0;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n }\n\n const existing_stylesheets = []\n const links = document.getElementsByTagName('link')\n for (let i = 0; i < links.length; i++) {\n const link = links[i]\n if (link.href != null) {\n existing_stylesheets.push(link.href)\n }\n }\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const escaped = encodeURI(url)\n if (existing_stylesheets.indexOf(escaped) !== -1) {\n on_load()\n continue;\n }\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n } var existing_scripts = []\n const scripts = document.getElementsByTagName('script')\n for (let i = 0; i < scripts.length; i++) {\n var script = scripts[i]\n if (script.src != null) {\n existing_scripts.push(script.src)\n }\n }\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const escaped = encodeURI(url)\n if (skip.indexOf(escaped) !== -1 || existing_scripts.indexOf(escaped) !== -1) {\n if (!window.requirejs) {\n on_load();\n }\n continue;\n }\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (let i = 0; i < js_modules.length; i++) {\n const url = js_modules[i];\n const escaped = encodeURI(url)\n if (skip.indexOf(escaped) !== -1 || existing_scripts.indexOf(escaped) !== -1) {\n if (!window.requirejs) {\n on_load();\n }\n continue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (const name in js_exports) {\n const url = js_exports[name];\n const escaped = encodeURI(url)\n if (skip.indexOf(escaped) >= 0 || root[name] != null) {\n if (!window.requirejs) {\n on_load();\n }\n continue;\n }\n var element = document.createElement('script');\n element.onerror = on_error;\n element.async = false;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n element.textContent = `\n import ${name} from \"${url}\"\n window.${name} = ${name}\n window._bokeh_on_load()\n `\n document.head.appendChild(element);\n }\n if (!js_urls.length && !js_modules.length) {\n on_load()\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n const js_urls = [\"https://cdn.holoviz.org/panel/1.5.3/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-3.5.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.5.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.5.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.5.2.min.js\", \"https://cdn.holoviz.org/panel/1.5.3/dist/panel.min.js\"];\n const js_modules = [];\n const js_exports = {};\n const css_urls = [];\n const inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n if ((root.Bokeh !== undefined) || (force === true)) {\n for (let i = 0; i < inline_js.length; i++) {\n try {\n inline_js[i].call(root, root.Bokeh);\n } catch(e) {\n if (!reloading) {\n throw e;\n }\n }\n }\n // Cache old bokeh versions\n if (Bokeh != undefined && !reloading) {\n var NewBokeh = root.Bokeh;\n if (Bokeh.versions === undefined) {\n Bokeh.versions = new Map();\n }\n if (NewBokeh.version !== Bokeh.version) {\n Bokeh.versions.set(NewBokeh.version, NewBokeh)\n }\n root.Bokeh = Bokeh;\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n }\n root._bokeh_is_initializing = false\n }\n\n function load_or_wait() {\n // Implement a backoff loop that tries to ensure we do not load multiple\n // versions of Bokeh and its dependencies at the same time.\n // In recent versions we use the root._bokeh_is_initializing flag\n // to determine whether there is an ongoing attempt to initialize\n // bokeh, however for backward compatibility we also try to ensure\n // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n // before older versions are fully initialized.\n if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n // If the timeout and bokeh was not successfully loaded we reset\n // everything and try loading again\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_is_initializing = false;\n root._bokeh_onload_callbacks = undefined;\n root._bokeh_is_loading = 0\n console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n load_or_wait();\n } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n setTimeout(load_or_wait, 100);\n } else {\n root._bokeh_is_initializing = true\n root._bokeh_onload_callbacks = []\n const bokeh_loaded = root.Bokeh != null && (root.Bokeh.version === py_version || (root.Bokeh.versions !== undefined && root.Bokeh.versions.has(py_version)));\n if (!reloading && !bokeh_loaded) {\n if (root.Bokeh) {\n root.Bokeh = undefined;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n }\n load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n }\n // Give older versions of the autoload script a head-start to ensure\n // they initialize before we start loading newer version.\n setTimeout(load_or_wait, 100)\n}(window));", + "application/vnd.holoviews_load.v0+json": "(function(root) {\n function now() {\n return new Date();\n }\n\n const force = true;\n const py_version = '3.5.2'.replace('rc', '-rc.').replace('.dev', '-dev.');\n const reloading = false;\n const Bokeh = root.Bokeh;\n\n // Set a timeout for this load but only if we are not already initializing\n if (typeof (root._bokeh_timeout) === \"undefined\" || (force || !root._bokeh_is_initializing)) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks;\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, js_modules, js_exports, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n if (js_exports == null) js_exports = {};\n\n root._bokeh_onload_callbacks.push(callback);\n\n if (root._bokeh_is_loading > 0) {\n // Don't load bokeh if it is still initializing\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n } else if (js_urls.length === 0 && js_modules.length === 0 && Object.keys(js_exports).length === 0) {\n // There is nothing to load\n run_callbacks();\n return null;\n }\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n window._bokeh_on_load = on_load\n\n function on_error(e) {\n const src_el = e.srcElement\n console.error(\"failed to load \" + (src_el.href || src_el.src));\n }\n\n const skip = [];\n if (window.requirejs) {\n window.requirejs.config({'packages': {}, 'paths': {}, 'shim': {}});\n root._bokeh_is_loading = css_urls.length + 0;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n }\n\n const existing_stylesheets = []\n const links = document.getElementsByTagName('link')\n for (let i = 0; i < links.length; i++) {\n const link = links[i]\n if (link.href != null) {\n existing_stylesheets.push(link.href)\n }\n }\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const escaped = encodeURI(url)\n if (existing_stylesheets.indexOf(escaped) !== -1) {\n on_load()\n continue;\n }\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n } var existing_scripts = []\n const scripts = document.getElementsByTagName('script')\n for (let i = 0; i < scripts.length; i++) {\n var script = scripts[i]\n if (script.src != null) {\n existing_scripts.push(script.src)\n }\n }\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const escaped = encodeURI(url)\n if (skip.indexOf(escaped) !== -1 || existing_scripts.indexOf(escaped) !== -1) {\n if (!window.requirejs) {\n on_load();\n }\n continue;\n }\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (let i = 0; i < js_modules.length; i++) {\n const url = js_modules[i];\n const escaped = encodeURI(url)\n if (skip.indexOf(escaped) !== -1 || existing_scripts.indexOf(escaped) !== -1) {\n if (!window.requirejs) {\n on_load();\n }\n continue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (const name in js_exports) {\n const url = js_exports[name];\n const escaped = encodeURI(url)\n if (skip.indexOf(escaped) >= 0 || root[name] != null) {\n if (!window.requirejs) {\n on_load();\n }\n continue;\n }\n var element = document.createElement('script');\n element.onerror = on_error;\n element.async = false;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n element.textContent = `\n import ${name} from \"${url}\"\n window.${name} = ${name}\n window._bokeh_on_load()\n `\n document.head.appendChild(element);\n }\n if (!js_urls.length && !js_modules.length) {\n on_load()\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n const js_urls = [\"https://cdn.holoviz.org/panel/1.5.3/dist/bundled/reactiveesm/es-module-shims@^1.10.0/dist/es-module-shims.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-3.5.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.5.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.5.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.5.2.min.js\", \"https://cdn.holoviz.org/panel/1.5.3/dist/panel.min.js\"];\n const js_modules = [];\n const js_exports = {};\n const css_urls = [];\n const inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n if ((root.Bokeh !== undefined) || (force === true)) {\n for (let i = 0; i < inline_js.length; i++) {\n try {\n inline_js[i].call(root, root.Bokeh);\n } catch(e) {\n if (!reloading) {\n throw e;\n }\n }\n }\n // Cache old bokeh versions\n if (Bokeh != undefined && !reloading) {\n var NewBokeh = root.Bokeh;\n if (Bokeh.versions === undefined) {\n Bokeh.versions = new Map();\n }\n if (NewBokeh.version !== Bokeh.version) {\n Bokeh.versions.set(NewBokeh.version, NewBokeh)\n }\n root.Bokeh = Bokeh;\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n }\n root._bokeh_is_initializing = false\n }\n\n function load_or_wait() {\n // Implement a backoff loop that tries to ensure we do not load multiple\n // versions of Bokeh and its dependencies at the same time.\n // In recent versions we use the root._bokeh_is_initializing flag\n // to determine whether there is an ongoing attempt to initialize\n // bokeh, however for backward compatibility we also try to ensure\n // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n // before older versions are fully initialized.\n if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n // If the timeout and bokeh was not successfully loaded we reset\n // everything and try loading again\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_is_initializing = false;\n root._bokeh_onload_callbacks = undefined;\n root._bokeh_is_loading = 0\n console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n load_or_wait();\n } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n setTimeout(load_or_wait, 100);\n } else {\n root._bokeh_is_initializing = true\n root._bokeh_onload_callbacks = []\n const bokeh_loaded = root.Bokeh != null && (root.Bokeh.version === py_version || (root.Bokeh.versions !== undefined && root.Bokeh.versions.has(py_version)));\n if (!reloading && !bokeh_loaded) {\n if (root.Bokeh) {\n root.Bokeh = undefined;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n }\n load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n }\n // Give older versions of the autoload script a head-start to ensure\n // they initialize before we start loading newer version.\n setTimeout(load_or_wait, 100)\n}(window));" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.holoviews_load.v0+json": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n function JupyterCommManager() {\n }\n\n JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n comm_manager.register_target(comm_id, function(comm) {\n comm.on_msg(msg_handler);\n });\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n comm.onMsg = msg_handler;\n });\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n console.log(message)\n var content = {data: message.data, comm_id};\n var buffers = []\n for (var buffer of message.buffers || []) {\n buffers.push(new DataView(buffer))\n }\n var metadata = message.metadata || {};\n var msg = {content, buffers, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n })\n }\n }\n\n JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n if (comm_id in window.PyViz.comms) {\n return window.PyViz.comms[comm_id];\n } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n if (msg_handler) {\n comm.on_msg(msg_handler);\n }\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n comm.open();\n if (msg_handler) {\n comm.onMsg = msg_handler;\n }\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n var comm_promise = google.colab.kernel.comms.open(comm_id)\n comm_promise.then((comm) => {\n window.PyViz.comms[comm_id] = comm;\n if (msg_handler) {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n var content = {data: message.data};\n var metadata = message.metadata || {comm_id};\n var msg = {content, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n }\n }) \n var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n return comm_promise.then((comm) => {\n comm.send(data, metadata, buffers, disposeOnDone);\n });\n };\n var comm = {\n send: sendClosure\n };\n }\n window.PyViz.comms[comm_id] = comm;\n return comm;\n }\n window.PyViz.comm_manager = new JupyterCommManager();\n \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n return\n }\n var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n if (id !== undefined) {\n var nchildren = toinsert.length;\n var html_node = toinsert[nchildren-1].children[0];\n html_node.innerHTML = output.data[HTML_MIME_TYPE];\n var scripts = [];\n var nodelist = html_node.querySelectorAll(\"script\");\n for (var i in nodelist) {\n if (nodelist.hasOwnProperty(i)) {\n scripts.push(nodelist[i])\n }\n }\n\n scripts.forEach( function (oldScript) {\n var newScript = document.createElement(\"script\");\n var attrs = [];\n var nodemap = oldScript.attributes;\n for (var j in nodemap) {\n if (nodemap.hasOwnProperty(j)) {\n attrs.push(nodemap[j])\n }\n }\n attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n oldScript.parentNode.replaceChild(newScript, oldScript);\n });\n if (JS_MIME_TYPE in output.data) {\n toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n }\n output_area._hv_plot_id = id;\n if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n window.PyViz.plot_index[id] = Bokeh.index[id];\n } else {\n window.PyViz.plot_index[id] = null;\n }\n } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n var id = handle.cell.output_area._hv_plot_id;\n var server_id = handle.cell.output_area._bokeh_server_id;\n if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n if (server_id !== null) {\n comm.send({event_type: 'server_delete', 'id': server_id});\n return;\n } else if (comm !== null) {\n comm.send({event_type: 'delete', 'id': id});\n }\n delete PyViz.plot_index[id];\n if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n var doc = window.Bokeh.index[id].model.document\n doc.clear();\n const i = window.Bokeh.documents.indexOf(doc);\n if (i > -1) {\n window.Bokeh.documents.splice(i, 1);\n }\n }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n delete PyViz.comms[\"hv-extension-comm\"];\n window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n handle_clear_output(event, {cell: {output_area: handle.output_area}})\n handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[0]);\n element.append(toinsert);\n return toinsert\n }\n\n events.on('output_added.OutputArea', handle_add_output);\n events.on('output_updated.OutputArea', handle_update_output);\n events.on('clear_output.CodeCell', handle_clear_output);\n events.on('delete.Cell', handle_clear_output);\n events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n safe: true,\n index: 0\n });\n}\n\nif (window.Jupyter !== undefined) {\n try {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n } catch(err) {\n }\n}\n", + "application/javascript": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n function JupyterCommManager() {\n }\n\n JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n comm_manager.register_target(comm_id, function(comm) {\n comm.on_msg(msg_handler);\n });\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n comm.onMsg = msg_handler;\n });\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n console.log(message)\n var content = {data: message.data, comm_id};\n var buffers = []\n for (var buffer of message.buffers || []) {\n buffers.push(new DataView(buffer))\n }\n var metadata = message.metadata || {};\n var msg = {content, buffers, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n })\n }\n }\n\n JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n if (comm_id in window.PyViz.comms) {\n return window.PyViz.comms[comm_id];\n } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n if (msg_handler) {\n comm.on_msg(msg_handler);\n }\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n comm.open();\n if (msg_handler) {\n comm.onMsg = msg_handler;\n }\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n var comm_promise = google.colab.kernel.comms.open(comm_id)\n comm_promise.then((comm) => {\n window.PyViz.comms[comm_id] = comm;\n if (msg_handler) {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n var content = {data: message.data};\n var metadata = message.metadata || {comm_id};\n var msg = {content, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n }\n }) \n var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n return comm_promise.then((comm) => {\n comm.send(data, metadata, buffers, disposeOnDone);\n });\n };\n var comm = {\n send: sendClosure\n };\n }\n window.PyViz.comms[comm_id] = comm;\n return comm;\n }\n window.PyViz.comm_manager = new JupyterCommManager();\n \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n return\n }\n var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n if (id !== undefined) {\n var nchildren = toinsert.length;\n var html_node = toinsert[nchildren-1].children[0];\n html_node.innerHTML = output.data[HTML_MIME_TYPE];\n var scripts = [];\n var nodelist = html_node.querySelectorAll(\"script\");\n for (var i in nodelist) {\n if (nodelist.hasOwnProperty(i)) {\n scripts.push(nodelist[i])\n }\n }\n\n scripts.forEach( function (oldScript) {\n var newScript = document.createElement(\"script\");\n var attrs = [];\n var nodemap = oldScript.attributes;\n for (var j in nodemap) {\n if (nodemap.hasOwnProperty(j)) {\n attrs.push(nodemap[j])\n }\n }\n attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n oldScript.parentNode.replaceChild(newScript, oldScript);\n });\n if (JS_MIME_TYPE in output.data) {\n toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n }\n output_area._hv_plot_id = id;\n if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n window.PyViz.plot_index[id] = Bokeh.index[id];\n } else {\n window.PyViz.plot_index[id] = null;\n }\n } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n var id = handle.cell.output_area._hv_plot_id;\n var server_id = handle.cell.output_area._bokeh_server_id;\n if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n if (server_id !== null) {\n comm.send({event_type: 'server_delete', 'id': server_id});\n return;\n } else if (comm !== null) {\n comm.send({event_type: 'delete', 'id': id});\n }\n delete PyViz.plot_index[id];\n if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n var doc = window.Bokeh.index[id].model.document\n doc.clear();\n const i = window.Bokeh.documents.indexOf(doc);\n if (i > -1) {\n window.Bokeh.documents.splice(i, 1);\n }\n }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n delete PyViz.comms[\"hv-extension-comm\"];\n window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n handle_clear_output(event, {cell: {output_area: handle.output_area}})\n handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[0]);\n element.append(toinsert);\n return toinsert\n }\n\n events.on('output_added.OutputArea', handle_add_output);\n events.on('output_updated.OutputArea', handle_update_output);\n events.on('clear_output.CodeCell', handle_clear_output);\n events.on('delete.Cell', handle_clear_output);\n events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n safe: true,\n index: 0\n });\n}\n\nif (window.Jupyter !== undefined) {\n try {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n } catch(err) {\n }\n}\n" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ], + "application/vnd.holoviews_exec.v0+json": "" + }, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p1002" + } + }, + "output_type": "display_data" + } + ], + "execution_count": 1 }, { "cell_type": "code", "id": "bc2d87ab434c9abc", "metadata": { "ExecuteTime": { - "end_time": "2024-12-17T16:20:30.298425Z", - "start_time": "2024-12-17T16:20:30.270823Z" + "end_time": "2024-12-20T18:26:33.292075Z", + "start_time": "2024-12-20T18:26:33.218675Z" } }, "source": [ @@ -83,7 +207,7 @@ "uxds = ux.open_dataset(grid_path, data_path)" ], "outputs": [], - "execution_count": 3 + "execution_count": 2 }, { "metadata": {}, @@ -94,8 +218,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-12-17T17:12:14.166095Z", - "start_time": "2024-12-17T17:12:11.174146Z" + "end_time": "2024-12-20T18:25:48.158096Z", + "start_time": "2024-12-20T18:25:48.000631Z" } }, "cell_type": "code", @@ -112,12 +236,12 @@ { "data": { "text/html": [ - "
\n", - "
\n", + "
\n", + "
\n", "
\n", "" + ], + "application/vnd.holoviews_exec.v0+json": "", + "text/plain": [ + ":Image [Longitude,Latitude] (Longitude_Latitude bottomDepth)" + ] + }, + "execution_count": 12, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p1797" + } + }, + "output_type": "execute_result" + } + ], + "execution_count": 12 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2024-12-20T18:27:43.410559Z", + "start_time": "2024-12-20T18:27:42.947299Z" + } + }, + "cell_type": "code", + "source": "uxds[\"bottomDepth\"].plot(projection=ccrs.Orthographic(-90, 40))", + "id": "b74d81b5fcfc6773", + "outputs": [ + { + "data": {}, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ], + "application/vnd.holoviews_exec.v0+json": "", + "text/plain": [ + ":Image [Longitude,Latitude] (Longitude_Latitude bottomDepth)" + ] + }, + "execution_count": 13, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p1900" + } + }, + "output_type": "execute_result" + } + ], + "execution_count": 13 + }, + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": "", + "id": "7727018234b12097" } ], "metadata": { diff --git a/notebooks/03-plotting-with-uxarray/grid-viz.ipynb b/notebooks/03-plotting-with-uxarray/grid-viz.ipynb index d55b174..6c8e00b 100644 --- a/notebooks/03-plotting-with-uxarray/grid-viz.ipynb +++ b/notebooks/03-plotting-with-uxarray/grid-viz.ipynb @@ -15,8 +15,8 @@ "\n", "### In this section, you'll learn:\n", "\n", - "* Plotting the Edges of an unstructured grid\n", - "* Plotting the Coordinates of an unstructured grid\n", + "* Plotting the edges of an unstructured grid\n", + "* Plotting the coordinates of an unstructured grid\n", "\n", "**Related Documentation**\n", "\n", @@ -24,11 +24,11 @@ "\n", "### Prerequisites\n", "\n", - "| Concepts | Importance | Notes |\n", - "| --- | --- | --- |\n", - "| [Link to Pre-Req](https://pandas.pydata.org/docs/user_guide/10min.html) | Necessary | |\n", + "| Concepts | Importance | Notes |\n", + "|-------------------------------------------------------------------------------------| --- | --- |\n", + "| [Unstructured Grids Overview](https://pandas.pydata.org/docs/user_guide/10min.html) | Necessary | |\n", "\n", - "* **Time to learn**: x minutes\n", + "* **Time to learn**: 5 minutes\n", "-----\n", "\n" ] @@ -48,12 +48,7 @@ { "cell_type": "code", "id": "6bdf1449fbe884c4", - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:12:15.559343Z", - "start_time": "2024-12-20T02:12:15.540578Z" - } - }, + "metadata": {}, "source": [ "import uxarray as ux\n", "\n", @@ -62,440 +57,8 @@ "uxgrid = ux.open_grid(grid_path)\n", "uxgrid" ], - "outputs": [ - { - "data": { - "text/plain": [ - "\n", - "Original Grid Type: UGRID\n", - "Grid Dimensions:\n", - " * n_node: 16\n", - " * n_edge: 19\n", - " * n_face: 4\n", - " * n_max_face_nodes: 6\n", - " * n_nodes_per_face: (4,)\n", - "Grid Coordinates (Spherical):\n", - " * node_lon: (16,)\n", - " * node_lat: (16,)\n", - " * edge_lon: (19,)\n", - " * edge_lat: (19,)\n", - " * face_lon: (4,)\n", - " * face_lat: (4,)\n", - "Grid Coordinates (Cartesian):\n", - "Grid Connectivity Variables:\n", - " * face_node_connectivity: (4, 6)\n", - "Grid Descriptor Variables:\n", - " * n_nodes_per_face: (4,)" - ], - "text/html": [ - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
<uxarray.Grid>\n",
-       "Original Grid Type: UGRID\n",
-       "Grid Dimensions:\n",
-       "  * n_node: 16\n",
-       "  * n_edge: 19\n",
-       "  * n_face: 4\n",
-       "  * n_max_face_nodes: 6\n",
-       "  * n_nodes_per_face: (4,)\n",
-       "Grid Coordinates (Spherical):\n",
-       "  * node_lon: (16,)\n",
-       "  * node_lat: (16,)\n",
-       "  * edge_lon: (19,)\n",
-       "  * edge_lat: (19,)\n",
-       "  * face_lon: (4,)\n",
-       "  * face_lat: (4,)\n",
-       "Grid Coordinates (Cartesian):\n",
-       "Grid Connectivity Variables:\n",
-       "  * face_node_connectivity: (4, 6)\n",
-       "Grid Descriptor Variables:\n",
-       "  * n_nodes_per_face: (4,)\n",
-       "
" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "execution_count": 12 + "outputs": [], + "execution_count": null }, { "metadata": {}, @@ -509,112 +72,14 @@ "id": "e7fadbf907530c66" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:09:09.498672Z", - "start_time": "2024-12-20T02:09:08.283603Z" - } - }, + "metadata": {}, "cell_type": "code", "source": [ "uxgrid.plot(title=\"Default Plot Function\")" ], "id": "fd26dc3bc65484dd", - "outputs": [ - { - "data": {}, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "
\n", - "
\n", - "" - ], - "application/vnd.holoviews_exec.v0+json": "", - "text/plain": [ - ":Path [Longitude,Latitude]" - ] - }, - "execution_count": 3, - "metadata": { - "application/vnd.holoviews_exec.v0+json": { - "id": "p1013" - } - }, - "output_type": "execute_result" - } - ], - "execution_count": 3 + "outputs": [], + "execution_count": null }, { "metadata": {}, @@ -627,112 +92,14 @@ "id": "c7a07184bc48fa47" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:09:14.105342Z", - "start_time": "2024-12-20T02:09:14.032478Z" - } - }, + "metadata": {}, "cell_type": "code", "source": [ "uxgrid.plot.edges(title=\"Edge Plot\")" ], "id": "8fa4b5a83e176bc", - "outputs": [ - { - "data": {}, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "
\n", - "
\n", - "" - ], - "application/vnd.holoviews_exec.v0+json": "", - "text/plain": [ - ":Path [Longitude,Latitude]" - ] - }, - "execution_count": 4, - "metadata": { - "application/vnd.holoviews_exec.v0+json": { - "id": "p1094" - } - }, - "output_type": "execute_result" - } - ], - "execution_count": 4 + "outputs": [], + "execution_count": null }, { "metadata": {}, @@ -749,354 +116,61 @@ "id": "bb28fe23ce8bac55" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:10:10.589449Z", - "start_time": "2024-12-20T02:10:10.486887Z" - } - }, + "metadata": {}, "cell_type": "code", "source": "uxgrid.plot.corner_nodes(title=\"Corner Nodes\") * uxgrid.plot()", "id": "7d9662c1e5dac8f7", - "outputs": [ - { - "data": {}, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "
\n", - "
\n", - "" - ], - "application/vnd.holoviews_exec.v0+json": "", - "text/plain": [ - ":Overlay\n", - " .Points.I :Points [lon,lat]\n", - " .Path.I :Path [Longitude,Latitude]" - ] - }, - "execution_count": 7, - "metadata": { - "application/vnd.holoviews_exec.v0+json": { - "id": "p1305" - } - }, - "output_type": "execute_result" - } - ], - "execution_count": 7 + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "markdown", - "source": "### Face Centers", + "source": [ + "### Face Centers\n", + "\n", + "Face centers, which are stored in the `face_lat` and `face_lon` variables, represent the latitude and longitude center point of each face. " + ], "id": "366153db5c1e1f4f" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:10:22.019709Z", - "start_time": "2024-12-20T02:10:21.917050Z" - } - }, + "metadata": {}, "cell_type": "code", "source": "uxgrid.plot.face_centers(title=\"Face Centers\") * uxgrid.plot()", "id": "6199ebccebd321e7", - "outputs": [ - { - "data": {}, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "
\n", - "
\n", - "" - ], - "application/vnd.holoviews_exec.v0+json": "", - "text/plain": [ - ":Overlay\n", - " .Points.I :Points [lon,lat]\n", - " .Path.I :Path [Longitude,Latitude]" - ] - }, - "execution_count": 9, - "metadata": { - "application/vnd.holoviews_exec.v0+json": { - "id": "p1529" - } - }, - "output_type": "execute_result" - } - ], - "execution_count": 9 + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "markdown", - "source": "### Edge Centers", + "source": [ + "### Edge Centers\n", + "\n", + "Edge centers, which are stored in the `edge_lat` and `edge_lon` variables, represent the latitude and longitude center point of each edge. " + ], "id": "af4b3dcc8e32e88e" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:10:29.150941Z", - "start_time": "2024-12-20T02:10:29.045118Z" - } - }, + "metadata": {}, "cell_type": "code", "source": "uxgrid.plot.edge_centers(title=\"Face Centers\") * uxgrid.plot()", "id": "31a9075b5e5fa7a4", - "outputs": [ - { - "data": {}, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "
\n", - "
\n", - "" - ], - "application/vnd.holoviews_exec.v0+json": "", - "text/plain": [ - ":Overlay\n", - " .Points.I :Points [lon,lat]\n", - " .Path.I :Path [Longitude,Latitude]" - ] - }, - "execution_count": 10, - "metadata": { - "application/vnd.holoviews_exec.v0+json": { - "id": "p1641" - } - }, - "output_type": "execute_result" - } - ], - "execution_count": 10 + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "markdown", - "source": "### Plotting All Coordinates", + "source": [ + "### Plotting All Coordinates\n", + "\n", + "Putting all of these methods together, we can obtain a detail visual of our unstructured grid." + ], "id": "35505cab621918ed" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-20T02:10:44.720976Z", - "start_time": "2024-12-20T02:10:44.567124Z" - } - }, + "metadata": {}, "cell_type": "code", "source": [ "(\n", @@ -1107,105 +181,8 @@ ").opts(title=\"Grid Coordinates\", legend_position=\"top_right\")" ], "id": "d93c1ca0d2b3e2d0", - "outputs": [ - { - "data": {}, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
\n", - "
\n", - "
\n", - "" - ], - "application/vnd.holoviews_exec.v0+json": "", - "text/plain": [ - ":Overlay\n", - " .Path.I :Path [Longitude,Latitude]\n", - " .Points.Corner_Nodes :Points [lon,lat]\n", - " .Points.Face_Centers :Points [lon,lat]\n", - " .Points.Edge_Centers :Points [lon,lat]" - ] - }, - "execution_count": 11, - "metadata": { - "application/vnd.holoviews_exec.v0+json": { - "id": "p1753" - } - }, - "output_type": "execute_result" - } - ], - "execution_count": 11 + "outputs": [], + "execution_count": null }, { "metadata": {},