Skip to content

Commit 67c8354

Browse files
reint-fischerreint-fischer
authored andcommitted
flesh out some text
1 parent cc666a9 commit 67c8354

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

docs/getting_started/explanation_concepts.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ A Parcels simulation is generally built up from four different components:
1717

1818
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.
1919

20-
```{image} ../_static/concepts_diagram.svg
20+
```{figure} ../_static/concepts_diagram.svg
2121
:alt: Parcels concepts diagram
2222
:width: 100%
23+
24+
Parcels concepts diagram with key classes in blue boxes
2325
```
2426

2527
## 1. FieldSet
@@ -75,6 +77,16 @@ Once the environment has a `parcels.FieldSet` object, you can start defining you
7577
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)).
7678
3. Initial conditions for each `Variable` defined in the `Particle`, most notably the release coordinates of `time`, `z`, `lat` and `lon`.
7779

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+
7890
### Learn how to create ParticleSets
7991

8092
- [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.
154166
3. The timestep `dt` at which to execute the kernels.
155167
4. (Optional) The `ParticleFile` object to write the output to.
156168

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+
157177
### Output
158178

159179
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.
160180

161181
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/).
162182

163-
#### Learn how to
183+
#### Learn how to run a simulation
164184

165185
- [Choose an appropriate timestep](../user_guide/examples/tutorial_numerical_accuracy.ipynb)
166186
- [Work with Parcels output](./tutorial_output.ipynb)

0 commit comments

Comments
 (0)