@@ -212,8 +212,8 @@ When we check the output, we can see that the particles have returned to their o
212212df_back = parcels.read_particlefile("output-backwards.parquet")
213213
214214scatter = plt.scatter(df_back['lon'], df_back['lat'], c=df_back['time'])
215- particles_at_start = df_back.filter(pl.col("time") == df_back["time"].max())
216- plt.scatter(particles_at_start ['lon'], particles_at_start ['lat'], facecolors="none", edgecolors='r') # starting positions
215+ particles_at_max_time = df_back.filter(pl.col("time") == df_back["time"].max())
216+ plt.scatter(particles_at_max_time ['lon'], particles_at_max_time ['lat'], facecolors="none", edgecolors='r') # starting positions
217217plt.xlabel("Longitude [deg E]")
218218plt.xlim(31,33)
219219plt.ylabel("Latitude [deg N]")
@@ -226,6 +226,7 @@ Using Euler forward advection, the final positions are equal to the original pos
226226
227227``` {code-cell}
228228# testing that final location == original location
229- np.testing.assert_almost_equal(particles_at_start["lat"], lat, 2)
230- np.testing.assert_almost_equal(particles_at_start['lon'], lon, 2)
229+ particles_at_min_time = df_back.filter(pl.col("time") == df_back["time"].min())
230+ np.testing.assert_almost_equal(particles_at_min_time["lat"], lat, 2)
231+ np.testing.assert_almost_equal(particles_at_min_time['lon'], lon, 2)
231232```
0 commit comments