Skip to content

Commit

Permalink
deploy: 1caa4f4
Browse files Browse the repository at this point in the history
  • Loading branch information
erogluorhan committed Dec 10, 2023
1 parent 4ce076b commit 7d44df0
Show file tree
Hide file tree
Showing 12 changed files with 249 additions and 213 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions _sources/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 _sources/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
Binary file modified _static/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion notebooks/01-intro/01-unstructured-grid-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ <h2>Structured Grids<a class="headerlink" href="#structured-grids" title="Permal
warnings.warn(f&#39;Downloading: {url}&#39;, DownloadWarning)
</pre></div>
</div>
<img alt="../../_images/4536e35ff7d247c9bb14bf1d3153c7709e5e5e9cecb8bc4ac835a3a96122868a.png" src="../../_images/4536e35ff7d247c9bb14bf1d3153c7709e5e5e9cecb8bc4ac835a3a96122868a.png" />
<img alt="../../_images/d9bf8c63459d4bd3ecdad9acd88eba3265c43fba0bc8c58162700d3c56609a63.png" src="../../_images/d9bf8c63459d4bd3ecdad9acd88eba3265c43fba0bc8c58162700d3c56609a63.png" />
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 7d44df0

Please sign in to comment.