diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe5f4559..4fa4c46d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,6 +47,5 @@ repos: additional_dependencies: [black] - id: nbqa-pyupgrade additional_dependencies: [pyupgrade] - exclude: foundations/quickstart.ipynb - id: nbqa-isort additional_dependencies: [isort] diff --git a/README.md b/README.md index 128d7c3b..8831fcb0 100644 --- a/README.md +++ b/README.md @@ -9,25 +9,28 @@ [![Binder](https://binder.projectpythia.org/badge_logo.svg)](https://binder.projectpythia.org/v2/gh/ProjectPythia/unstructured-grid-viz-cookbook.git/main?labpath=notebooks) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10403389.svg)](https://doi.org/10.5281/zenodo.10403389) -This Cookbook is a comprehensive showcase of workflows & techniques for visualizing Unstructured Grids using [UXarray](https://uxarray.readthedocs.io/). +This Cookbook is a comprehensive showcase of workflows & techniques for visualizing Unstructured Grids using [UXarray](https://uxarray.readthedocs.io/), +also providing foundational information on unstructured grids. ## Motivation -The ability to natively visualize unstructured grids is a much-needed ability within the Scientific Python Ecosystem, +The ability to natively visualize unstructured grids is much needed within the Scientific Python Ecosystem, which poses multiple challenges and needs to: -- Not regrid the source unstructured grid to structure +- Not regrid the source unstructured grid to structured grid - Take advantage of grid information, such as connectivity variables - Limit the amount of pre-processing needed to prepare the data for Python visualization tools -UXarray enables such visualization methods that operate directly on unstructured grid data, -providing Xarray-styled functionality to better read in -and use unstructured grid datasets that follow standard conventions. -UXarray supports a variety of unstructured grid formats including UGRID, MPAS, SCRIP, and Exodus, -and is extendable for other formats. +UXarray enables such visualization methods that operate directly on unstructured grid data, providing +Xarray-styled functionality to better read in and use unstructured grid datasets that follow standard +conventions. -This cookbook covers an introduction to unstructured grids and UXarray, -provides an overview of the visualization methods and libraries, and showcases several UXarray visualization functions. +UXarray supports a variety of unstructured grid formats and file types including UGRID, MPAS, ICON, CAM-SE, +SCRIP, Exodus, ESMF, GEOS, and FESOM2, and is extensible for other formats. + +This cookbook covers an introduction to unstructured grids and UXarray from a visualization standpoint, +providing foundational information about unstructured grids, visualization methods and libraries, and +introducing UXarray, and showcasing several UXarray visualization functions and workflows. ## Authors @@ -47,19 +50,32 @@ provides an overview of the visualization methods and libraries, and showcases s ## Structure -This cookbook is split up into a few chapters that provide a detailed overview of how to use UXarray to work with and visualize unstructured grid datasets: +This cookbook is split up into several chapters to communicate the content efffectively with different +levels of readers: + +**1. Foundations** + +Here, we cover overview of the foundational topics necessary to understand the content in this cookbook, +e.g. what unstructured grids are and how they are different than structured grids, what plotting libraries +and visualization techniques exist that can be helpful for unstructured grid visualization, and we briefly +mention how UXarray is related to these. -**1. Introduction to UXarray & Unstructured Grids** +**2. Introduction to UXarray** -Here we cover what unstructured grids are and how they are different than structured grids as well as whay UXarray could play a significant role in unstructured grid visualization. +In this chapter, we provide an overview of UXarray: An Xarray-extension for unstructured grid-formatted +climate and global weather data analysis and visualization. -**2. Methods & Libraries for Unstructured Grid Visualization** +**3. Plotting with UXarray** -In this chapter, we briefly introduce plotting libraries and their specific technologies as well as rendering techniques that could be used for unstructured grid plotting and are used as part of UXarray. +We provide an overview of the UXarray plotting API along with several visualization functionality, and cases +and examples that can be realized using such UXarray functionality; Grid visualization, Data visualization, +Geographic projections and features, to name a few. Also in this section, customization and interactivaity +with UXarray plotting and considerations with high-resolution plotting are also provided. -**3. UXarray Visualization** +**4. Visualization Recipies** -Several visualization cases and examples that can be realized using UXarray are provided in this chapter; grid topology plots, polygons, points, to name a few. Also in this section, the usage of UXarray plotting API and a discussion of visualization at scale are also provided. +In this last chapter, we offer to the interested readers a set of focused workflows that can be realized +with UXarray, including visualizations of MPAS and E3SM model output. ## Running the Notebooks diff --git a/_config.yml b/_config.yml index bef5b978..db383ccc 100644 --- a/_config.yml +++ b/_config.yml @@ -5,7 +5,7 @@ title: Unstructured Grids Visualization Cookbook description: Comprehensive showcase of workflows and techniques for visualizing Unstructured Grids using UXarray author: the Project Pythia Community logo: notebooks/images/logos/pythia_logo-white-rtext.svg -copyright: "2024" +copyright: "2025" execute: # To execute notebooks via a Binder instead, replace 'cache' with 'binder' diff --git a/_static/custom.css b/_static/custom.css index b0e83df1..59f43131 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -1,6 +1,6 @@ .bd-main .bd-content .bd-article-container { - max-width: 100%; /* default is 60em */ + max-width: 100%; /* default is 60em */ } .bd-page-width { - max-width: 100%; /* default is 88rem */ + max-width: 100%; /* default is 88rem */ } diff --git a/_static/images/grids.png b/_static/images/grids.png new file mode 100644 index 00000000..d5bfc8e7 Binary files /dev/null and b/_static/images/grids.png differ diff --git a/_static/images/uxarray-design.png b/_static/images/uxarray-design.png new file mode 100644 index 00000000..1d9d386e Binary files /dev/null and b/_static/images/uxarray-design.png differ diff --git a/_templates/footer-extra.html b/_templates/footer-extra.html index 27cb915d..2b794d89 100644 --- a/_templates/footer-extra.html +++ b/_templates/footer-extra.html @@ -1,27 +1,27 @@
diff --git a/_toc.yml b/_toc.yml index bac8f544..9b277ee2 100644 --- a/_toc.yml +++ b/_toc.yml @@ -4,23 +4,37 @@ parts: - caption: Preamble chapters: - file: notebooks/how-to-cite - - caption: Introduction to UXarray & Unstructured Grids + + - caption: Foundations + chapters: + - file: notebooks/01-foundations/unstructured-grids + - file: notebooks/01-foundations/plotting-libs + - file: notebooks/01-foundations/rendering-techniques + + - caption: Introduction to UXarray chapters: - - file: notebooks/01-intro/01-unstructured-grid-overview - - file: notebooks/01-intro/02-data-structures - - file: notebooks/01-intro/03-data-mapping + - file: notebooks/02-intro-to-uxarray/overview + - file: notebooks/02-intro-to-uxarray/grid + - file: notebooks/02-intro-to-uxarray/uxds-uxda + - file: notebooks/02-intro-to-uxarray/selection - - caption: Methods & Libraries for Unstructured Grid Visualization + - caption: Plotting with UXarray chapters: - - file: notebooks/02-methods/01-plotting-libraries - - file: notebooks/02-methods/02-rendering-techniques + - file: notebooks/03-plotting-with-uxarray/grid-viz + - file: notebooks/03-plotting-with-uxarray/data-viz + - file: notebooks/03-plotting-with-uxarray/geo + - file: notebooks/03-plotting-with-uxarray/customization + - file: notebooks/03-plotting-with-uxarray/high-res + - file: notebooks/03-plotting-with-uxarray/compare-xarray - - caption: UXarray Visualization + - caption: Visualization Recipes chapters: - - file: notebooks/03-uxarray-vis/01-plot-api - - file: notebooks/03-uxarray-vis/002-xarray-to-uxarray - - file: notebooks/03-uxarray-vis/02-grid-topology - - file: notebooks/03-uxarray-vis/03-polygons - - file: notebooks/03-uxarray-vis/04-points - - file: notebooks/03-uxarray-vis/07-animations - - file: notebooks/03-uxarray-vis/06-performance + - file: notebooks/04-recipes/mpas-atmo + - file: notebooks/04-recipes/mpas-ocean + # - file: notebooks/04-recipes/mpas-regional + - file: notebooks/04-recipes/e3sm +# - caption: Compatibility with Visualization Packages +# chapters: +# - file: notebooks/05-viz-packages/matplotlib +# - file: notebooks/05-viz-packages/datashader +# - file: notebooks/05-viz-packages/lonboard diff --git a/meshfiles/hex.data.nc b/meshfiles/hex.data.nc new file mode 100644 index 00000000..5fcd36bb Binary files /dev/null and b/meshfiles/hex.data.nc differ diff --git a/meshfiles/hex.grid.nc b/meshfiles/hex.grid.nc new file mode 100644 index 00000000..aa38e3d4 Binary files /dev/null and b/meshfiles/hex.grid.nc differ diff --git a/meshfiles/hex.node.data.nc b/meshfiles/hex.node.data.nc new file mode 100644 index 00000000..fa13a90d Binary files /dev/null and b/meshfiles/hex.node.data.nc differ diff --git a/meshfiles/ne30pg2.data.nc b/meshfiles/ne30pg2.data.nc new file mode 100644 index 00000000..edc7db42 Binary files /dev/null and b/meshfiles/ne30pg2.data.nc differ diff --git a/meshfiles/ne30pg2.grid.nc b/meshfiles/ne30pg2.grid.nc new file mode 100644 index 00000000..ae86055f Binary files /dev/null and b/meshfiles/ne30pg2.grid.nc differ diff --git a/meshfiles/x1.655362.data.nc b/meshfiles/x1.655362.data.nc new file mode 100644 index 00000000..87f02794 Binary files /dev/null and b/meshfiles/x1.655362.data.nc differ diff --git a/meshfiles/x1.655362.grid.nc b/meshfiles/x1.655362.grid.nc new file mode 100644 index 00000000..148a63ab Binary files /dev/null and b/meshfiles/x1.655362.grid.nc differ diff --git a/notebooks/01-foundations/plotting-libs.ipynb b/notebooks/01-foundations/plotting-libs.ipynb new file mode 100644 index 00000000..23bdb08e --- /dev/null +++ b/notebooks/01-foundations/plotting-libs.ipynb @@ -0,0 +1,371 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a107dfa27c1b5b7b", + "metadata": { + "panel-layout": { + "height": 423.611, + "visible": true, + "width": 100 + } + }, + "source": [ + "\n", + "\n", + "# Plotting Libraries\n", + "\n", + "### In this section, you'll learn:\n", + "\n", + "* What general purpose visualization packages are available in the Scientific Python Ecosystem\n", + "* How functionality of these packages can be useful for unstructured grids visualization\n", + "\n", + "### Related Documentation\n", + "\n", + "* No UXarray documentation is referenced here since this section covers the content from a general point of view.\n", + "\n", + "### Prerequisites\n", + "\n", + "| Concepts | Importance | Notes |\n", + "| --- | --- | --- |\n", + "| Python | Necessary | This notebook does not contain any Python code, but understanding those libraries comprehensively would require Python programming |\n", + "\n", + "**Time to learn**: 10 minutes\n", + "\n", + "-----\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "c6502995-401e-4f39-b789-1c39e93b02e8", + "metadata": { + "panel-layout": { + "height": 206.753, + "visible": true, + "width": 100 + } + }, + "source": [ + "In this section, we will introduce two visualization libraries/technologies and their features and functionality that can be useful for unstructured grids visualization before diving deep into plotting unstructured grids with UXarray in the next chapter." + ] + }, + { + "cell_type": "markdown", + "id": "aba250fa-bfe5-4e65-8f76-93bbc9466d67", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 50.816, + "visible": true, + "width": 100 + } + }, + "source": [ + "## HoloViz" + ] + }, + { + "cell_type": "markdown", + "id": "2f0181f8-2859-4a13-853e-9f4c89b7ad8d", + "metadata": { + "panel-layout": { + "height": 491.51, + "visible": true, + "width": 100 + } + }, + "source": [ + "[HoloViz](https://holoviz.org/) is a stack of tools (such as Holoviews, Datashader, Geoviews, SpatialPandas, hvPlot etc.) that provide high-level functionality to visualize even the very large datasets efficiently in Python. HoloViz packages are well-suited for unstructured grid visualization because:\n", + "\n", + "1. They provide rendering functionality for both vector geometries and rasterization, which will be detailed in the [next section](rendering-techniques). Such functionality is much needed for unstructured grid topology and data visualization purposes.\n", + "2. Unlike Matplotlib, they support using the connectivity information that comes from the unstructured grids\n", + "3. They are designed to be scalable for even the largest datasets that'd be generated as result of kilometer-scale analyses" + ] + }, + { + "cell_type": "markdown", + "id": "1e2b2a13-9bc4-43fc-a3e0-0f77cfbc2efc", + "metadata": { + "panel-layout": { + "height": 102.535, + "visible": true, + "width": 100 + } + }, + "source": [ + "Let us look at the particular HoloViz packages that can be useful for scalable visualization of unstructured grids." + ] + }, + { + "cell_type": "markdown", + "id": "2768839a-22d2-4543-8856-763bbd737c12", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 217.5, + "visible": true, + "width": 100 + } + }, + "source": [ + "### HoloViews\n", + "\n", + "[Holoviews](https://holoviews.org/about.html) houses several elements (e.g. `Path()`, `Points()`) that enables visualization of grid geometries such as nodes and edges. Similarly, other elements of this package (e.g. `Polygons()`) can be used for various polygon vector visulization purposes." + ] + }, + { + "cell_type": "markdown", + "id": "14578d1d-1582-4155-a845-9287b02937b7", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 44.0799, + "visible": true, + "width": 100 + } + }, + "source": [ + "### Datashader" + ] + }, + { + "cell_type": "markdown", + "id": "8552a1e4-2a52-4c4c-8b1f-2171c45923e8", + "metadata": { + "panel-layout": { + "height": 171.076, + "visible": true, + "width": 100 + } + }, + "source": [ + "[Datashader](https://datashader.org/about.html) is the graphics pipeline system of the HoloViz tool stack for creating meaningful representations of large datasets quickly and flexibly. Datashader's rasterization methods, transfer functions, and other shading operators can be utilized for rasterized polygon plotting." + ] + }, + { + "cell_type": "markdown", + "id": "ee79d625-0694-4449-b560-14dd3b938587", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 44.0799, + "visible": true, + "width": 100 + } + }, + "source": [ + "### GeoViews" + ] + }, + { + "cell_type": "markdown", + "id": "709f3439-e598-41b9-a3bb-e75c9c6297e9", + "metadata": { + "panel-layout": { + "height": 273.889, + "visible": true, + "width": 100 + } + }, + "source": [ + "[GeoViews](https://geoviews.org/index.html) provides features and functionality to visualize geographical, meteorological, and oceanographic datasets and features." + ] + }, + { + "cell_type": "markdown", + "id": "4630b0ef-3fac-4643-83c1-ad26c84d7207", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 44.0799, + "visible": true, + "width": 100 + } + }, + "source": [ + "### Spatialpandas" + ] + }, + { + "cell_type": "markdown", + "id": "e0dbdb54-839c-48b1-9fd4-f4f93305d696", + "metadata": { + "panel-layout": { + "height": 408.056, + "visible": true, + "width": 100 + } + }, + "source": [ + "Spatialpandas is a package that provides Pandas extension arrays for spatial/geometric operations. This package has an element called `GeoDataFrame`, which can be used directly by packages from the HoloViz stack such as hvPlot, Datashader, Holoviews, and Geoviews. Conversions from unstructured grids to `GeoDataFrame` can allow to perform visualizations directly in HoloViz packages." + ] + }, + { + "cell_type": "markdown", + "id": "32fb6a11-21f5-42f3-8a2e-e8262298fc1c", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 50.816, + "visible": true, + "width": 100 + } + }, + "source": [ + "## Matplotlib" + ] + }, + { + "cell_type": "markdown", + "id": "3fa8566f-2a2d-41d1-8c22-388f315ef56e", + "metadata": { + "panel-layout": { + "height": 533.75, + "visible": true, + "width": 100 + } + }, + "source": [ + "Matplotlib is the workhorse of Python visualization needs, for both general and geoscientific purposes. However, when it \n", + "comes to visualizing unstructured grids, Matplotlib's:\n", + "\n", + "1. Functionality is limited such that there is no way to use the connectivity information that comes with the unstructured grid \n", + "2. Scalability especially for kilometer-scale (e.g. individual storm-resolving) resolutions is limited. \n", + "\n", + "Matplotlib can still serve as a visualization backend for unstriuctured grid visualization, especially for the end-user who is familiar with Matplotlib and would like to create publication-quality outputs.\n", + "\n", + "Moreover, just like conversion to `Spatialpandas.GeoDataFrame`, conversions to Matplotlib data structures such as `Collections` can be utilized for unstructrued grid plotting directly with the Matplotlib interface." + ] + }, + { + "cell_type": "markdown", + "id": "81afad50-801f-4e8b-9022-ced33eb0bdd3", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 183.229, + "visible": true, + "width": 100 + } + }, + "source": [ + "### Collections \n", + "Detailed information about Matplotlib's Collections API can be found [here](https://matplotlib.org/stable/api/collections_api.html). Conversions to `LineCollection` and `PolyCollection` can help visualize Grid Geometries and data variables, respectively. " + ] + }, + { + "cell_type": "markdown", + "id": "f8f1b8bc-70f2-4d7c-a2cd-6c7b20f9d10b", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 44.0796, + "visible": true, + "width": 100 + } + }, + "source": [ + "### Cartopy" + ] + }, + { + "cell_type": "markdown", + "id": "a443de93-18ef-40d6-a24b-f7abb6ab38b6", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "panel-layout": { + "height": 322.378, + "visible": true, + "width": 100 + } + }, + "source": [ + "Cartopy is originally a Python library for cartographic visualizations with Matplotlib; however, they provide a number of features such as `crs`, i.e. Coordinate Reference Systems (a.k.a. projections), that are significant for cartographic visualizations." + ] + }, + { + "cell_type": "markdown", + "id": "29fc6539-2830-480f-81b1-e6e8d99508b0", + "metadata": {}, + "source": [ + "## What is next?\n", + "The next section will provide an overview of the rendering techniques that can be used for visualizing unstructrued grids." + ] + } + ], + "metadata": { + "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.12.6" + }, + "panel-cell-order": [ + "a107dfa27c1b5b7b", + "c6502995-401e-4f39-b789-1c39e93b02e8", + "aba250fa-bfe5-4e65-8f76-93bbc9466d67", + "2f0181f8-2859-4a13-853e-9f4c89b7ad8d", + "5d8acee1-cff1-440c-ba45-156e9c1b3d01", + "1e2b2a13-9bc4-43fc-a3e0-0f77cfbc2efc", + "2768839a-22d2-4543-8856-763bbd737c12", + "a34f9368-1a91-4e55-bf78-962e09a65bca", + "14578d1d-1582-4155-a845-9287b02937b7", + "8552a1e4-2a52-4c4c-8b1f-2171c45923e8", + "ee79d625-0694-4449-b560-14dd3b938587", + "709f3439-e598-41b9-a3bb-e75c9c6297e9", + "4630b0ef-3fac-4643-83c1-ad26c84d7207", + "e0dbdb54-839c-48b1-9fd4-f4f93305d696", + "32fb6a11-21f5-42f3-8a2e-e8262298fc1c", + "3fa8566f-2a2d-41d1-8c22-388f315ef56e", + "81afad50-801f-4e8b-9022-ced33eb0bdd3", + "b5a3ffb6-d046-4830-b1ff-93eb73b74de8", + "f8f1b8bc-70f2-4d7c-a2cd-6c7b20f9d10b", + "a443de93-18ef-40d6-a24b-f7abb6ab38b6" + ] + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/02-methods/02-rendering-techniques.ipynb b/notebooks/01-foundations/rendering-techniques.ipynb similarity index 51% rename from notebooks/02-methods/02-rendering-techniques.ipynb rename to notebooks/01-foundations/rendering-techniques.ipynb index 375e6b36..745018a8 100644 --- a/notebooks/02-methods/02-rendering-techniques.ipynb +++ b/notebooks/01-foundations/rendering-techniques.ipynb @@ -2,12 +2,45 @@ "cells": [ { "cell_type": "markdown", + "id": "60db6be101e99c83", "metadata": {}, "source": [ + "\n", + "\n", "# Rendering Techniques\n", - "---\n", "\n", - "Since Unstructured Grids require significantly more overhead to represent compared to Structured (a.k.a. Regular) grids, the choice of rendering technique plays an important in obtaining high-resolution, accurate, and scalable visualuations. \n", + "### In this section, you'll learn:\n", + "\n", + "* Rendering methods that can be used for unstructured grids visualization. \n", + "\n", + "\n", + "### Related Documentation\n", + "\n", + "* No UXarray documentation is referenced here since this section covers the content from a general point of view.\n", + "\n", + "\n", + "### Prerequisites\n", + "\n", + "| Concepts | Importance | Notes |\n", + "| --- | --- | --- |\n", + "| Geometry | Necessary | |\n", + "\n", + "**Time to learn**: 10 minutes\n", + "\n", + "-----\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "40b652f0-4a70-4b08-a0db-702b4d5e1545", + "metadata": {}, + "source": [ + "Since Unstructured Grids require significantly more overhead to represent compared to Structured grids, the choice of rendering technique plays an important role in obtaining high-resolution, accurate, and scalable visualizations. \n", "\n", "\n", "This notebook introduces relevant concepts and techniques that will be mentioned and used throughout this Cookbook." @@ -15,6 +48,7 @@ }, { "cell_type": "markdown", + "id": "95a35645-2c16-4506-8ae7-abf5e6f8c7e2", "metadata": { "collapsed": false, "jupyter": { @@ -24,13 +58,13 @@ "source": [ "## Vector (Shape) Geometries\n", "\n", - "The nodes, edges, and faces that make up an Unstructured Grid can each be converted into a geometric shape for visualization. These geometric shapes can often be referred to as vector graphics, since each geometry is mathematically represented when rendering.\n", + "The nodes (vertices), edges, and faces (cells) that make up an Unstructured Grid can each be converted into a geometric shape for visualization. These geometric shapes can often be referred to as vector graphics, since each geometry is mathematically represented when rendering.\n", "\n", - "For example, in the UXarray Visualization section, we will showcase how we can convert the faces in our Unstructured Grid into Polygons.\n", + "For example, in the \"Plotting with UXarray\" chapter, we will showcase how we can convert the faces in our Unstructured Grid into Polygons.\n", "\n", - "When constructing our visualization, we can render each face using directly onto the screen. \n", + "When constructing unstructured grids visualization, we can render each face directly onto the screen. \n", "\n", - "Rendering each face as a polygon will lead to visuals that look like this, which are extremely high-quality and represent the exact geometry of each face.\n", + "Rendering each face as a polygon will lead to visuals that look like this, which are high-quality since they represent the exact geometry of each face.\n", "\n", " \n", "\n", @@ -41,6 +75,7 @@ }, { "cell_type": "markdown", + "id": "b862e8ae-58e6-47cb-849b-631878b0090f", "metadata": { "collapsed": false, "jupyter": { @@ -59,6 +94,7 @@ }, { "cell_type": "markdown", + "id": "6f2fde1d-82b8-47c9-9852-0d4e7d7618ee", "metadata": { "collapsed": false, "jupyter": { @@ -71,6 +107,7 @@ }, { "cell_type": "markdown", + "id": "e5807c07-d64b-4f75-969c-bd908d6c134d", "metadata": { "collapsed": false, "jupyter": { @@ -80,14 +117,15 @@ "source": [ "One Python package which is used for representing and manipulating geometries is [Shapely](https://shapely.readthedocs.io/en/stable/manual.html).\n", "\n", - "UXarray uses Shapely paired with SpatialPandas and other packages to represent unstructured grid elements (nodes, edges, faces) as geometries for visualization.\n", + "Shapely can be paired with SpatialPandas and other packages to represent unstructured grid elements (nodes, edges, faces) as geometries for visualization.\n", "\n", "The following code snippets are basic examples of how these elements can be represented as geometries.\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, + "id": "78cbec48-6730-4562-80a5-ffc20515d087", "metadata": { "collapsed": false, "jupyter": { @@ -101,6 +139,7 @@ }, { "cell_type": "markdown", + "id": "91edd03c-c30e-4635-b9dd-1be2a59fff7a", "metadata": { "collapsed": false, "jupyter": { @@ -113,20 +152,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, + "id": "6a5942f1-9e27-470f-859d-9f9bcd458963", "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [], + "outputs": [ + { + "data": { + "image/svg+xml": [ + "" + ], + "text/plain": [ + "Note:
\n", + " The selection between vector graphics and rasterization needs to be made taking into account several factors such as how large is the dataset (i.e. how fine-resolution the data is), what data fidelity with the visualization is desired, what performance is expected, etc.\n", + "