Leeway

from datetime import timedelta
import cmocean
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.models.leeway import Leeway

lw = Leeway(loglevel=20)  # Set loglevel to 0 for debug information

# Atmospheric model for wind
#reader_arome = reader_netCDF_CF_generic.Reader('https://thredds.met.no/thredds/dodsC/mepslatest/meps_lagged_6_h_latest_2_5km_latest.nc')
reader_arome = reader_netCDF_CF_generic.Reader(lw.test_data_folder() +
    '16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc')

# Ocean model for current
#reader_norkyst = reader_netCDF_CF_generic.Reader('https://thredds.met.no/thredds/dodsC/mepslatest/meps_lagged_6_h_latest_2_5km_latest.nc')
reader_norkyst = reader_netCDF_CF_generic.Reader(lw.test_data_folder() +
    '16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc')

Out:

16:13:32 INFO    opendrift.models.basemodel: OpenDriftSimulation initialised (version 1.7.1 / v1.7.1-145-gdf95ed3)
16:13:32 INFO    opendrift.readers.reader_netCDF_CF_generic: Opening dataset: /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc
16:13:32 INFO    opendrift.readers.reader_netCDF_CF_generic: Opening dataset: /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc

Adding readers successively, and specifying which variables they shall provide. This way, order of adding readers does not matter

lw.add_reader(reader_norkyst,
              variables=['x_sea_water_velocity', 'y_sea_water_velocity'])
lw.add_reader(reader_arome, variables=['x_wind', 'y_wind'])
lw.set_config('environment:fallback:x_sea_water_velocity', 0)
lw.set_config('environment:fallback:y_sea_water_velocity', 0)

Seed leeway elements at defined position and time

object_type = 26  # 26 = Life-raft, no ballast
lw.seed_elements(lon=4.5, lat=59.6, radius=100, number=1000,
                 time=reader_arome.start_time, object_type=object_type)

Out:

16:13:32 INFO    opendrift.models.leeway: Seeding elements of object type 26: LIFE-RAFT-NB-1 (Life-raft, no ballast (NB) system, general (mean values))

Running model

lw.run(duration=timedelta(hours=48), time_step=900, time_step_output=3600)

Out:

16:13:32 INFO    opendrift.models.basemodel: Adding a dynamical landmask with max. priority based on assumed maximum speed of 5 m/s. Adding a customised landmask may be faster...
16:13:35 INFO    opendrift.models.basemodel: Using existing reader for land_binary_mask
16:13:35 INFO    opendrift.models.basemodel: All points are in ocean
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 00:00:00 - step 1 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 00:15:00 - step 2 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 00:30:00 - step 3 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 00:45:00 - step 4 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 01:00:00 - step 5 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 01:15:00 - step 6 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 01:30:00 - step 7 of 192 - 1000 active elements (0 deactivated)
16:13:35 INFO    opendrift.models.basemodel: 2015-11-16 01:45:00 - step 8 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 02:00:00 - step 9 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 02:15:00 - step 10 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 02:30:00 - step 11 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 02:45:00 - step 12 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 03:00:00 - step 13 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 03:15:00 - step 14 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 03:30:00 - step 15 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 03:45:00 - step 16 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 04:00:00 - step 17 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 04:15:00 - step 18 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 04:30:00 - step 19 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 04:45:00 - step 20 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 05:00:00 - step 21 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 05:15:00 - step 22 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 05:30:00 - step 23 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 05:45:00 - step 24 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 06:00:00 - step 25 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 06:15:00 - step 26 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 06:30:00 - step 27 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 06:45:00 - step 28 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 07:00:00 - step 29 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 07:15:00 - step 30 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 07:30:00 - step 31 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 07:45:00 - step 32 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 08:00:00 - step 33 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 08:15:00 - step 34 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 08:30:00 - step 35 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 08:45:00 - step 36 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 09:00:00 - step 37 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 09:15:00 - step 38 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 09:30:00 - step 39 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 09:45:00 - step 40 of 192 - 1000 active elements (0 deactivated)
16:13:36 INFO    opendrift.models.basemodel: 2015-11-16 10:00:00 - step 41 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 10:15:00 - step 42 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 10:30:00 - step 43 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 10:45:00 - step 44 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 11:00:00 - step 45 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 11:15:00 - step 46 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 11:30:00 - step 47 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 11:45:00 - step 48 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 12:00:00 - step 49 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 12:15:00 - step 50 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 12:30:00 - step 51 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 12:45:00 - step 52 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 13:00:00 - step 53 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 13:15:00 - step 54 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 13:30:00 - step 55 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 13:45:00 - step 56 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 14:00:00 - step 57 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 14:15:00 - step 58 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 14:30:00 - step 59 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 14:45:00 - step 60 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 15:00:00 - step 61 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 15:15:00 - step 62 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 15:30:00 - step 63 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 15:45:00 - step 64 of 192 - 1000 active elements (0 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 16:00:00 - step 65 of 192 - 999 active elements (1 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 16:15:00 - step 66 of 192 - 999 active elements (1 deactivated)
16:13:37 INFO    opendrift.models.basemodel: 2015-11-16 16:30:00 - step 67 of 192 - 999 active elements (1 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 16:45:00 - step 68 of 192 - 999 active elements (1 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 17:00:00 - step 69 of 192 - 996 active elements (4 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 17:15:00 - step 70 of 192 - 996 active elements (4 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 17:30:00 - step 71 of 192 - 996 active elements (4 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 17:45:00 - step 72 of 192 - 992 active elements (8 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 18:00:00 - step 73 of 192 - 990 active elements (10 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 18:15:00 - step 74 of 192 - 985 active elements (15 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 18:30:00 - step 75 of 192 - 980 active elements (20 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 18:45:00 - step 76 of 192 - 975 active elements (25 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 19:00:00 - step 77 of 192 - 970 active elements (30 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 19:15:00 - step 78 of 192 - 966 active elements (34 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 19:30:00 - step 79 of 192 - 959 active elements (41 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 19:45:00 - step 80 of 192 - 947 active elements (53 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 20:00:00 - step 81 of 192 - 936 active elements (64 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 20:15:00 - step 82 of 192 - 923 active elements (77 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 20:30:00 - step 83 of 192 - 914 active elements (86 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 20:45:00 - step 84 of 192 - 906 active elements (94 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 21:00:00 - step 85 of 192 - 902 active elements (98 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 21:15:00 - step 86 of 192 - 891 active elements (109 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 21:30:00 - step 87 of 192 - 885 active elements (115 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 21:45:00 - step 88 of 192 - 869 active elements (131 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 22:00:00 - step 89 of 192 - 864 active elements (136 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 22:15:00 - step 90 of 192 - 854 active elements (146 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 22:30:00 - step 91 of 192 - 840 active elements (160 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 22:45:00 - step 92 of 192 - 830 active elements (170 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 23:00:00 - step 93 of 192 - 822 active elements (178 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 23:15:00 - step 94 of 192 - 802 active elements (198 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 23:30:00 - step 95 of 192 - 795 active elements (205 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-16 23:45:00 - step 96 of 192 - 777 active elements (223 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-17 00:00:00 - step 97 of 192 - 765 active elements (235 deactivated)
16:13:38 INFO    opendrift.models.basemodel: 2015-11-17 00:15:00 - step 98 of 192 - 758 active elements (242 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 00:30:00 - step 99 of 192 - 743 active elements (257 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 00:45:00 - step 100 of 192 - 735 active elements (265 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 01:00:00 - step 101 of 192 - 722 active elements (278 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 01:15:00 - step 102 of 192 - 713 active elements (287 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 01:30:00 - step 103 of 192 - 705 active elements (295 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 01:45:00 - step 104 of 192 - 698 active elements (302 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 02:00:00 - step 105 of 192 - 686 active elements (314 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 02:15:00 - step 106 of 192 - 672 active elements (328 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 02:30:00 - step 107 of 192 - 663 active elements (337 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 02:45:00 - step 108 of 192 - 647 active elements (353 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 03:00:00 - step 109 of 192 - 632 active elements (368 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 03:15:00 - step 110 of 192 - 621 active elements (379 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 03:30:00 - step 111 of 192 - 614 active elements (386 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 03:45:00 - step 112 of 192 - 610 active elements (390 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 04:00:00 - step 113 of 192 - 596 active elements (404 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 04:15:00 - step 114 of 192 - 591 active elements (409 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 04:30:00 - step 115 of 192 - 578 active elements (422 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 04:45:00 - step 116 of 192 - 569 active elements (431 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 05:00:00 - step 117 of 192 - 563 active elements (437 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 05:15:00 - step 118 of 192 - 554 active elements (446 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 05:30:00 - step 119 of 192 - 547 active elements (453 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 05:45:00 - step 120 of 192 - 542 active elements (458 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 06:00:00 - step 121 of 192 - 531 active elements (469 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 06:15:00 - step 122 of 192 - 521 active elements (479 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 06:30:00 - step 123 of 192 - 509 active elements (491 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 06:45:00 - step 124 of 192 - 501 active elements (499 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 07:00:00 - step 125 of 192 - 491 active elements (509 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 07:15:00 - step 126 of 192 - 484 active elements (516 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 07:30:00 - step 127 of 192 - 474 active elements (526 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 07:45:00 - step 128 of 192 - 470 active elements (530 deactivated)
16:13:39 INFO    opendrift.models.basemodel: 2015-11-17 08:00:00 - step 129 of 192 - 462 active elements (538 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 08:15:00 - step 130 of 192 - 454 active elements (546 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 08:30:00 - step 131 of 192 - 453 active elements (547 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 08:45:00 - step 132 of 192 - 446 active elements (554 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 09:00:00 - step 133 of 192 - 439 active elements (561 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 09:15:00 - step 134 of 192 - 430 active elements (570 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 09:30:00 - step 135 of 192 - 427 active elements (573 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 09:45:00 - step 136 of 192 - 420 active elements (580 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 10:00:00 - step 137 of 192 - 414 active elements (586 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 10:15:00 - step 138 of 192 - 406 active elements (594 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 10:30:00 - step 139 of 192 - 400 active elements (600 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 10:45:00 - step 140 of 192 - 395 active elements (605 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 11:00:00 - step 141 of 192 - 390 active elements (610 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 11:15:00 - step 142 of 192 - 388 active elements (612 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 11:30:00 - step 143 of 192 - 385 active elements (615 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 11:45:00 - step 144 of 192 - 381 active elements (619 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 12:00:00 - step 145 of 192 - 378 active elements (622 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 12:15:00 - step 146 of 192 - 374 active elements (626 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 12:30:00 - step 147 of 192 - 370 active elements (630 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 12:45:00 - step 148 of 192 - 367 active elements (633 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 13:00:00 - step 149 of 192 - 359 active elements (641 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 13:15:00 - step 150 of 192 - 354 active elements (646 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 13:30:00 - step 151 of 192 - 345 active elements (655 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 13:45:00 - step 152 of 192 - 342 active elements (658 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 14:00:00 - step 153 of 192 - 338 active elements (662 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 14:15:00 - step 154 of 192 - 334 active elements (666 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 14:30:00 - step 155 of 192 - 329 active elements (671 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 14:45:00 - step 156 of 192 - 326 active elements (674 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 15:00:00 - step 157 of 192 - 323 active elements (677 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 15:15:00 - step 158 of 192 - 318 active elements (682 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 15:30:00 - step 159 of 192 - 312 active elements (688 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 15:45:00 - step 160 of 192 - 306 active elements (694 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 16:00:00 - step 161 of 192 - 303 active elements (697 deactivated)
16:13:40 INFO    opendrift.models.basemodel: 2015-11-17 16:15:00 - step 162 of 192 - 298 active elements (702 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 16:30:00 - step 163 of 192 - 295 active elements (705 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 16:45:00 - step 164 of 192 - 290 active elements (710 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 17:00:00 - step 165 of 192 - 290 active elements (710 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 17:15:00 - step 166 of 192 - 285 active elements (715 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 17:30:00 - step 167 of 192 - 283 active elements (717 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 17:45:00 - step 168 of 192 - 278 active elements (722 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 18:00:00 - step 169 of 192 - 274 active elements (726 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 18:15:00 - step 170 of 192 - 273 active elements (727 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 18:30:00 - step 171 of 192 - 270 active elements (730 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 18:45:00 - step 172 of 192 - 267 active elements (733 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 19:00:00 - step 173 of 192 - 263 active elements (737 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 19:15:00 - step 174 of 192 - 258 active elements (742 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 19:30:00 - step 175 of 192 - 256 active elements (744 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 19:45:00 - step 176 of 192 - 253 active elements (747 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 20:00:00 - step 177 of 192 - 252 active elements (748 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 20:15:00 - step 178 of 192 - 250 active elements (750 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 20:30:00 - step 179 of 192 - 249 active elements (751 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 20:45:00 - step 180 of 192 - 244 active elements (756 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 21:00:00 - step 181 of 192 - 244 active elements (756 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 21:15:00 - step 182 of 192 - 240 active elements (760 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 21:30:00 - step 183 of 192 - 237 active elements (763 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 21:45:00 - step 184 of 192 - 235 active elements (765 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 22:00:00 - step 185 of 192 - 233 active elements (767 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 22:15:00 - step 186 of 192 - 232 active elements (768 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 22:30:00 - step 187 of 192 - 231 active elements (769 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 22:45:00 - step 188 of 192 - 227 active elements (773 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 23:00:00 - step 189 of 192 - 227 active elements (773 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 23:15:00 - step 190 of 192 - 225 active elements (775 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 23:30:00 - step 191 of 192 - 222 active elements (778 deactivated)
16:13:41 INFO    opendrift.models.basemodel: 2015-11-17 23:45:00 - step 192 of 192 - 221 active elements (779 deactivated)

Print and plot results

print(lw)

Out:

===========================
--------------------
Reader performance:
--------------------
/root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc
 0:00:02.4  total
 0:00:00.0  preparing
 0:00:00.3  reading
 0:00:00.1  interpolation
 0:00:00.0  interpolation_time
 0:00:02.0  rotating vectors
 0:00:00.0  masking
--------------------
/root/project/tests/test_data/16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc
 0:00:02.2  total
 0:00:00.0  preparing
 0:00:00.1  reading
 0:00:00.0  interpolation
 0:00:00.0  interpolation_time
 0:00:02.0  rotating vectors
 0:00:00.0  masking
--------------------
global_landmask
 0:00:00.2  total
 0:00:00.0  preparing
 0:00:00.2  reading
 0:00:00.0  masking
--------------------
Performance:
    9.2 total time
    0.2 configuration
    2.7 preparing main loop
      2.7 making dynamical landmask
      0.0 moving elements to ocean
      5.3 readers
        0.3 global_landmask
        0.1 postprocessing
    6.1 main loop
        2.4 /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc
        2.3 /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc
      0.2 updating elements
    0.0 cleaning up
--------------------
===========================
Model:  Leeway     (OpenDrift version 1.7.1)
        215 active LeewayObj particles  (785 deactivated, 0 scheduled)
-------------------
Environment variables:
  -----
  x_sea_water_velocity
  y_sea_water_velocity
     1) /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc
  -----
  x_wind
  y_wind
     1) /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/arome_subset_16Nov2015.nc
  -----
  land_binary_mask
     1) global_landmask

Time:
        Start: 2015-11-16 00:00:00
        Present: 2015-11-18 00:00:00
        Calculation steps: 192 * 0:15:00 - total time: 2 days, 0:00:00
        Output steps: 49 * 1:00:00
===========================

Animation with current as background. Note that drift is also depending on wind, which is not shown.

lw.animation(background=['x_sea_water_velocity', 'y_sea_water_velocity'],
             cmap=cmocean.cm.speed, vmin=0, vmax=.8, bgalpha=.7, land_color='#666666', fast=True)

Out:

16:13:41 WARNING opendrift.models.basemodel: Plotting fast. This will make your plots less accurate.
16:13:44 INFO    opendrift.models.basemodel: Saving animation to /root/project/docs/source/gallery/animations/example_leeway_0.gif...
16:13:44 INFO    opendrift.models.basemodel: Making animated gif...
MovieWriter imagemagick unavailable; using Pillow instead.
../_images/example_leeway_0.gif
lw.plot(fast=True)
OpenDrift - Leeway (LIFE-RAFT-NB-1) 2015-11-16 00:00 to 2015-11-18 00:00 UTC (49 steps)

Out:

16:14:05 WARNING opendrift.models.basemodel: Plotting fast. This will make your plots less accurate.

(<GeoAxesSubplot:title={'center':'OpenDrift - Leeway (LIFE-RAFT-NB-1)\n2015-11-16 00:00 to 2015-11-18 00:00 UTC (49 steps)'}>, <module 'matplotlib.pyplot' from '/opt/conda/envs/opendrift/lib/python3.9/site-packages/matplotlib/pyplot.py'>)

Total running time of the script: ( 0 minutes 37.042 seconds)

Gallery generated by Sphinx-Gallery