Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion examples/example_parcels.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,23 @@
# TODO: we must allow no time dimension for the below to work
#ds.mean('trajectory', skipna=True).traj.plot(color='r', label='Mean trajectory')
# In the meantime, we regrid to a regular 1D dataset to allow plotting a mean trajectory
ds = ds.traj.gridtime('1h')
ds = ds.traj.gridtime('4h')
ds.mean('trajectory').traj.plot(color='r', label='Mean trajectory')
plt.legend()
plt.show()

#%%
# Calculating and plotting the concentration of elements, after 6 and 24 hours
grid = ds.traj.make_grid(dx=3000)
ds_conc = ds.traj.concentration(grid)
plt.subplot(1,2,1)
ds_conc.number.isel(time=6).plot(vmin=0, vmax=20)
plt.scatter(ds.isel(time=6).lon, ds.isel(time=6).lat, s=1, color='black')
plt.subplot(1,2,2)
ds_conc.number.isel(time=24).plot(vmin=0, vmax=20)
plt.scatter(ds.isel(time=24).lon, ds.isel(time=24).lat, s=1, color='black')
plt.show()

#%%
# Calculating skillscore
# Defining the first trajectory to be the "true"
Expand Down
Loading