Note
Go to the end to download the full example code.
Sediment drift with resuspension
from datetime import timedelta, datetime
from opendrift.readers import reader_oscillating
from opendrift.models.sedimentdrift import SedimentDrift
Constructing an artificial current field where x- and y-components are oscilating with different amplitude and period
reader_oscx = reader_oscillating.Reader('x_sea_water_velocity',
amplitude=0.6, zero_time=datetime.utcnow())
reader_oscy = reader_oscillating.Reader('y_sea_water_velocity',
amplitude=.3, period_seconds=3600*5, zero_time=datetime.utcnow())
o = SedimentDrift(loglevel=50) # 0 for debug output
if True:
o.add_reader([reader_oscx, reader_oscy])
o.set_config('environment:fallback:y_wind', -6)
o.set_config('environment:fallback:x_wind', -3)
o.set_config('environment:fallback:sea_floor_depth_below_sea_level', 30) # 100m depth
else: # Using live data from Thredds instead of oscillating currents
o.add_readers_from_list([
'https://thredds.met.no/thredds/dodsC/sea/norkyst800m/1h/aggregate_be'])
/root/project/examples/example_sediments_resuspension.py:14: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
amplitude=0.6, zero_time=datetime.utcnow())
/root/project/examples/example_sediments_resuspension.py:16: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
amplitude=.3, period_seconds=3600*5, zero_time=datetime.utcnow())
Set threshold for bottom resuspension
o.set_config('vertical_mixing:resuspension_threshold', .5)
# Adding some horizontal and vertical diffusion
o.set_config('drift:current_uncertainty', 0.1)
o.set_config('drift:wind_uncertainty', 1)
o.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994')
#o.set_config('vertical_mixing:diffusivitymodel', 'environment')
Seeding sediments
o.seed_elements(lon=4.65, lat=60, number=10000,
time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=6)],
terminal_velocity=-.01) # 1 cm/s settling speed
o.run(time_step=1800, time_step_output=1800, duration=timedelta(hours=72))
/root/project/examples/example_sediments_resuspension.py:42: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=6)],
<xarray.Dataset> Size: 145MB Dimensions: ( trajectory: 10000, time: 145) Coordinates: * trajectory (trajectory) int64 80kB ... * time (time) datetime64[ns] 1kB ... Data variables: (12/25) status (trajectory, time) float32 6MB ... moving (trajectory, time) float32 6MB ... age_seconds (trajectory, time) float32 6MB ... origin_marker (trajectory, time) float32 6MB ... lon (trajectory, time) float32 6MB ... lat (trajectory, time) float32 6MB ... ... ... sea_surface_wave_period_at_variance_spectral_density_maximum (trajectory, time) float32 6MB ... sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment (trajectory, time) float32 6MB ... land_binary_mask (trajectory, time) float32 6MB ... ocean_vertical_diffusivity (trajectory, time) float32 6MB ... ocean_mixed_layer_thickness (trajectory, time) float32 6MB ... sea_floor_depth_below_sea_level (trajectory, time) float32 6MB ... Attributes: (12/124) Conventions: ... standard_name_vocabulary: ... featureType: ... title: ... summary: ... keywords: ... ... ... geospatial_lon_units: ... geospatial_lon_resolution: ... runtime: ... geospatial_vertical_min: ... geospatial_vertical_max: ... geospatial_vertical_positive: ...
xarray.Dataset
- trajectory: 10000
- time: 145
- trajectory(trajectory)int640 1 2 3 4 ... 9996 9997 9998 9999
- cf_role :
- trajectory_id
- dtype :
- <class 'numpy.int32'>
array([ 0, 1, 2, ..., 9997, 9998, 9999], shape=(10000,))
- time(time)datetime64[ns]2025-06-26T09:55:42.169405 ... 2...
- standard_name :
- time
- long_name :
- time
- dtype :
- <class 'numpy.float64'>
array(['2025-06-26T09:55:42.169405000', '2025-06-26T10:25:42.169405000', '2025-06-26T10:55:42.169405000', '2025-06-26T11:25:42.169405000', '2025-06-26T11:55:42.169405000', '2025-06-26T12:25:42.169405000', '2025-06-26T12:55:42.169405000', '2025-06-26T13:25:42.169405000', '2025-06-26T13:55:42.169405000', '2025-06-26T14:25:42.169405000', '2025-06-26T14:55:42.169405000', '2025-06-26T15:25:42.169405000', '2025-06-26T15:55:42.169405000', '2025-06-26T16:25:42.169405000', '2025-06-26T16:55:42.169405000', '2025-06-26T17:25:42.169405000', '2025-06-26T17:55:42.169405000', '2025-06-26T18:25:42.169405000', '2025-06-26T18:55:42.169405000', '2025-06-26T19:25:42.169405000', '2025-06-26T19:55:42.169405000', '2025-06-26T20:25:42.169405000', '2025-06-26T20:55:42.169405000', '2025-06-26T21:25:42.169405000', '2025-06-26T21:55:42.169405000', '2025-06-26T22:25:42.169405000', '2025-06-26T22:55:42.169405000', '2025-06-26T23:25:42.169405000', '2025-06-26T23:55:42.169405000', '2025-06-27T00:25:42.169405000', '2025-06-27T00:55:42.169405000', '2025-06-27T01:25:42.169405000', '2025-06-27T01:55:42.169405000', '2025-06-27T02:25:42.169405000', '2025-06-27T02:55:42.169405000', '2025-06-27T03:25:42.169405000', '2025-06-27T03:55:42.169405000', '2025-06-27T04:25:42.169405000', '2025-06-27T04:55:42.169405000', '2025-06-27T05:25:42.169405000', '2025-06-27T05:55:42.169405000', '2025-06-27T06:25:42.169405000', '2025-06-27T06:55:42.169405000', '2025-06-27T07:25:42.169405000', '2025-06-27T07:55:42.169405000', '2025-06-27T08:25:42.169405000', '2025-06-27T08:55:42.169405000', '2025-06-27T09:25:42.169405000', '2025-06-27T09:55:42.169405000', '2025-06-27T10:25:42.169405000', '2025-06-27T10:55:42.169405000', '2025-06-27T11:25:42.169405000', '2025-06-27T11:55:42.169405000', '2025-06-27T12:25:42.169405000', '2025-06-27T12:55:42.169405000', '2025-06-27T13:25:42.169405000', '2025-06-27T13:55:42.169405000', '2025-06-27T14:25:42.169405000', '2025-06-27T14:55:42.169405000', '2025-06-27T15:25:42.169405000', '2025-06-27T15:55:42.169405000', '2025-06-27T16:25:42.169405000', '2025-06-27T16:55:42.169405000', '2025-06-27T17:25:42.169405000', '2025-06-27T17:55:42.169405000', '2025-06-27T18:25:42.169405000', '2025-06-27T18:55:42.169405000', '2025-06-27T19:25:42.169405000', '2025-06-27T19:55:42.169405000', '2025-06-27T20:25:42.169405000', '2025-06-27T20:55:42.169405000', '2025-06-27T21:25:42.169405000', '2025-06-27T21:55:42.169405000', '2025-06-27T22:25:42.169405000', '2025-06-27T22:55:42.169405000', '2025-06-27T23:25:42.169405000', '2025-06-27T23:55:42.169405000', '2025-06-28T00:25:42.169405000', '2025-06-28T00:55:42.169405000', '2025-06-28T01:25:42.169405000', '2025-06-28T01:55:42.169405000', '2025-06-28T02:25:42.169405000', '2025-06-28T02:55:42.169405000', '2025-06-28T03:25:42.169405000', '2025-06-28T03:55:42.169405000', '2025-06-28T04:25:42.169405000', '2025-06-28T04:55:42.169405000', '2025-06-28T05:25:42.169405000', '2025-06-28T05:55:42.169405000', '2025-06-28T06:25:42.169405000', '2025-06-28T06:55:42.169405000', '2025-06-28T07:25:42.169405000', '2025-06-28T07:55:42.169405000', '2025-06-28T08:25:42.169405000', '2025-06-28T08:55:42.169405000', '2025-06-28T09:25:42.169405000', '2025-06-28T09:55:42.169405000', '2025-06-28T10:25:42.169405000', '2025-06-28T10:55:42.169405000', '2025-06-28T11:25:42.169405000', '2025-06-28T11:55:42.169405000', '2025-06-28T12:25:42.169405000', '2025-06-28T12:55:42.169405000', '2025-06-28T13:25:42.169405000', '2025-06-28T13:55:42.169405000', '2025-06-28T14:25:42.169405000', '2025-06-28T14:55:42.169405000', '2025-06-28T15:25:42.169405000', '2025-06-28T15:55:42.169405000', '2025-06-28T16:25:42.169405000', '2025-06-28T16:55:42.169405000', '2025-06-28T17:25:42.169405000', '2025-06-28T17:55:42.169405000', '2025-06-28T18:25:42.169405000', '2025-06-28T18:55:42.169405000', '2025-06-28T19:25:42.169405000', '2025-06-28T19:55:42.169405000', '2025-06-28T20:25:42.169405000', '2025-06-28T20:55:42.169405000', '2025-06-28T21:25:42.169405000', '2025-06-28T21:55:42.169405000', '2025-06-28T22:25:42.169405000', '2025-06-28T22:55:42.169405000', '2025-06-28T23:25:42.169405000', '2025-06-28T23:55:42.169405000', '2025-06-29T00:25:42.169405000', '2025-06-29T00:55:42.169405000', '2025-06-29T01:25:42.169405000', '2025-06-29T01:55:42.169405000', '2025-06-29T02:25:42.169405000', '2025-06-29T02:55:42.169405000', '2025-06-29T03:25:42.169405000', '2025-06-29T03:55:42.169405000', '2025-06-29T04:25:42.169405000', '2025-06-29T04:55:42.169405000', '2025-06-29T05:25:42.169405000', '2025-06-29T05:55:42.169405000', '2025-06-29T06:25:42.169405000', '2025-06-29T06:55:42.169405000', '2025-06-29T07:25:42.169405000', '2025-06-29T07:55:42.169405000', '2025-06-29T08:25:42.169405000', '2025-06-29T08:55:42.169405000', '2025-06-29T09:25:42.169405000', '2025-06-29T09:55:42.169405000'], dtype='datetime64[ns]')
- status(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- dtype :
- <class 'numpy.int32'>
- valid_range :
- [0 0]
- flag_values :
- [0]
- flag_meanings :
- active
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- moving(trajectory, time)float321.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- dtype :
- <class 'numpy.int32'>
- minval :
- 1
- maxval :
- 1
array([[ 1., 1., 1., ..., 1., 1., 1.], [ 1., 1., 1., ..., 1., 1., 1.], [ 1., 1., 1., ..., 1., 1., 1.], ..., [nan, nan, nan, ..., 1., 1., 1.], [nan, nan, nan, ..., 1., 1., 1.], [nan, nan, nan, ..., 1., 1., 1.]], shape=(10000, 145), dtype=float32)
- age_seconds(trajectory, time)float320.0 1.8e+03 ... 2.376e+05 2.394e+05
- dtype :
- <class 'numpy.float32'>
- units :
- s
- minval :
- 0.0
- maxval :
- 259200.0
array([[ 0., 1800., 3600., ..., 255600., 257400., 259200.], [ 0., 1800., 3600., ..., 255600., 257400., 259200.], [ 0., 1800., 3600., ..., 255600., 257400., 259200.], ..., [ nan, nan, nan, ..., 235800., 237600., 239400.], [ nan, nan, nan, ..., 235800., 237600., 239400.], [ nan, nan, nan, ..., 235800., 237600., 239400.]], shape=(10000, 145), dtype=float32)
- origin_marker(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- dtype :
- <class 'numpy.int32'>
- unit :
- description :
- An integer kept constant during the simulation. Different values may be used for different seedings, to separate elements during analysis. With GUI, only a single seeding is possible.
- flag_values :
- [0]
- flag_meanings :
- Seed_0
- minval :
- 0
- maxval :
- 0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- lon(trajectory, time)float324.65 4.654 4.652 ... 5.05 5.045
- dtype :
- <class 'numpy.float32'>
- units :
- degrees_east
- standard_name :
- longitude
- long_name :
- longitude
- axis :
- X
- minval :
- 4.315881
- maxval :
- 5.3330584
array([[4.65 , 4.6537676, 4.651987 , ..., 4.9544697, 4.9612417, 4.962221 ], [4.65 , 4.649303 , 4.650155 , ..., 4.977583 , 4.9822655, 4.9800773], [4.65 , 4.6506047, 4.646971 , ..., 5.0323076, 5.0339327, 5.0338264], ..., [ nan, nan, nan, ..., 4.895766 , 4.893511 , 4.8951797], [ nan, nan, nan, ..., 4.9127197, 4.916221 , 4.9185295], [ nan, nan, nan, ..., 5.049505 , 5.0498724, 5.0449004]], shape=(10000, 145), dtype=float32)
- lat(trajectory, time)float3260.0 60.0 60.0 ... 59.74 59.75
- dtype :
- <class 'numpy.float32'>
- units :
- degrees_north
- standard_name :
- latitude
- long_name :
- latitude
- axis :
- Y
- minval :
- 59.657192
- maxval :
- 60.03005
array([[60. , 59.99876 , 59.997643, ..., 59.73759 , 59.738747, 59.74631 ], [60. , 59.99921 , 59.996067, ..., 59.744495, 59.74635 , 59.74803 ], [60. , 59.99663 , 59.995205, ..., 59.727985, 59.729645, 59.73256 ], ..., [ nan, nan, nan, ..., 59.692207, 59.693336, 59.697193], [ nan, nan, nan, ..., 59.724514, 59.726467, 59.72711 ], [ nan, nan, nan, ..., 59.74052 , 59.74192 , 59.74587 ]], shape=(10000, 145), dtype=float32)
- z(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- dtype :
- <class 'numpy.float32'>
- units :
- m
- standard_name :
- z
- long_name :
- vertical position
- axis :
- Z
- positive :
- up
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- wind_drift_factor(trajectory, time)float320.02 0.02 0.02 ... 0.02 0.02 0.02
- dtype :
- <class 'numpy.float32'>
- units :
- 1
- description :
- Elements at surface are moved with this fraction of the vind vector, in addition to currents and Stokes drift
- minval :
- 0.02
- maxval :
- 0.02
array([[0.02, 0.02, 0.02, ..., 0.02, 0.02, 0.02], [0.02, 0.02, 0.02, ..., 0.02, 0.02, 0.02], [0.02, 0.02, 0.02, ..., 0.02, 0.02, 0.02], ..., [ nan, nan, nan, ..., 0.02, 0.02, 0.02], [ nan, nan, nan, ..., 0.02, 0.02, 0.02], [ nan, nan, nan, ..., 0.02, 0.02, 0.02]], shape=(10000, 145), dtype=float32)
- current_drift_factor(trajectory, time)float321.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- dtype :
- <class 'numpy.float32'>
- units :
- 1
- description :
- Elements are moved with this fraction of the current vector, in addition to currents and Stokes drift
- minval :
- 1.0
- maxval :
- 1.0
array([[ 1., 1., 1., ..., 1., 1., 1.], [ 1., 1., 1., ..., 1., 1., 1.], [ 1., 1., 1., ..., 1., 1., 1.], ..., [nan, nan, nan, ..., 1., 1., 1.], [nan, nan, nan, ..., 1., 1., 1.], [nan, nan, nan, ..., 1., 1., 1.]], shape=(10000, 145), dtype=float32)
- terminal_velocity(trajectory, time)float32-0.01 -0.01 -0.01 ... -0.01 -0.01
- dtype :
- <class 'numpy.float32'>
- units :
- m/s
- minval :
- -0.01
- maxval :
- -0.01
array([[-0.01, -0.01, -0.01, ..., -0.01, -0.01, -0.01], [-0.01, -0.01, -0.01, ..., -0.01, -0.01, -0.01], [-0.01, -0.01, -0.01, ..., -0.01, -0.01, -0.01], ..., [ nan, nan, nan, ..., -0.01, -0.01, -0.01], [ nan, nan, nan, ..., -0.01, -0.01, -0.01], [ nan, nan, nan, ..., -0.01, -0.01, -0.01]], shape=(10000, 145), dtype=float32)
- settled(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- dtype :
- <class 'numpy.uint8'>
- units :
- 1
- minval :
- 0
- maxval :
- 0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- x_sea_water_velocity(trajectory, time)float320.1764 0.02968 ... -0.08855
- minval :
- -1.0181191
- maxval :
- 1.0368029
array([[ 0.17640871, 0.02967839, 0.1004082 , ..., 0.3103231 , 0.09747124, 0.09747124], [ 0.0400192 , 0.08297087, 0.1150399 , ..., 0.21695755, -0.02193325, -0.02193325], [ 0.09787727, -0.06513479, 0.0094679 , ..., 0.10161655, 0.08584481, 0.08584481], ..., [ nan, nan, nan, ..., -0.01610446, 0.07293875, 0.07293875], [ nan, nan, nan, ..., 0.14972518, 0.13996573, 0.13996573], [ nan, nan, nan, ..., 0.05969844, -0.08855314, -0.08855314]], shape=(10000, 145), dtype=float32)
- y_sea_water_velocity(trajectory, time)float320.005166 0.04866 ... 0.3579 0.3579
- minval :
- -0.7497892
- maxval :
- 0.71832526
array([[ 0.00516581, 0.04865893, 0.15176554, ..., 0.21627903, 0.5807174 , 0.5807174 ], [ 0.08673598, -0.07284993, 0.23436658, ..., 0.2417741 , 0.26389414, 0.26389414], [-0.08482374, 0.01732432, 0.1525841 , ..., 0.19646019, 0.3284275 , 0.3284275 ], ..., [ nan, nan, nan, ..., 0.18402782, 0.37293833, 0.37293833], [ nan, nan, nan, ..., 0.23299763, 0.15924717, 0.15924717], [ nan, nan, nan, ..., 0.2141256 , 0.35787505, 0.35787505]], shape=(10000, 145), dtype=float32)
- sea_surface_height(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- upward_sea_water_velocity(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- x_wind(trajectory, time)float32-2.981 -4.244 ... -3.338 -3.338
- minval :
- -8.002298
- maxval :
- 1.8089983
array([[-2.981078 , -4.243658 , -2.8865137, ..., -4.9380593, -3.34425 , -3.34425 ], [-3.082034 , -2.827815 , -2.0777311, ..., -3.5350225, -2.32015 , -2.32015 ], [-3.957158 , -2.3757708, -1.5997821, ..., -2.5414686, -4.458367 , -4.458367 ], ..., [ nan, nan, nan, ..., -2.7222812, -1.0365078, -1.0365078], [ nan, nan, nan, ..., -2.0151415, -3.3912978, -3.3912978], [ nan, nan, nan, ..., -2.4119408, -3.3377228, -3.3377228]], shape=(10000, 145), dtype=float32)
- y_wind(trajectory, time)float32-4.097 -5.883 ... -5.671 -5.671
- minval :
- -10.789874
- maxval :
- -1.0925639
array([[-4.0973816, -5.883371 , -6.234717 , ..., -7.2351575, -5.630373 , -5.630373 ], [-6.7756643, -6.090957 , -4.563066 , ..., -6.344755 , -7.9961433, -7.9961433], [-6.18809 , -5.2804637, -5.106999 , ..., -4.6859593, -7.3998036, -7.3998036], ..., [ nan, nan, nan, ..., -5.7076945, -6.708225 , -6.708225 ], [ nan, nan, nan, ..., -5.610828 , -5.963494 , -5.963494 ], [ nan, nan, nan, ..., -6.3788004, -5.67101 , -5.67101 ]], shape=(10000, 145), dtype=float32)
- sea_surface_wave_stokes_drift_x_velocity(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- sea_surface_wave_stokes_drift_y_velocity(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- sea_surface_wave_period_at_variance_spectral_density_maximum(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment(trajectory, time)float324.33 6.198 5.871 ... 5.623 5.623
- minval :
- 1.5306671
- maxval :
- 9.854761
array([[4.329676 , 6.1984577, 5.870633 , ..., 7.484886 , 5.5956483, 5.5956483], [6.3604164, 5.738093 , 4.284174 , ..., 6.2060866, 7.114278 , 7.114278 ], [6.276234 , 4.947642 , 4.5728745, ..., 4.555 , 7.3818607, 7.3818607], ..., [ nan, nan, nan, ..., 5.403376 , 5.8 , 5.8 ], [ nan, nan, nan, ..., 5.09412 , 5.861952 , 5.861952 ], [ nan, nan, nan, ..., 5.8271236, 5.622699 , 5.622699 ]], shape=(10000, 145), dtype=float32)
- land_binary_mask(trajectory, time)float320.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- minval :
- 0.0
- maxval :
- 0.0
array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.], [nan, nan, nan, ..., 0., 0., 0.]], shape=(10000, 145), dtype=float32)
- ocean_vertical_diffusivity(trajectory, time)float320.02 0.02 0.02 ... 0.02 0.02 0.02
- minval :
- 0.02
- maxval :
- 0.02
array([[0.02, 0.02, 0.02, ..., 0.02, 0.02, 0.02], [0.02, 0.02, 0.02, ..., 0.02, 0.02, 0.02], [0.02, 0.02, 0.02, ..., 0.02, 0.02, 0.02], ..., [ nan, nan, nan, ..., 0.02, 0.02, 0.02], [ nan, nan, nan, ..., 0.02, 0.02, 0.02], [ nan, nan, nan, ..., 0.02, 0.02, 0.02]], shape=(10000, 145), dtype=float32)
- ocean_mixed_layer_thickness(trajectory, time)float3250.0 50.0 50.0 ... 50.0 50.0 50.0
- minval :
- 50.0
- maxval :
- 50.0
array([[50., 50., 50., ..., 50., 50., 50.], [50., 50., 50., ..., 50., 50., 50.], [50., 50., 50., ..., 50., 50., 50.], ..., [nan, nan, nan, ..., 50., 50., 50.], [nan, nan, nan, ..., 50., 50., 50.], [nan, nan, nan, ..., 50., 50., 50.]], shape=(10000, 145), dtype=float32)
- sea_floor_depth_below_sea_level(trajectory, time)float3230.0 30.0 30.0 ... 30.0 30.0 30.0
- minval :
- 30.0
- maxval :
- 30.0
array([[30., 30., 30., ..., 30., 30., 30.], [30., 30., 30., ..., 30., 30., 30.], [30., 30., 30., ..., 30., 30., 30.], ..., [nan, nan, nan, ..., 30., 30., 30.], [nan, nan, nan, ..., 30., 30., 30.], [nan, nan, nan, ..., 30., 30., 30.]], shape=(10000, 145), dtype=float32)
- trajectoryPandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999], dtype='int64', name='trajectory', length=10000))
- timePandasIndex
PandasIndex(DatetimeIndex(['2025-06-26 09:55:42.169405', '2025-06-26 10:25:42.169405', '2025-06-26 10:55:42.169405', '2025-06-26 11:25:42.169405', '2025-06-26 11:55:42.169405', '2025-06-26 12:25:42.169405', '2025-06-26 12:55:42.169405', '2025-06-26 13:25:42.169405', '2025-06-26 13:55:42.169405', '2025-06-26 14:25:42.169405', ... '2025-06-29 05:25:42.169405', '2025-06-29 05:55:42.169405', '2025-06-29 06:25:42.169405', '2025-06-29 06:55:42.169405', '2025-06-29 07:25:42.169405', '2025-06-29 07:55:42.169405', '2025-06-29 08:25:42.169405', '2025-06-29 08:55:42.169405', '2025-06-29 09:25:42.169405', '2025-06-29 09:55:42.169405'], dtype='datetime64[ns]', name='time', length=145, freq='30min'))
- Conventions :
- CF-1.11, ACDD-1.3
- standard_name_vocabulary :
- CF Standard Name Table v85
- featureType :
- trajectory
- title :
- OpenDrift trajectory simulation
- summary :
- Output from simulation with OpenDrift framework
- keywords :
- trajectory, drift, lagrangian, simulation
- history :
- Created 2025-06-26 09:55:46.596550
- date_created :
- 2025-06-26T09:55:46.596572
- source :
- Output from simulation with OpenDrift
- model_url :
- https://github.com/OpenDrift/opendrift
- opendrift_class :
- SedimentDrift
- opendrift_module :
- opendrift.models.sedimentdrift
- readers :
- odict_keys(['oscillating_reader', 'oscillating_reader_0', 'global_landmask'])
- time_coverage_start :
- 2025-06-26 09:55:42.169405
- time_step_calculation :
- 0:30:00
- time_step_output :
- 0:30:00
- config_environment:constant:x_sea_water_velocity :
- None
- config_environment:fallback:x_sea_water_velocity :
- 0
- config_environment:constant:y_sea_water_velocity :
- None
- config_environment:fallback:y_sea_water_velocity :
- 0
- config_environment:constant:sea_surface_height :
- None
- config_environment:fallback:sea_surface_height :
- 0
- config_environment:constant:upward_sea_water_velocity :
- None
- config_environment:fallback:upward_sea_water_velocity :
- 0
- config_environment:constant:x_wind :
- None
- config_environment:fallback:x_wind :
- -3.0
- config_environment:constant:y_wind :
- None
- config_environment:fallback:y_wind :
- -6.0
- config_environment:constant:sea_surface_wave_stokes_drift_x_velocity :
- None
- config_environment:fallback:sea_surface_wave_stokes_drift_x_velocity :
- 0
- config_environment:constant:sea_surface_wave_stokes_drift_y_velocity :
- None
- config_environment:fallback:sea_surface_wave_stokes_drift_y_velocity :
- 0
- config_environment:constant:sea_surface_wave_period_at_variance_spectral_density_maximum :
- None
- config_environment:fallback:sea_surface_wave_period_at_variance_spectral_density_maximum :
- 0
- config_environment:constant:sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment :
- None
- config_environment:fallback:sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment :
- 0
- config_environment:constant:land_binary_mask :
- None
- config_environment:fallback:land_binary_mask :
- None
- config_environment:constant:ocean_vertical_diffusivity :
- None
- config_environment:fallback:ocean_vertical_diffusivity :
- 0.02
- config_environment:constant:ocean_mixed_layer_thickness :
- None
- config_environment:fallback:ocean_mixed_layer_thickness :
- 50
- config_environment:constant:sea_floor_depth_below_sea_level :
- None
- config_environment:fallback:sea_floor_depth_below_sea_level :
- 30.0
- config_general:use_auto_landmask :
- True
- config_drift:current_uncertainty :
- 0.1
- config_drift:current_uncertainty_uniform :
- 0
- config_drift:max_speed :
- 2.0
- config_readers:max_number_of_fails :
- 1
- config_general:simulation_name :
- config_general:coastline_action :
- previous
- config_general:coastline_approximation_precision :
- 0.001
- config_general:time_step_minutes :
- 60
- config_general:time_step_output_minutes :
- None
- config_seed:ocean_only :
- True
- config_seed:number :
- 1
- config_drift:max_age_seconds :
- None
- config_drift:advection_scheme :
- euler
- config_drift:horizontal_diffusivity :
- 0
- config_drift:profiles_depth :
- 50
- config_drift:wind_uncertainty :
- 1.0
- config_drift:relative_wind :
- False
- config_drift:deactivate_north_of :
- None
- config_drift:deactivate_south_of :
- None
- config_drift:deactivate_east_of :
- None
- config_drift:deactivate_west_of :
- None
- config_seed:origin_marker :
- 0
- config_seed:z :
- 0
- config_seed:wind_drift_factor :
- 0.02
- config_seed:current_drift_factor :
- 1
- config_seed:terminal_velocity :
- -0.001
- config_seed:settled :
- 0
- config_drift:vertical_advection :
- True
- config_drift:vertical_advection_at_surface :
- False
- config_drift:vertical_mixing :
- True
- config_drift:vertical_mixing_at_surface :
- False
- config_vertical_mixing:timestep :
- 60
- config_vertical_mixing:diffusivitymodel :
- windspeed_Large1994
- config_vertical_mixing:background_diffusivity :
- 1.2e-05
- config_vertical_mixing:TSprofiles :
- False
- config_drift:wind_drift_depth :
- 0.1
- config_drift:stokes_drift :
- True
- config_drift:stokes_drift_profile :
- Phillips
- config_drift:use_tabularised_stokes_drift :
- False
- config_drift:tabularised_stokes_drift_fetch :
- 25000
- config_general:seafloor_action :
- lift_to_seafloor
- config_drift:truncate_ocean_model_below_m :
- None
- config_seed:seafloor :
- False
- config_vertical_mixing:resuspension_threshold :
- 0.5
- opendrift_version :
- 1.14.2
- seed_geojson :
- {"features": [], "type": "FeatureCollection"}
- simulation_time :
- 2025-06-26 09:55:46.830347
- reader_x_sea_water_velocity :
- ['oscillating_reader']
- reader_y_sea_water_velocity :
- ['oscillating_reader_0']
- reader_sea_surface_height :
- 0
- reader_upward_sea_water_velocity :
- 0
- reader_x_wind :
- -3.0
- reader_y_wind :
- -6.0
- reader_sea_surface_wave_stokes_drift_x_velocity :
- 0
- reader_sea_surface_wave_stokes_drift_y_velocity :
- 0
- reader_sea_surface_wave_period_at_variance_spectral_density_maximum :
- 0
- reader_sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment :
- 0
- reader_land_binary_mask :
- ['global_landmask']
- reader_ocean_vertical_diffusivity :
- 0.02
- reader_ocean_mixed_layer_thickness :
- 50
- reader_sea_floor_depth_below_sea_level :
- 30.0
- time_coverage_end :
- 2025-06-29 09:55:42.169405
- time_coverage_duration :
- P3DT0H0M0S
- time_coverage_resolution :
- P0DT0H30M0S
- performance :
- -------------------- Reader performance: -------------------- oscillating_reader 0:00:00.0 total 0:00:00.0 preparing 0:00:00.0 reading 0:00:00.0 masking -------------------- oscillating_reader_0 0:00:00.0 total 0:00:00.0 preparing 0:00:00.0 reading 0:00:00.0 masking -------------------- global_landmask 0:00:03.1 total 0:00:00.0 preparing 0:00:03.1 reading 0:00:00.0 masking -------------------- Performance: 31.9 total time 4.4 configuration 0.2 preparing main loop 0.0 moving elements to ocean 27.2 main loop 14.1 updating elements 12.5 vertical mixing 0.0 cleaning up --------------------
- geospatial_bounds_crs :
- EPSG:4326
- geospatial_bounds_vertical_crs :
- EPSG:5831
- geospatial_lat_min :
- 59.657192
- geospatial_lat_max :
- 60.03005
- geospatial_lat_units :
- degrees_north
- geospatial_lat_resolution :
- point
- geospatial_lon_min :
- 4.315881
- geospatial_lon_max :
- 5.3330584
- geospatial_lon_units :
- degrees_east
- geospatial_lon_resolution :
- point
- runtime :
- 0:00:31.996086
- geospatial_vertical_min :
- 0.0
- geospatial_vertical_max :
- 0.0
- geospatial_vertical_positive :
- up
Plotting the depth vs time
o.plot_property('z')

Animate sediment particles
o.animation(color='moving', colorbar=False, legend=['Sedimented', 'Moving'], fast=True, buffer=.01)
#o.animation_profile()

Total running time of the script: (2 minutes 49.185 seconds)