You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started/explanation_concepts.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,11 @@ A Parcels simulation is generally built up from four different components:
17
17
18
18
We discuss each component in more detail below. The subsections titled **"Learn how to"** link to more detailed [how-to guide notebooks](../user_guide/index.md) and more detailed _explanations_ of Parcels functionality are included under **"Read more about"** subsections. The full list of classes and methods is in the [API reference](../reference.md). If you want to learn by doing, check out the [quickstart tutorial](./tutorial_quickstart.md) to start creating your first Parcels simulation.
19
19
20
-
```{image} ../_static/concepts_diagram.svg
20
+
```{figure} ../_static/concepts_diagram.svg
21
21
:alt: Parcels concepts diagram
22
22
:width: 100%
23
+
24
+
Parcels concepts diagram with key classes in blue boxes
23
25
```
24
26
25
27
## 1. FieldSet
@@ -75,6 +77,16 @@ Once the environment has a `parcels.FieldSet` object, you can start defining you
75
77
2. The type of `parcels.Particle`: A default `Particle` or a custom `Particle`-type with additional `Variable`s (see the [custom kernel example](custom-kernel)).
76
78
3. Initial conditions for each `Variable` defined in the `Particle`, most notably the release coordinates of `time`, `z`, `lat` and `lon`.
77
79
80
+
```python
81
+
time = np.array([0])
82
+
z = np.array([0])
83
+
lat = np.array([0])
84
+
lon = np.array([0])
85
+
86
+
# Create a ParticleSet
87
+
pset = parcels.ParticleSet(fieldset, parcels.Particle, time, z, lat, lon)
88
+
```
89
+
78
90
### Learn how to create ParticleSets
79
91
80
92
-[Release particles at different times](../user_guide/examples/tutorial_delaystart.ipynb)
@@ -154,13 +166,21 @@ The execution of the simulation is done using the method **`parcels.ParticleSet.
154
166
3. The timestep `dt` at which to execute the kernels.
155
167
4. (Optional) The `ParticleFile` object to write the output to.
156
168
169
+
```python
170
+
runtime = np.timedelta64(1, "D")
171
+
dt = np.timedelta64(5, "m")
172
+
173
+
# Run the simulation
174
+
pset.execute(kernels, runtime, dt)
175
+
```
176
+
157
177
### Output
158
178
159
179
To analyse the particle data generated in the simulation, we need to define a `parcels.ParticleFile` and add it as an argument to `parcels.ParticleSet.execute()`. The output will be written in a [zarr format](https://zarr.readthedocs.io/en/stable/), which can be opened as an `xarray.Dataset`. The dataset will contain the particle data with at least `time`, `z`, `lat` and `lon`, for each particle at timesteps defined by the `outputdt` argument.
160
180
161
181
There are many ways to analyze particle output, and although we provide [a short tutorial to get started](./tutorial_output.ipynb), we recommend writing your own analysis code and checking out other projects such as [trajan](https://opendrift.github.io/trajan/index.html) and [Lagrangian Diagnostics](https://lagrangian-diags.readthedocs.io/en/latest/).
162
182
163
-
#### Learn how to
183
+
#### Learn how to run a simulation
164
184
165
185
-[Choose an appropriate timestep](../user_guide/examples/tutorial_numerical_accuracy.ipynb)
166
186
-[Work with Parcels output](./tutorial_output.ipynb)
0 commit comments