Skip to content

Commit 57680c0

Browse files
committed
Tidy up exercises and answers
1 parent 5a897d8 commit 57680c0

5 files changed

+140
-504
lines changed

notebooks/Exercise_01.ipynb

+24-131
Large diffs are not rendered by default.

notebooks/Exercise_01_answers.ipynb

+34-168
Large diffs are not rendered by default.

notebooks/Exercise_02.ipynb

+33-88
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@
99
"source": [
1010
"# LFRic Iris data manipulation and visualisation practical\n",
1111
"\n",
12-
"Let's apply what we've learned about data processing and visualisation of LFRic data in Iris and PyVista with the two exercises. \\\n",
12+
"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",
1313
"\n",
14-
"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",
15-
"\n",
16-
"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",
17-
"\n",
18-
"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",
19-
"\n"
14+
"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."
2015
]
2116
},
2217
{
@@ -32,7 +27,7 @@
3227
"id": "f928a878-5a5c-4abe-8635-a01d68a51b71",
3328
"metadata": {},
3429
"source": [
35-
"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"
30+
"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"
3631
]
3732
},
3833
{
@@ -45,9 +40,11 @@
4540
},
4641
{
4742
"cell_type": "code",
48-
"execution_count": 1,
43+
"execution_count": null,
4944
"id": "5b4e9653",
50-
"metadata": {},
45+
"metadata": {
46+
"tags": []
47+
},
5148
"outputs": [],
5249
"source": [
5350
"%matplotlib inline\n",
@@ -68,14 +65,16 @@
6865
"id": "69d50af6",
6966
"metadata": {},
7067
"source": [
71-
"The pv_conversions script contains two functions which convert LFRic cubes to pyvista objects. Load these two functions:"
68+
"The [pv_conversions](./pv_vonversions.py) script contains two functions which convert LFRic cubes to pyvista objects. Load these two functions:"
7269
]
7370
},
7471
{
7572
"cell_type": "code",
76-
"execution_count": 2,
73+
"execution_count": null,
7774
"id": "30e5c42d",
78-
"metadata": {},
75+
"metadata": {
76+
"tags": []
77+
},
7978
"outputs": [],
8079
"source": [
8180
"from pv_conversions import pv_from_lfric_cube\n",
@@ -92,9 +91,11 @@
9291
},
9392
{
9493
"cell_type": "code",
95-
"execution_count": 3,
94+
"execution_count": null,
9695
"id": "e8ad3844-5141-42f6-8837-869624e5612d",
97-
"metadata": {},
96+
"metadata": {
97+
"tags": []
98+
},
9899
"outputs": [],
99100
"source": [
100101
"data_path = '../example_data/'\n",
@@ -121,40 +122,29 @@
121122
"cell_type": "code",
122123
"execution_count": null,
123124
"id": "21a7a914",
124-
"metadata": {},
125+
"metadata": {
126+
"tags": []
127+
},
125128
"outputs": [],
126-
"source": []
129+
"source": [
130+
"# Continue here..."
131+
]
127132
},
128133
{
129134
"cell_type": "markdown",
130135
"id": "1e642914-08be-4243-8249-f66b381f0025",
131136
"metadata": {},
132137
"source": [
133138
"**Step 4** Plot the regridded UM data with PyVista. \\\n",
134-
"(hint: before you can do this you will need to convert you mesh to polydata using pv_from_lfric_cube)"
139+
"(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))"
135140
]
136141
},
137142
{
138143
"cell_type": "code",
139-
"execution_count": 5,
144+
"execution_count": null,
140145
"id": "35702c7a-f5dd-42c0-847e-33067870c167",
141146
"metadata": {},
142-
"outputs": [
143-
{
144-
"data": {
145-
"application/vnd.jupyter.widget-view+json": {
146-
"model_id": "2f1b4539b35347f488b33273e09c5f43",
147-
"version_major": 2,
148-
"version_minor": 0
149-
},
150-
"text/plain": [
151-
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
152-
]
153-
},
154-
"metadata": {},
155-
"output_type": "display_data"
156-
}
157-
],
147+
"outputs": [],
158148
"source": []
159149
},
160150
{
@@ -168,25 +158,10 @@
168158
},
169159
{
170160
"cell_type": "code",
171-
"execution_count": 6,
161+
"execution_count": null,
172162
"id": "b021e493-4581-48cb-8b4a-e477b4afdfa1",
173163
"metadata": {},
174-
"outputs": [
175-
{
176-
"data": {
177-
"application/vnd.jupyter.widget-view+json": {
178-
"model_id": "ee1084061f7e47e5b2c3fe8ef0453c8d",
179-
"version_major": 2,
180-
"version_minor": 0
181-
},
182-
"text/plain": [
183-
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
184-
]
185-
},
186-
"metadata": {},
187-
"output_type": "display_data"
188-
}
189-
],
164+
"outputs": [],
190165
"source": []
191166
},
192167
{
@@ -201,56 +176,26 @@
201176
},
202177
{
203178
"cell_type": "code",
204-
"execution_count": 7,
179+
"execution_count": null,
205180
"id": "8a22da6b-ade6-48f8-925f-4fa3a1a62fc3",
206181
"metadata": {},
207-
"outputs": [
208-
{
209-
"data": {
210-
"application/vnd.jupyter.widget-view+json": {
211-
"model_id": "aafef006f0814c0ba0dcf059de30729e",
212-
"version_major": 2,
213-
"version_minor": 0
214-
},
215-
"text/plain": [
216-
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
217-
]
218-
},
219-
"metadata": {},
220-
"output_type": "display_data"
221-
}
222-
],
182+
"outputs": [],
223183
"source": []
224184
},
225185
{
226186
"cell_type": "markdown",
227187
"id": "5da63976-8536-4181-862a-aba1138d9914",
228188
"metadata": {},
229189
"source": [
230-
"**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. "
190+
"**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. "
231191
]
232192
},
233193
{
234194
"cell_type": "code",
235-
"execution_count": 8,
195+
"execution_count": null,
236196
"id": "7df0c02a-1ee9-4b56-a5ce-41ee228293cd",
237197
"metadata": {},
238-
"outputs": [
239-
{
240-
"data": {
241-
"application/vnd.jupyter.widget-view+json": {
242-
"model_id": "6148592a79b241caba880ee14fc8bf13",
243-
"version_major": 2,
244-
"version_minor": 0
245-
},
246-
"text/plain": [
247-
"ViewInteractiveWidget(height=768, layout=Layout(height='auto', width='100%'), width=1024)"
248-
]
249-
},
250-
"metadata": {},
251-
"output_type": "display_data"
252-
}
253-
],
198+
"outputs": [],
254199
"source": []
255200
},
256201
{
@@ -278,7 +223,7 @@
278223
"name": "python",
279224
"nbconvert_exporter": "python",
280225
"pygments_lexer": "ipython3",
281-
"version": "3.9.15"
226+
"version": "3.9.16"
282227
},
283228
"toc-autonumbering": true,
284229
"toc-showtags": false

0 commit comments

Comments
 (0)