Skip to content

Commit

Permalink
Fix small typos
Browse files Browse the repository at this point in the history
  • Loading branch information
erogluorhan committed Dec 10, 2023
1 parent fa1660f commit 1caa4f4
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 53 deletions.
4 changes: 2 additions & 2 deletions notebooks/01-intro/02-data-structures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@
"source": [
"## `UxDataset` & `UxDataArray` Data Structures\n",
"\n",
"UXarray inherits from Xarray's two core data structures `Dataset` & `DataArary` to provide a grid-informed implementation through the `UxDataset` & `UxDataArray` data structures. \n",
"UXarray inherits from Xarray's two core data structures `Dataset` & `DataArray` to provide a grid-informed implementation through the `UxDataset` & `UxDataArray` data structures. \n",
"\n",
"The major difference between them is that UXarray's implementation is paired with a `Grid` object, accessed through the `.uxgrid` property.\n",
"\n",
"UXarray also provides a overloaded `ux.open_dataset` method, which takes in both a Grid and Data file path to construct a `UxDataset`\n"
"UXarray also provides an overloaded `ux.open_dataset` method, which takes in both a Grid and Data file path to construct a `UxDataset`\n"
]
},
{
Expand Down
138 changes: 87 additions & 51 deletions notebooks/01-intro/03-data-mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,41 @@
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"When attempting to visualize a data variable that resides on an unstructured grid, it's important to identify what element it is mapped to, since that will dictate what visualization to choose.\n",
"\n",
"This notebook provides a quick over of how data is commonly mapped to unstructured grid elements."
],
"metadata": {
"collapsed": false
}
"This notebook provides a quick overview of how data is commonly mapped to unstructured grid elements."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"import uxarray as ux"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"is_executing": true,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Sample Mesh\n",
"\n",
Expand All @@ -40,121 +53,144 @@
"Below is a basic example of an Unstructured Grid, containing 13 Nodes, 15 Edges, and 3 Faces.\n",
"\n",
"![Sample Mesh](../images/sample/sample_mesh.png)"
],
"metadata": {
"collapsed": false,
"is_executing": true
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Face-Centered Data\n",
"\n",
"Face-Centered data is mapped to the area that each face covers. \n",
"\n",
"![Faces](../images/sample/faces.png)\n"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Node-Centered Data\n",
"\n",
"Node-Centered data is assigned to the corners of each face.\n",
"\n",
"\n",
"![Faces](../images/sample/nodes.png)"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Edge-Centered Data\n",
"\n",
"Edge-Centered data is assigned to the edge that connects each pair of modes.\n",
"\n",
"![Edges](../images/sample/edges.jpg)"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Identifying Data Mappings with UXarray\n",
"\n",
"We can identify what element a data variable is mapped to by looking at the final dimensions of a `UxDataArray` or `UxDataset`"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"file_dir = \"../../meshfiles/\""
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"grid_filename_mpas = file_dir + \"oQU480.grid.nc\"\n",
"data_filename_mpas = file_dir + \"oQU480.data.nc\"\n",
"uxds_mpas = ux.open_dataset(grid_filename_mpas, data_filename_mpas)\n",
"\n",
"uxds_mpas[\"bottomDepth\"].dims"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"The variable ``bottomDepth`` has a dimension of ``n_face``, which means that it is mapped to faces."
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"grid_filename_geoflow = file_dir + \"geoflow.grid.nc\"\n",
"data_filename_geoflow = file_dir + \"geoflow.data.nc\"\n",
"uxds_geoflow = ux.open_dataset(grid_filename_geoflow, data_filename_geoflow)\n",
"\n",
"uxds_geoflow[\"v1\"].dims"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"The variable ``v1`` has a final dimension of ``n_node``, which means that it is mapped to the corner nodes of each face. However, it also has additional dimensions, ``time`` and ``meshLayers``. These additional dimensions describe the dimensionality of the data outside the unstructured grid, representing the temporal and vertical dimensions."
],
"metadata": {
"collapsed": false
}
]
}
],
"metadata": {
Expand All @@ -173,7 +209,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.11.6"
},
"nbdime-conflicts": {
"local_diff": [
Expand Down

0 comments on commit 1caa4f4

Please sign in to comment.