Model landmask

Comparing two simulation runs, with landmask from ocean model and GSHHG

from datetime import timedelta

from opendrift.readers import reader_ROMS_native
from opendrift.models.oceandrift import OceanDrift

lon = 14.75; lat = 68.1

o = OceanDrift(loglevel=20)

reader_nordic = reader_ROMS_native.Reader(o.test_data_folder() +
    '2Feb2016_Nordic_sigma_3d/Nordic-4km_SLEVELS_avg_00_subset2Feb2016.nc')

Out:

13:44:30 INFO    opendrift.models.basemodel: OpenDriftSimulation initialised (version 1.7.1 / v1.7.1-87-g074c1d2)
13:44:30 INFO    opendrift.readers.reader_ROMS_native: Opening dataset: /root/project/tests/test_data/2Feb2016_Nordic_sigma_3d/Nordic-4km_SLEVELS_avg_00_subset2Feb2016.nc
13:44:30 INFO    opendrift.readers.reader_ROMS_native: Opening file with Dataset
13:44:30 INFO    opendrift.readers.reader_ROMS_native: Read GLS parameters from file.
13:44:30 WARNING opendrift.readers.basereader.structured: No proj string or projection could be derived, using 'fakeproj'. This assumes that the variables are structured and gridded approximately equidistantly on the surface (i.e. in meters). This must be guaranteed by the user. You can get rid of this warning by suppling a valid projection to the reader.
13:44:30 INFO    opendrift.readers.basereader.structured: Making interpolator for lon,lat to x,y conversion...

First run, with default GSHHG vector landmask

o.add_reader([reader_nordic])
time = reader_nordic.start_time
o.seed_elements(lon, lat, radius=3000, number=1000, time=time)
o.set_config('general:use_auto_landmask', True)
o.run(end_time=reader_nordic.end_time, time_step=1800, time_step_output=3*3600)

Out:

13:44:31 INFO    opendrift.models.basemodel: Fallback values will be used for the following variables which have no readers:
13:44:31 INFO    opendrift.models.basemodel:    x_wind: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    y_wind: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    upward_sea_water_velocity: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    ocean_vertical_diffusivity: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    sea_surface_wave_significant_height: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_x_velocity: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_y_velocity: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    surface_downward_x_stress: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    surface_downward_y_stress: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    turbulent_kinetic_energy: 0.000000
13:44:31 INFO    opendrift.models.basemodel:    turbulent_generic_length_scale: 0.000000
13:44:31 INFO    opendrift.models.basemodel: Adding a dynamical landmask with max. priority based on assumed maximum speed of 1 m/s. Adding a customised landmask may be faster...
13:44:31 INFO    opendrift_landmask_data.mask: locking landmask for generation..
13:44:31 INFO    opendrift_landmask_data.mask: decompressing memmap landmask to /tmp/landmask/mask.dat..
13:44:49 INFO    opendrift_landmask_data.mask: landmask generated
13:44:53 INFO    opendrift.models.basemodel: Using existing reader for land_binary_mask
13:44:53 INFO    opendrift.models.basemodel: Moving 3 out of 1000 points from land to water
13:44:53 INFO    opendrift.models.basemodel: 2016-02-02 12:00:00 - step 1 of 96 - 1000 active elements (0 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 12:30:00 - step 2 of 96 - 1000 active elements (0 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 13:00:00 - step 3 of 96 - 996 active elements (4 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 13:30:00 - step 4 of 96 - 995 active elements (5 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 14:00:00 - step 5 of 96 - 995 active elements (5 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 14:30:00 - step 6 of 96 - 994 active elements (6 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 15:00:00 - step 7 of 96 - 994 active elements (6 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 15:30:00 - step 8 of 96 - 993 active elements (7 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 16:00:00 - step 9 of 96 - 992 active elements (8 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 16:30:00 - step 10 of 96 - 992 active elements (8 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 17:00:00 - step 11 of 96 - 992 active elements (8 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 17:30:00 - step 12 of 96 - 989 active elements (11 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 18:00:00 - step 13 of 96 - 988 active elements (12 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 18:30:00 - step 14 of 96 - 988 active elements (12 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 19:00:00 - step 15 of 96 - 988 active elements (12 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 19:30:00 - step 16 of 96 - 987 active elements (13 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 20:00:00 - step 17 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 20:30:00 - step 18 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 21:00:00 - step 19 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 21:30:00 - step 20 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 22:00:00 - step 21 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 22:30:00 - step 22 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 23:00:00 - step 23 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-02 23:30:00 - step 24 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 00:00:00 - step 25 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 00:30:00 - step 26 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 01:00:00 - step 27 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 01:30:00 - step 28 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 02:00:00 - step 29 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 02:30:00 - step 30 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 03:00:00 - step 31 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 03:30:00 - step 32 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 04:00:00 - step 33 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 04:30:00 - step 34 of 96 - 986 active elements (14 deactivated)
13:44:54 INFO    opendrift.models.basemodel: 2016-02-03 05:00:00 - step 35 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 05:30:00 - step 36 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 06:00:00 - step 37 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 06:30:00 - step 38 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 07:00:00 - step 39 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 07:30:00 - step 40 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 08:00:00 - step 41 of 96 - 986 active elements (14 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 08:30:00 - step 42 of 96 - 985 active elements (15 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 09:00:00 - step 43 of 96 - 985 active elements (15 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 09:30:00 - step 44 of 96 - 984 active elements (16 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 10:00:00 - step 45 of 96 - 984 active elements (16 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 10:30:00 - step 46 of 96 - 982 active elements (18 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 11:00:00 - step 47 of 96 - 982 active elements (18 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 11:30:00 - step 48 of 96 - 980 active elements (20 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 12:00:00 - step 49 of 96 - 979 active elements (21 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 12:30:00 - step 50 of 96 - 977 active elements (23 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 13:00:00 - step 51 of 96 - 976 active elements (24 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 13:30:00 - step 52 of 96 - 975 active elements (25 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 14:00:00 - step 53 of 96 - 975 active elements (25 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 14:30:00 - step 54 of 96 - 975 active elements (25 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 15:00:00 - step 55 of 96 - 974 active elements (26 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 15:30:00 - step 56 of 96 - 971 active elements (29 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 16:00:00 - step 57 of 96 - 969 active elements (31 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 16:30:00 - step 58 of 96 - 964 active elements (36 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 17:00:00 - step 59 of 96 - 958 active elements (42 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 17:30:00 - step 60 of 96 - 956 active elements (44 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 18:00:00 - step 61 of 96 - 953 active elements (47 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 18:30:00 - step 62 of 96 - 945 active elements (55 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 19:00:00 - step 63 of 96 - 942 active elements (58 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 19:30:00 - step 64 of 96 - 939 active elements (61 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 20:00:00 - step 65 of 96 - 935 active elements (65 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 20:30:00 - step 66 of 96 - 931 active elements (69 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 21:00:00 - step 67 of 96 - 930 active elements (70 deactivated)
13:44:55 INFO    opendrift.models.basemodel: 2016-02-03 21:30:00 - step 68 of 96 - 928 active elements (72 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-03 22:00:00 - step 69 of 96 - 924 active elements (76 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-03 22:30:00 - step 70 of 96 - 918 active elements (82 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-03 23:00:00 - step 71 of 96 - 913 active elements (87 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-03 23:30:00 - step 72 of 96 - 908 active elements (92 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 00:00:00 - step 73 of 96 - 899 active elements (101 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 00:30:00 - step 74 of 96 - 890 active elements (110 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 01:00:00 - step 75 of 96 - 882 active elements (118 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 01:30:00 - step 76 of 96 - 877 active elements (123 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 02:00:00 - step 77 of 96 - 870 active elements (130 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 02:30:00 - step 78 of 96 - 863 active elements (137 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 03:00:00 - step 79 of 96 - 859 active elements (141 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 03:30:00 - step 80 of 96 - 847 active elements (153 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 04:00:00 - step 81 of 96 - 845 active elements (155 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 04:30:00 - step 82 of 96 - 840 active elements (160 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 05:00:00 - step 83 of 96 - 833 active elements (167 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 05:30:00 - step 84 of 96 - 823 active elements (177 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 06:00:00 - step 85 of 96 - 810 active elements (190 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 06:30:00 - step 86 of 96 - 799 active elements (201 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 07:00:00 - step 87 of 96 - 789 active elements (211 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 07:30:00 - step 88 of 96 - 777 active elements (223 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 08:00:00 - step 89 of 96 - 772 active elements (228 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 08:30:00 - step 90 of 96 - 757 active elements (243 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 09:00:00 - step 91 of 96 - 751 active elements (249 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 09:30:00 - step 92 of 96 - 747 active elements (253 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 10:00:00 - step 93 of 96 - 740 active elements (260 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 10:30:00 - step 94 of 96 - 738 active elements (262 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 11:00:00 - step 95 of 96 - 731 active elements (269 deactivated)
13:44:56 INFO    opendrift.models.basemodel: 2016-02-04 11:30:00 - step 96 of 96 - 723 active elements (277 deactivated)

Second run, with landmask from ocean model

o2 = OceanDrift(loglevel=20)
o2.add_reader([reader_nordic])
lon = 14.75; lat = 68.1
o2.seed_elements(lon, lat, radius=3000, number=1000, time=time)
o2.set_config('general:use_auto_landmask', False)
o2.run(end_time=reader_nordic.end_time, time_step=1800, time_step_output=3*3600)

Out:

13:44:57 INFO    opendrift.models.basemodel: OpenDriftSimulation initialised (version 1.7.1 / v1.7.1-87-g074c1d2)
13:44:57 INFO    opendrift.models.basemodel: Fallback values will be used for the following variables which have no readers:
13:44:57 INFO    opendrift.models.basemodel:    x_wind: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    y_wind: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    upward_sea_water_velocity: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    ocean_vertical_diffusivity: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    sea_surface_wave_significant_height: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_x_velocity: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_y_velocity: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    surface_downward_x_stress: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    surface_downward_y_stress: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    turbulent_kinetic_energy: 0.000000
13:44:57 INFO    opendrift.models.basemodel:    turbulent_generic_length_scale: 0.000000
13:44:57 INFO    opendrift.models.basemodel: Using existing reader for land_binary_mask
13:44:57 INFO    opendrift.models.basemodel: All points are in ocean
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 12:00:00 - step 1 of 96 - 1000 active elements (0 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 12:30:00 - step 2 of 96 - 1000 active elements (0 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 13:00:00 - step 3 of 96 - 1000 active elements (0 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 13:30:00 - step 4 of 96 - 999 active elements (1 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 14:00:00 - step 5 of 96 - 998 active elements (2 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 14:30:00 - step 6 of 96 - 997 active elements (3 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 15:00:00 - step 7 of 96 - 996 active elements (4 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 15:30:00 - step 8 of 96 - 992 active elements (8 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 16:00:00 - step 9 of 96 - 990 active elements (10 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 16:30:00 - step 10 of 96 - 985 active elements (15 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 17:00:00 - step 11 of 96 - 984 active elements (16 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 17:30:00 - step 12 of 96 - 979 active elements (21 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 18:00:00 - step 13 of 96 - 973 active elements (27 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 18:30:00 - step 14 of 96 - 968 active elements (32 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 19:00:00 - step 15 of 96 - 961 active elements (39 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 19:30:00 - step 16 of 96 - 953 active elements (47 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 20:00:00 - step 17 of 96 - 946 active elements (54 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 20:30:00 - step 18 of 96 - 941 active elements (59 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 21:00:00 - step 19 of 96 - 934 active elements (66 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 21:30:00 - step 20 of 96 - 929 active elements (71 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 22:00:00 - step 21 of 96 - 922 active elements (78 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 22:30:00 - step 22 of 96 - 908 active elements (92 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 23:00:00 - step 23 of 96 - 898 active elements (102 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-02 23:30:00 - step 24 of 96 - 889 active elements (111 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 00:00:00 - step 25 of 96 - 878 active elements (122 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 00:30:00 - step 26 of 96 - 862 active elements (138 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 01:00:00 - step 27 of 96 - 850 active elements (150 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 01:30:00 - step 28 of 96 - 844 active elements (156 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 02:00:00 - step 29 of 96 - 832 active elements (168 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 02:30:00 - step 30 of 96 - 821 active elements (179 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 03:00:00 - step 31 of 96 - 805 active elements (195 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 03:30:00 - step 32 of 96 - 798 active elements (202 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 04:00:00 - step 33 of 96 - 789 active elements (211 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 04:30:00 - step 34 of 96 - 782 active elements (218 deactivated)
13:44:57 INFO    opendrift.models.basemodel: 2016-02-03 05:00:00 - step 35 of 96 - 769 active elements (231 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 05:30:00 - step 36 of 96 - 758 active elements (242 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 06:00:00 - step 37 of 96 - 752 active elements (248 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 06:30:00 - step 38 of 96 - 742 active elements (258 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 07:00:00 - step 39 of 96 - 736 active elements (264 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 07:30:00 - step 40 of 96 - 733 active elements (267 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 08:00:00 - step 41 of 96 - 729 active elements (271 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 08:30:00 - step 42 of 96 - 724 active elements (276 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 09:00:00 - step 43 of 96 - 713 active elements (287 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 09:30:00 - step 44 of 96 - 708 active elements (292 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 10:00:00 - step 45 of 96 - 697 active elements (303 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 10:30:00 - step 46 of 96 - 690 active elements (310 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 11:00:00 - step 47 of 96 - 680 active elements (320 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 11:30:00 - step 48 of 96 - 675 active elements (325 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 12:00:00 - step 49 of 96 - 669 active elements (331 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 12:30:00 - step 50 of 96 - 665 active elements (335 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 13:00:00 - step 51 of 96 - 655 active elements (345 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 13:30:00 - step 52 of 96 - 647 active elements (353 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 14:00:00 - step 53 of 96 - 646 active elements (354 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 14:30:00 - step 54 of 96 - 640 active elements (360 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 15:00:00 - step 55 of 96 - 635 active elements (365 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 15:30:00 - step 56 of 96 - 633 active elements (367 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 16:00:00 - step 57 of 96 - 630 active elements (370 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 16:30:00 - step 58 of 96 - 629 active elements (371 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 17:00:00 - step 59 of 96 - 627 active elements (373 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 17:30:00 - step 60 of 96 - 623 active elements (377 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 18:00:00 - step 61 of 96 - 622 active elements (378 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 18:30:00 - step 62 of 96 - 621 active elements (379 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 19:00:00 - step 63 of 96 - 619 active elements (381 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 19:30:00 - step 64 of 96 - 616 active elements (384 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 20:00:00 - step 65 of 96 - 616 active elements (384 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 20:30:00 - step 66 of 96 - 613 active elements (387 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 21:00:00 - step 67 of 96 - 612 active elements (388 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 21:30:00 - step 68 of 96 - 610 active elements (390 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 22:00:00 - step 69 of 96 - 606 active elements (394 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 22:30:00 - step 70 of 96 - 606 active elements (394 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 23:00:00 - step 71 of 96 - 606 active elements (394 deactivated)
13:44:58 INFO    opendrift.models.basemodel: 2016-02-03 23:30:00 - step 72 of 96 - 606 active elements (394 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 00:00:00 - step 73 of 96 - 606 active elements (394 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 00:30:00 - step 74 of 96 - 606 active elements (394 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 01:00:00 - step 75 of 96 - 603 active elements (397 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 01:30:00 - step 76 of 96 - 603 active elements (397 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 02:00:00 - step 77 of 96 - 602 active elements (398 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 02:30:00 - step 78 of 96 - 601 active elements (399 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 03:00:00 - step 79 of 96 - 601 active elements (399 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 03:30:00 - step 80 of 96 - 600 active elements (400 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 04:00:00 - step 81 of 96 - 599 active elements (401 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 04:30:00 - step 82 of 96 - 599 active elements (401 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 05:00:00 - step 83 of 96 - 598 active elements (402 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 05:30:00 - step 84 of 96 - 598 active elements (402 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 06:00:00 - step 85 of 96 - 597 active elements (403 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 06:30:00 - step 86 of 96 - 596 active elements (404 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 07:00:00 - step 87 of 96 - 596 active elements (404 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 07:30:00 - step 88 of 96 - 595 active elements (405 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 08:00:00 - step 89 of 96 - 595 active elements (405 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 08:30:00 - step 90 of 96 - 595 active elements (405 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 09:00:00 - step 91 of 96 - 595 active elements (405 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 09:30:00 - step 92 of 96 - 595 active elements (405 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 10:00:00 - step 93 of 96 - 595 active elements (405 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 10:30:00 - step 94 of 96 - 594 active elements (406 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 11:00:00 - step 95 of 96 - 593 active elements (407 deactivated)
13:44:59 INFO    opendrift.models.basemodel: 2016-02-04 11:30:00 - step 96 of 96 - 593 active elements (407 deactivated)
from matplotlib.colors import ListedColormap
import cartopy.feature as cfeature
#cmap = ListedColormap(('blue', 'red'))
cmap = ListedColormap((cfeature.COLORS['water'],
                       cfeature.COLORS['land']))

To only show the landmask from the model, hide the coastline landmask by doing:

o2.plot(background='land_binary_mask', hide_landmask=True, cmap=cmap)
OpenDrift - OceanDrift 2016-02-02 12:00 to 2016-02-04 12:00 UTC (17 steps)

Out:

(<GeoAxesSubplot:title={'center':'OpenDrift - OceanDrift\n2016-02-02 12:00 to 2016-02-04 12:00 UTC (17 steps)'}>, <module 'matplotlib.pyplot' from '/opt/conda/envs/opendrift/lib/python3.9/site-packages/matplotlib/pyplot.py'>)

Animation illustrating that red particles strand at ocean model land cells, and black particles strand at GSHHG land polygons

o.animation(compare=o2, background='land_binary_mask', cmap=cmap,
            legend=['Default GSHHG landmask', 'Ocean model landmask'])

Out:

13:45:33 INFO    opendrift.models.basemodel: Saving animation to /root/project/docs/source/gallery/animations/example_model_landmask_0.gif...
13:45:33 INFO    opendrift.models.basemodel: Making animated gif...
MovieWriter imagemagick unavailable; using Pillow instead.
../_images/example_model_landmask_0.gif
o.plot(compare=o2, background='land_binary_mask', cmap=cmap,
       legend=['Default GSHHG landmask', 'Ocean model landmask'])
OpenDrift - OceanDrift 2016-02-02 12:00 to 2016-02-04 12:00 UTC (17 steps)

Out:

(<GeoAxesSubplot:title={'center':'OpenDrift - OceanDrift\n2016-02-02 12:00 to 2016-02-04 12:00 UTC (17 steps)'}>, <module 'matplotlib.pyplot' from '/opt/conda/envs/opendrift/lib/python3.9/site-packages/matplotlib/pyplot.py'>)

Total running time of the script: ( 1 minutes 52.099 seconds)

Gallery generated by Sphinx-Gallery