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
Now that we have created a `parcels.FieldSet` object from the hydrodynamic data, we need to provide our second input: the virtual particles for which we will calculate the trajectories.
50
+
Now that we have created a `parcels.FieldSet` object from the hydrodynamic data, we need to provide our second input: the virtual particles for which we will calculate the trajectories.
51
51
52
52
We need to create a `parcels.ParticleSet` object with the particles' initial time and position. The `parcels.ParticleSet` object also needs to know about the `FieldSet` in which the particles "live". Finally, we need to specify the type of `parcels.Particle` we want to use. The default particles have `time`, `lon`, `lat`, and `z`, but you can easily add other `Variables` such as size, temperature, or age to create your own particles to mimic plastic or an [ARGO float](../user_guide/examples/tutorial_Argofloats.ipynb).
53
53
54
54
```{code-cell}
55
55
# Particle locations and initial time
56
56
npart = 10 # number of particles to be released
57
57
# release particles in a line along a meridian
58
-
lat = np.linspace(-32.5, -30.5, npart)
58
+
lat = np.linspace(-32.5, -30.5, npart)
59
59
lon = np.repeat(32, npart)
60
60
time = np.repeat(ds_in.time.values[0], npart) # at initial time of input data
61
61
z = np.repeat(ds_in.depth.values[0], npart) # at the first depth (surface)
The 10 particle trajectories are stored along the `trajectory` dimension, and each trajectory contains 25 observations (initial values + 24 hourly timesteps) along the `obs` dimension. The [working with Parcels output tutorial](./tutorial_output.ipynb) provides more detail about the dataset and how to analyse it.
127
+
The 10 particle trajectories are stored along the `trajectory` dimension, and each trajectory contains 25 observations (initial values + 24 hourly timesteps) along the `obs` dimension. The [working with Parcels output tutorial](./tutorial_output.ipynb) provides more detail about the dataset and how to analyse it.
128
128
129
129
Let's verify that Parcels has computed the advection of the virtual particles!
0 commit comments