Skip to content

Commit

Permalink
Tidy up exercises and answers
Browse files Browse the repository at this point in the history
  • Loading branch information
BHFock committed Mar 31, 2023
1 parent 5a897d8 commit 57680c0
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 504 deletions.
155 changes: 24 additions & 131 deletions notebooks/Exercise_01.ipynb

Large diffs are not rendered by default.

202 changes: 34 additions & 168 deletions notebooks/Exercise_01_answers.ipynb

Large diffs are not rendered by default.

121 changes: 33 additions & 88 deletions notebooks/Exercise_02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@
"source": [
"# LFRic Iris data manipulation and visualisation practical\n",
"\n",
"Let's apply what we've learned about data processing and visualisation of LFRic data in Iris and PyVista with the two exercises. \\\n",
"Let's apply what we've learned in Section 01 to Section05 with the two exercises. The aim is to use the prompts to write the code yourself, but we have also provided a separate notebook containing the answers if you are stuck. All the information needed to write the code for this practical can be found in the notebooks in the first part of this practical.\n",
"\n",
"The aim is to use the prompts to write the code yourself, but we have also provided a separate notebook containing the answers if you are stuck \\\n",
"\n",
"All the information needed to write the code for this practical can be found in the notebooks in the first part of this practical \\\n",
"\n",
"Note: this is delivered in Jupyter labs, but sometime the PyVista and GeoVista plotting is laggy in labs. If you prefer you can run in ipython.\n",
"\n"
"Note: This is delivered in JupyterLabs, but sometime the PyVista and GeoVista plotting is laggy in labs. If you prefer you can run in IPython."
]
},
{
Expand All @@ -32,7 +27,7 @@
"id": "f928a878-5a5c-4abe-8635-a01d68a51b71",
"metadata": {},
"source": [
"Now you can do a similar exercise compared to the previous Exercise 1, but regrid UM data onto a LFRic mesh and plot the data using PyVista"
"Now you can do a similar exercise compared to the previous [Exercise 01](./Exercise_01.ipynb), but regrid UM data onto a LFRic mesh and plot the data using PyVista"
]
},
{
Expand All @@ -45,9 +40,11 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "5b4e9653",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand All @@ -68,14 +65,16 @@
"id": "69d50af6",
"metadata": {},
"source": [
"The pv_conversions script contains two functions which convert LFRic cubes to pyvista objects. Load these two functions:"
"The [pv_conversions](./pv_vonversions.py) script contains two functions which convert LFRic cubes to pyvista objects. Load these two functions:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "30e5c42d",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from pv_conversions import pv_from_lfric_cube\n",
Expand All @@ -92,9 +91,11 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "e8ad3844-5141-42f6-8837-869624e5612d",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"data_path = '../example_data/'\n",
Expand All @@ -121,40 +122,29 @@
"cell_type": "code",
"execution_count": null,
"id": "21a7a914",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": []
"source": [
"# Continue here..."
]
},
{
"cell_type": "markdown",
"id": "1e642914-08be-4243-8249-f66b381f0025",
"metadata": {},
"source": [
"**Step 4** Plot the regridded UM data with PyVista. \\\n",
"(hint: before you can do this you will need to convert you mesh to polydata using pv_from_lfric_cube)"
"(hint: before you can do this you will need to convert you mesh to polydata using pv_from_lfric_cube as explained in [Section 03](./Sec_03_Plotting.ipynb))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "35702c7a-f5dd-42c0-847e-33067870c167",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2f1b4539b35347f488b33273e09c5f43",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": []
},
{
Expand All @@ -168,25 +158,10 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "b021e493-4581-48cb-8b4a-e477b4afdfa1",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ee1084061f7e47e5b2c3fe8ef0453c8d",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": []
},
{
Expand All @@ -201,56 +176,26 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "8a22da6b-ade6-48f8-925f-4fa3a1a62fc3",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "aafef006f0814c0ba0dcf059de30729e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "5da63976-8536-4181-862a-aba1138d9914",
"metadata": {},
"source": [
"**Step 7** In notebook Section 3, we see how to use the plotter.camera_position = viewpoint functionality. Try this out with the surface temperature data. "
"**Step 7** In notebook [Section 03](./Sec_03_plotting.ipynb), we see how to use the plotter.camera_position = viewpoint functionality. Try this out with the surface temperature data. "
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "7df0c02a-1ee9-4b56-a5ce-41ee228293cd",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6148592a79b241caba880ee14fc8bf13",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": []
},
{
Expand Down Expand Up @@ -278,7 +223,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
"version": "3.9.16"
},
"toc-autonumbering": true,
"toc-showtags": false
Expand Down
Loading

0 comments on commit 57680c0

Please sign in to comment.