Skip to content

Commit

Permalink
wording in data mapping notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc2 committed Dec 10, 2023
1 parent bdafe59 commit d75cc51
Showing 1 changed file with 26 additions and 53 deletions.
79 changes: 26 additions & 53 deletions notebooks/01-intro/03-data-mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,23 @@
{
"cell_type": "markdown",
"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 chose."
"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
}
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"outputs": [],
"source": [
"import uxarray as ux"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-05T01:05:49.720479200Z",
"start_time": "2023-12-05T01:05:46.693609900Z"
}
"collapsed": false
}
},
{
Expand Down Expand Up @@ -80,7 +78,7 @@
"source": [
"## Edge-Centered Data\n",
"\n",
"Edge-Centered data is assigned to the edge that connects each pair of Nodes.\n",
"Edge-Centered data is assigned to the edge that connects each pair of modes.\n",
"\n",
"![Edges](../images/sample/edges.jpg)"
],
Expand All @@ -91,42 +89,29 @@
{
"cell_type": "markdown",
"source": [
"## Identifying Data Mapping with UXarray\n",
"## Identifying Data Mappings with UXarray\n",
"\n",
"We can identify what element a data variable is mapped to by looking at the dimensions of a `UxDataArray` or `UxDataset`"
"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": 2,
"execution_count": null,
"outputs": [],
"source": [
"file_dir = \"../../meshfiles/\""
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-05T01:05:49.723990Z",
"start_time": "2023-12-05T01:05:49.722988300Z"
}
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [
{
"data": {
"text/plain": "('n_face',)"
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": null,
"outputs": [],
"source": [
"grid_filename_mpas = file_dir + \"oQU480.grid.nc\"\n",
"data_filename_mpas = file_dir + \"oQU480.data.nc\"\n",
Expand All @@ -135,26 +120,22 @@
"uxds_mpas[\"bottomDepth\"].dims"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-05T01:05:49.825485800Z",
"start_time": "2023-12-05T01:05:49.723990Z"
}
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 4,
"outputs": [
{
"data": {
"text/plain": "('time', 'meshLayers', 'n_node')"
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
"cell_type": "markdown",
"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,
"outputs": [],
"source": [
"grid_filename_geoflow = file_dir + \"geoflow.grid.nc\"\n",
"data_filename_geoflow = file_dir + \"geoflow.data.nc\"\n",
Expand All @@ -163,21 +144,13 @@
"uxds_geoflow[\"v1\"].dims"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-12-05T01:05:49.862064400Z",
"start_time": "2023-12-05T01:05:49.824486700Z"
}
"collapsed": false
}
},
{
"cell_type": "markdown",
"source": [
"For \"v1\", we can see that in addition to the \"n_face\" dimension, it also contains \"time\" and \"meshLayers\" dimensions.\n",
"\n",
"This can be preceived as \"v1\" residing on each node over some time and layer dimension. \n",
"\n",
"\n"
"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
Expand Down

0 comments on commit d75cc51

Please sign in to comment.