Skip to content

Commit 2801d59

Browse files
Changing tutorial name to Manipulating Field data
And added short description
1 parent 210bec6 commit 2801d59

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

docs/user_guide/examples/explanation_kernelloop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Besides having commutable Kernels, the main advantage of this implementation is
4343
Below is a simple example of some particles at the surface of the ocean. We create an idealised zonal wind flow that will "push" a particle that is already affected by the surface currents. The Kernel loop ensures that these two forces act at the same time and location.
4444

4545
```{note}
46-
Advecting particles by a combination of flow fields can be done with two separate kernels, as is shown below. However, it can also be done by summing the fields directly using `xarray` operations - provided the fields are defined on the same grid and have compatible dimensions. See the [summing fields tutorial](tutorial_summingfields.ipynb) for an example of that approach.
46+
Advecting particles by a combination of flow fields can be done with two separate kernels, as is shown below. However, it can also be done by summing the fields directly using `xarray` operations - provided the fields are defined on the same grid and have compatible dimensions. See the [manipulating field data tutorial](tutorial_manipulating_field_data.ipynb) for an example of that approach.
4747
```
4848

4949
```{code-cell}

docs/user_guide/examples/tutorial_manipulating_field_data.ipynb

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,23 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"# 🖥️ Summing Fields"
8+
"# 🖥️ Manipulating Field data"
99
]
1010
},
1111
{
1212
"cell_type": "markdown",
1313
"id": "1",
1414
"metadata": {},
1515
"source": [
16+
"Because Parcels `Field` objects are built on top of `xarray` DataArrays, you can leverage the powerful data manipulation capabilities of `xarray` to preprocess or modify your field data before using it in particle simulations. This tutorial provides some examples of how to leverage that power."
17+
]
18+
},
19+
{
20+
"cell_type": "markdown",
21+
"id": "2",
22+
"metadata": {},
23+
"source": [
24+
"## Summing Fields\n",
1625
"In some applications, you may want to sum multiple fields together to create a combined effect on particle movement. For example, you might want to combine ocean currents with wind-driven surface drift. This tutorial demonstrates how to sum multiple fields in Parcels and visualize the resulting particle trajectories.\n",
1726
"\n",
1827
"We base this tutorial on the example provided in the [Parcels Kernel loop explanation](explanation_kernelloop.md). There, we combined two kernels to simulate the joint effect of currents and winds.\n",
@@ -25,7 +34,7 @@
2534
{
2635
"cell_type": "code",
2736
"execution_count": null,
28-
"id": "2",
37+
"id": "3",
2938
"metadata": {},
3039
"outputs": [],
3140
"source": [
@@ -62,7 +71,7 @@
6271
},
6372
{
6473
"cell_type": "markdown",
65-
"id": "3",
74+
"id": "4",
6675
"metadata": {},
6776
"source": [
6877
"Now here comes the trick: we can simply sum the fields together using `xarray` operations"
@@ -71,7 +80,7 @@
7180
{
7281
"cell_type": "code",
7382
"execution_count": null,
74-
"id": "4",
83+
"id": "5",
7584
"metadata": {},
7685
"outputs": [],
7786
"source": [
@@ -82,7 +91,7 @@
8291
},
8392
{
8493
"cell_type": "markdown",
85-
"id": "5",
94+
"id": "6",
8695
"metadata": {},
8796
"source": [
8897
"```{note}\n",
@@ -92,7 +101,7 @@
92101
},
93102
{
94103
"cell_type": "markdown",
95-
"id": "6",
104+
"id": "7",
96105
"metadata": {},
97106
"source": [
98107
"We can then run the same simulation as in the [Kernel loop explanation tutorial](explanation_kernelloop.md), but now using the combined fields. We only need the default advection kernel now, since the effects of both currents and winds are already included in the summed fields."
@@ -101,7 +110,7 @@
101110
{
102111
"cell_type": "code",
103112
"execution_count": null,
104-
"id": "7",
113+
"id": "8",
105114
"metadata": {
106115
"tags": [
107116
"hide-output"
@@ -135,7 +144,7 @@
135144
},
136145
{
137146
"cell_type": "markdown",
138-
"id": "8",
147+
"id": "9",
139148
"metadata": {},
140149
"source": [
141150
"We can then plot the trajectories, and confirm that they particles move the same as in the [Kernel loop explanation tutorial](explanation_kernelloop.md), where we combined the effects of currents and winds using two separate kernels."
@@ -144,7 +153,7 @@
144153
{
145154
"cell_type": "code",
146155
"execution_count": null,
147-
"id": "9",
156+
"id": "10",
148157
"metadata": {},
149158
"outputs": [],
150159
"source": [

0 commit comments

Comments
 (0)