Detailed Built-In Plots Demonstration¶
PTM allows access to OpenDrift’s built-in plotting capabilities with the use of an input dictionary. You can browse the types of plots from OpenDrift in their gallery; this page demonstrates how to access a variety of those plots through PTM.
The available plot types are:
spaghetti
property
oil
animation
animation profile
To create a type of plot, the listed words must be in the plot dictionary key and it will work by word-matching. Each plot key must also be distinct. A basic version of each available plot (except “property”, which requires an input property to plot) will be plotted for “all”, including depth and mean depth property plots. Some examples will be demonstrated here, as well as how to get the plot whether using PTM as a Python package or through the CLI.
Examples will be shown with code run at the bottom of this page. First we show options.
To make two or more plots or animations of the same type for the same simulation, input multiple plot dictionaries. Just be sure that each plot key is distinct.
A plot or animation option that uses a nondefault variable must also have access to that variable in the output file, which you accomplish by requesting it as an export_variable. By default, all possible variables are exported, but if you input a preferred list of variables to export, be sure it includes any you want to plot.
If you hit an exception due to missing the reader, you probably need to run your requested plot or animation at the same time as the simulation in order to have access to the variable requested.
Spaghetti¶
Basic plot¶
This example plots the particle tracks. Input:
plots={'spaghetti': {}}
To run this with the CLI, the plots section would be
plots="{'spaghetti': {}}"
Options¶
You can choose the filetype by including "filetype": "jpg" or other filetypes that matplotlib can handle in the “spaghetti” plot dictionary. The default is png.
You can also color the lines with a parameter from the simulations, for example, “z” to plot the depth. You can plot any variables that are in the export variables. Get more information about export variables in Export Variables. This is input as "linecolor": "z" and you can add a colormap if you want with “cmap”.
You can control other parameters for the plot too, see OpenDrift options here.
Multiple plots¶
To make two or more spaghetti plots for the same simulation, input multiple plot dictionaries. Just be sure that each plot key includes the word “spaghetti” and isn’t the same as any other plot key value.
Input:
import cmocean.cm as cmo
...
..., plots={'spaghetti': {},
'spaghetti2': {'linecolor': 'z', 'cmap': 'cmo.deep'}}, ...
For CLI use
plots="{'spaghetti': {}, 'spaghetti2': {'linecolor': 'z', 'cmap': 'cmo.deep'}}"
Animation¶
Basic¶
You can run a basic particle animation with
plots={'animation': {}}
To run this with the CLI, the plots section would be
plots="{'animation': {}}"
Options¶
You can choose the filetype with "filetype": "mp4" in the input plot dictionary. The default is “mp4”.
You can change the background of the animation and colormap, along with the frames per second, such as, 'animation': {'background': 'sea_surface_height', 'filetype': '.mp4', 'fps': 2, 'cmap': 'cmo.deep_r'.
Other variables to use for background include
sea_floor_depth_below_sea_level
land_binary_mask
zeta
sea_surface_height
Other options for animations include:
bgalpha=1
markersize=’mass_oil’
markersize_scaling=80
Other options available from OpenDrift are found here.
Oil Budget¶
Basic¶
You can make a basic oil budget plot with
plots={'oil': {}}
To run this with the CLI, the plots section would be
plots="{'oil': {}}"
Options¶
Options are:
show_wind_and_current=Trueshow_watercontent_and_viscosity=True
Animation Profile¶
This shows an animation from the side, with depth on the y-axis.
Basic¶
You can make a profile animation with
plots={'animation_profile': {}}
To run this with the CLI, the plots section would be
plots="{'animation_profile': {}}"
Options¶
Useful options include:
markersize='mass_oil'markersize_scaling=80color='z'alpha=.5
Property Plot¶
This plots a single property over time, either for every track or the average over all the tracks.
Basic¶
You can make a property plot with the following — you must input a “prop” to plot!
plots={'property': {'variable': 'z'}}
To run this with the CLI, the plots section would be
plots="{'property': {'variable': 'z'}}"
Options¶
'mean': True
Demonstration¶
You can mix and match the plot and animation options above.
Demo for “all” option¶
import particle_tracking_manager as ptm
import xroms
import xarray as xr
import cmocean.cm as cmo
import pandas as pd
m = ptm.OpenDriftModel(lon=-90, lat=28.7, number=10, duration="3h",
do3D=True, use_static_masks=True,
ocean_model="TXLA",
ocean_model_local=False,
start_time="2009-11-19T12:00",
plots={'all': {},})
m.run_all()
/home/docs/checkouts/readthedocs.org/user_builds/particle-tracking-manager/conda/latest/lib/python3.13/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
2026-04-09 19:48:47 INFO root.config_logging.setup_logger:54: Particle tracking manager simulation.
2026-04-09 19:48:47 INFO root.config_logging.setup_logger:55: Log filename: output-results_2026-04-09T194847Z.log
2026-04-09 19:48:47 INFO root.config_the_manager.timedir:348: Running model forward in time.
2026-04-09 19:48:47 INFO root.config_the_manager.timedir:348: Running model forward in time.
Downloading file 'ROMS_example_full_grid.nc' from 'https://github.com/xoceanmodel/xroms/raw/main/xroms/data/ROMS_example_full_grid.nc' to '/home/docs/.cache/xroms'.
2026-04-09 19:48:49 INFO root.config_ocean_model.register_on_the_fly:230: Registered new ocean model or altered existing ocean model in the registry.
19:48:52 INFO opendrift:568: OpenDriftSimulation initialised (version 1.14.9)
2026-04-09 19:48:52 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:187: Vstretching not found, using 1
2026-04-09 19:48:52 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:187: Vstretching not found, using 1
19:48:52 WARNING opendrift.readers.reader_ROMS_native:187: Vstretching not found, using 1
2026-04-09 19:48:52 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
2026-04-09 19:48:52 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
19:48:52 WARNING opendrift.readers.reader_ROMS_native:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
19:48:52 INFO opendrift.readers.reader_ROMS_native:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
2026-04-09 19:48:52 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:48:52 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:48:52 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
19:48:52 WARNING opendrift.readers.basereader.structured:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:48:52 INFO opendrift.readers.basereader.structured.structured.__init__:88: Making interpolator for lon,lat to x,y conversion...
2026-04-09 19:48:52 INFO opendrift.readers.basereader.structured.structured.__init__:88: Making interpolator for lon,lat to x,y conversion...
2026-04-09 19:48:52 INFO opendrift.readers.basereader.structured.structured.__init__:88: Making interpolator for lon,lat to x,y conversion...
19:48:52 INFO opendrift.readers.basereader.structured:88: Making interpolator for lon,lat to x,y conversion...
2026-04-09 19:48:52 INFO opendrift.readers.basereader.structured.structured.__init__:106: Saving interpolator for lon,lat to x,y conversion.
2026-04-09 19:48:52 INFO opendrift.readers.basereader.structured.structured.__init__:106: Saving interpolator for lon,lat to x,y conversion.
2026-04-09 19:48:52 INFO opendrift.readers.basereader.structured.structured.__init__:106: Saving interpolator for lon,lat to x,y conversion.
19:48:52 INFO opendrift.readers.basereader.structured:106: Saving interpolator for lon,lat to x,y conversion.
19:48:52 INFO root:296: Using seed_flag "elements".
19:48:52 INFO root:296: Using seed_flag "elements".
19:48:52 INFO root:296: Using seed_flag "elements".
19:48:52 INFO opendrift.models.basemodel.environment:227: Fallback values will be used for the following variables which have no readers:
19:48:52 INFO opendrift.models.basemodel.environment:230: x_wind: 0.000000
19:48:52 INFO opendrift.models.basemodel.environment:230: y_wind: 0.000000
19:48:52 INFO opendrift.models.basemodel.environment:230: upward_sea_water_velocity: 0.000000
19:48:52 INFO opendrift.models.basemodel.environment:230: ocean_vertical_diffusivity: 0.000000
19:48:52 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_significant_height: 0.000000
19:48:52 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
19:48:52 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
19:48:52 INFO root:168: start_time: 2009-11-19 12:00:00, end_time: 2009-11-19 15:00:00, steps: 36, duration: 3h
19:48:52 INFO root:296: Using seed_flag "elements".
19:48:52 INFO root:348: Running model forward in time.
19:48:52 INFO opendrift:1905: Storing previous values of element property lon because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
19:48:52 INFO opendrift:1905: Storing previous values of element property lat because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
19:48:52 INFO opendrift:1913: Storing previous values of environment variable sea_surface_height because of condition ['drift:vertical_advection', 'is', True]
19:48:52 INFO opendrift:947: Using existing reader for land_binary_mask to move elements to ocean
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_rho:367: Using mask_rho for mask_rho
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_rho:367: Using mask_rho for mask_rho
19:48:52 INFO opendrift.readers.reader_ROMS_native:367: Using mask_rho for mask_rho
19:48:52 INFO opendrift:978: All points are in ocean
19:48:52 INFO opendrift:2202: 2009-11-19 12:00:00 - step 1 of 36 - 10 active elements (0 deactivated)
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_u:388: Using mask_u for mask_u
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_u:388: Using mask_u for mask_u
19:48:52 INFO opendrift.readers.reader_ROMS_native:388: Using mask_u for mask_u
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_v:409: Using mask_v for mask_v
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_v:409: Using mask_v for mask_v
19:48:52 INFO opendrift.readers.reader_ROMS_native:409: Using mask_v for mask_v
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.angle:432: Using angle from Dataset.
2026-04-09 19:48:52 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.angle:432: Using angle from Dataset.
19:48:52 INFO opendrift.readers.reader_ROMS_native:432: Using angle from Dataset.
19:48:53 INFO opendrift:2202: 2009-11-19 12:05:00 - step 2 of 36 - 10 active elements (0 deactivated)
2026-04-09 19:48:53 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.zeta:418: Using zeta for sea surface height
2026-04-09 19:48:53 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.zeta:418: Using zeta for sea surface height
19:48:53 INFO opendrift.readers.reader_ROMS_native:418: Using zeta for sea surface height
2026-04-09 19:48:53 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.get_variables:639: Time: 0:00:00.169127
2026-04-09 19:48:53 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.get_variables:639: Time: 0:00:00.169127
19:48:53 INFO opendrift.readers.reader_ROMS_native:639: Time: 0:00:00.169127
19:48:53 INFO opendrift:2202: 2009-11-19 12:10:00 - step 3 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:15:00 - step 4 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:20:00 - step 5 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:25:00 - step 6 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:30:00 - step 7 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:35:00 - step 8 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:40:00 - step 9 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:45:00 - step 10 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:50:00 - step 11 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 12:55:00 - step 12 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:00:00 - step 13 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:05:00 - step 14 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:10:00 - step 15 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:15:00 - step 16 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:20:00 - step 17 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:25:00 - step 18 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:30:00 - step 19 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:35:00 - step 20 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:40:00 - step 21 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:45:00 - step 22 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:50:00 - step 23 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 13:55:00 - step 24 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:00:00 - step 25 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:05:00 - step 26 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:10:00 - step 27 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:15:00 - step 28 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:20:00 - step 29 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:25:00 - step 30 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:30:00 - step 31 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:35:00 - step 32 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:40:00 - step 33 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:45:00 - step 34 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:50:00 - step 35 of 36 - 10 active elements (0 deactivated)
19:48:53 INFO opendrift:2202: 2009-11-19 14:55:00 - step 36 of 36 - 10 active elements (0 deactivated)
19:48:53 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:48:57 INFO opendrift:3899: Time to make plot: 0:00:03.852370
19:48:57 INFO opendrift:247: Saved plot to output-results_2026-04-09T194847Z_spaghetti_fast_True.png
19:48:57 INFO opendrift:247: Saved plot to output-results_2026-04-09T194847Z_property_variable_z.png
19:48:57 INFO opendrift:247: Saved plot to output-results_2026-04-09T194847Z_property_variable_z_mean_True.png
19:48:57 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:48:58 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194847Z_fast_True_fps_4_background_land_binary_mask_cmap_cmo.deep_hide_landmask_True.mp4...
19:48:59 INFO opendrift:3191: Time to make animation: 0:00:01.708666
19:48:59 INFO opendrift:247: Saved plot to output-results_2026-04-09T194847Z_fast_True_fps_4_background_land_binary_mask_cmap_cmo.deep_hide_landmask_True.mp4
19:48:59 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194847Z_profile_fps_4.mp4...
19:48:59 INFO opendrift:3407: Time to make animation: 0:00:00.247677
19:48:59 INFO opendrift:247: Saved plot to output-results_2026-04-09T194847Z_profile_fps_4.mp4
Demo with larval fish scenario¶
This example plots particle tracks and additionally plots tracks colored by a variable, and runs the plot after the simulation has been run.
m = ptm.OpenDriftModel(drift_model="LarvalFish", lon=-90, lat=28.7, number=10, duration="3h",
z=None,
do3D=True, use_static_masks=True,
ocean_model="TXLA",
ocean_model_local=False,
start_time="2009-11-19T12:00",
hatched=1,
seed_seafloor=True,)
m.run_all()
2026-04-09 19:49:00 INFO root.config_logging.setup_logger:54: Particle tracking manager simulation.
2026-04-09 19:49:00 INFO root.config_logging.setup_logger:55: Log filename: output-results_2026-04-09T194900Z.log
2026-04-09 19:49:00 INFO root.config_the_manager.timedir:348: Running model forward in time.
2026-04-09 19:49:00 INFO root.config_the_manager.timedir:348: Running model forward in time.
2026-04-09 19:49:00 INFO root.config_ocean_model.register_on_the_fly:230: Registered new ocean model or altered existing ocean model in the registry.
19:49:00 INFO opendrift:568: OpenDriftSimulation initialised (version 1.14.9)
2026-04-09 19:49:00 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:187: Vstretching not found, using 1
2026-04-09 19:49:00 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:187: Vstretching not found, using 1
19:49:00 WARNING opendrift.readers.reader_ROMS_native:187: Vstretching not found, using 1
2026-04-09 19:49:00 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
2026-04-09 19:49:00 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
19:49:00 WARNING opendrift.readers.reader_ROMS_native:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
19:49:00 INFO opendrift.readers.reader_ROMS_native:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
2026-04-09 19:49:00 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:49:00 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:49:00 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
19:49:00 WARNING opendrift.readers.basereader.structured:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:49:00 INFO opendrift.readers.basereader.structured.structured.__init__:81: Loading previously saved interpolator for lon,lat to x,y conversion.
2026-04-09 19:49:00 INFO opendrift.readers.basereader.structured.structured.__init__:81: Loading previously saved interpolator for lon,lat to x,y conversion.
2026-04-09 19:49:00 INFO opendrift.readers.basereader.structured.structured.__init__:81: Loading previously saved interpolator for lon,lat to x,y conversion.
19:49:00 INFO opendrift.readers.basereader.structured:81: Loading previously saved interpolator for lon,lat to x,y conversion.
19:49:00 INFO root:296: Using seed_flag "elements".
19:49:00 INFO root:296: Using seed_flag "elements".
19:49:00 INFO root:296: Using seed_flag "elements".
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:227: Fallback values will be used for the following variables which have no readers:
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:227: Fallback values will be used for the following variables which have no readers:
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:227: Fallback values will be used for the following variables which have no readers:
19:49:00 INFO opendrift.models.basemodel.environment:227: Fallback values will be used for the following variables which have no readers:
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_significant_height: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_significant_height: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_significant_height: 0.000000
19:49:00 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_significant_height: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: x_wind: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: x_wind: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: x_wind: 0.000000
19:49:00 INFO opendrift.models.basemodel.environment:230: x_wind: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: y_wind: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: y_wind: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: y_wind: 0.000000
19:49:00 INFO opendrift.models.basemodel.environment:230: y_wind: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: ocean_vertical_diffusivity: 0.010000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: ocean_vertical_diffusivity: 0.010000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: ocean_vertical_diffusivity: 0.010000
19:49:00 INFO opendrift.models.basemodel.environment:230: ocean_vertical_diffusivity: 0.010000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
19:49:00 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
2026-04-09 19:49:00 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
19:49:00 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
2026-04-09 19:49:00 WARNING opendrift.models.basemodel.environment.environment.discard_reader_if_not_relevant:441: Simulation has no simulation_extent, cannot check reader coverage
2026-04-09 19:49:00 WARNING opendrift.models.basemodel.environment.environment.discard_reader_if_not_relevant:441: Simulation has no simulation_extent, cannot check reader coverage
2026-04-09 19:49:00 WARNING opendrift.models.basemodel.environment.environment.discard_reader_if_not_relevant:441: Simulation has no simulation_extent, cannot check reader coverage
19:49:00 WARNING opendrift.models.basemodel.environment:441: Simulation has no simulation_extent, cannot check reader coverage
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_rho:367: Using mask_rho for mask_rho
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_rho:367: Using mask_rho for mask_rho
19:49:00 INFO opendrift.readers.reader_ROMS_native:367: Using mask_rho for mask_rho
19:49:00 INFO root:168: start_time: 2009-11-19 12:00:00, end_time: 2009-11-19 15:00:00, steps: 36, duration: 3h
19:49:00 INFO root:296: Using seed_flag "elements".
19:49:00 INFO root:348: Running model forward in time.
19:49:00 INFO opendrift:1905: Storing previous values of element property lon because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
19:49:00 INFO opendrift:1905: Storing previous values of element property lat because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
19:49:00 INFO opendrift:947: Using existing reader for land_binary_mask to move elements to ocean
19:49:00 INFO opendrift:978: All points are in ocean
19:49:00 INFO opendrift:2202: 2009-11-19 12:00:00 - step 1 of 36 - 10 active elements (0 deactivated)
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.zeta:418: Using zeta for sea surface height
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.zeta:418: Using zeta for sea surface height
19:49:00 INFO opendrift.readers.reader_ROMS_native:418: Using zeta for sea surface height
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_u:388: Using mask_u for mask_u
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_u:388: Using mask_u for mask_u
19:49:00 INFO opendrift.readers.reader_ROMS_native:388: Using mask_u for mask_u
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.get_variables:639: Time: 0:00:00.084662
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.get_variables:639: Time: 0:00:00.084662
19:49:00 INFO opendrift.readers.reader_ROMS_native:639: Time: 0:00:00.084662
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_v:409: Using mask_v for mask_v
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_v:409: Using mask_v for mask_v
19:49:00 INFO opendrift.readers.reader_ROMS_native:409: Using mask_v for mask_v
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.angle:432: Using angle from Dataset.
2026-04-09 19:49:00 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.angle:432: Using angle from Dataset.
19:49:00 INFO opendrift.readers.reader_ROMS_native:432: Using angle from Dataset.
19:49:00 INFO opendrift:2202: 2009-11-19 12:05:00 - step 2 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:10:00 - step 3 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:15:00 - step 4 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:20:00 - step 5 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:25:00 - step 6 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:30:00 - step 7 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:35:00 - step 8 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:40:00 - step 9 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:45:00 - step 10 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:50:00 - step 11 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 12:55:00 - step 12 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 13:00:00 - step 13 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 13:05:00 - step 14 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 13:10:00 - step 15 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 13:15:00 - step 16 of 36 - 10 active elements (0 deactivated)
19:49:00 INFO opendrift:2202: 2009-11-19 13:20:00 - step 17 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:25:00 - step 18 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:30:00 - step 19 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:35:00 - step 20 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:40:00 - step 21 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:45:00 - step 22 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:50:00 - step 23 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 13:55:00 - step 24 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:00:00 - step 25 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:05:00 - step 26 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:10:00 - step 27 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:15:00 - step 28 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:20:00 - step 29 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:25:00 - step 30 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:30:00 - step 31 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:35:00 - step 32 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:40:00 - step 33 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:45:00 - step 34 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:50:00 - step 35 of 36 - 10 active elements (0 deactivated)
19:49:01 INFO opendrift:2202: 2009-11-19 14:55:00 - step 36 of 36 - 10 active elements (0 deactivated)
To create the plots:
import particle_tracking_manager.models.opendrift.plot as plot
out_plots = plot.make_plots_after_simulation(m.config.output_file,
plots={'spaghetti': {},
'spaghetti2': {'linecolor': 'sea_water_temperature', 'cmap': 'cmo.thermal'},
'animation': {'filetype': 'gif'},
'animation_profile': {'filetype': 'gif'},
'property': {'variable': 'z'},
'propertymean': {'variable': 'z', 'mean': True},})
19:49:01 INFO opendrift:568: OpenDriftSimulation initialised (version 1.14.9)
19:49:01 DEBUG opendrift:1798: No elements to deactivate
2026-04-09 19:49:01 WARNING opendrift.export.io_netcdf.io_netcdf.import_file:186: time data '3600.0' does not match format '%H:%M:%S'
2026-04-09 19:49:01 WARNING opendrift.export.io_netcdf.io_netcdf.import_file:186: time data '3600.0' does not match format '%H:%M:%S'
19:49:01 WARNING opendrift.export.io_netcdf:186: time data '3600.0' does not match format '%H:%M:%S'
2026-04-09 19:49:01 WARNING opendrift.export.io_netcdf.io_netcdf.import_file:187: Could not parse time_steps from netCDF file
2026-04-09 19:49:01 WARNING opendrift.export.io_netcdf.io_netcdf.import_file:187: Could not parse time_steps from netCDF file
19:49:01 WARNING opendrift.export.io_netcdf:187: Could not parse time_steps from netCDF file
19:49:01 INFO opendrift:87: Returning <class 'opendrift.models.larvalfish_extended.LarvalFishExtended'> object
19:49:01 DEBUG opendrift:2531: Setting up map: corners=None, fast=True, lscale=None
19:49:01 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:02 INFO opendrift:3899: Time to make plot: 0:00:00.857754
19:49:02 INFO opendrift:247: Saved plot to output-results_2026-04-09T194900Z_spaghetti_fast_True.png
19:49:02 DEBUG opendrift:2531: Setting up map: corners=None, fast=True, lscale=None
19:49:02 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:03 INFO opendrift:3899: Time to make plot: 0:00:00.877550
19:49:03 INFO opendrift:247: Saved plot to output-results_2026-04-09T194900Z_spaghetti_fast_True_linecolor_sea_water_temperature_cmap_cmo.thermal.png
19:49:03 DEBUG opendrift:2531: Setting up map: corners=None, fast=True, lscale=None
19:49:03 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:03 DEBUG opendrift:3198: Saving animation..
19:49:03 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194900Z_fast_True_fps_4.gif...
19:49:04 DEBUG opendrift:4806: MPLBACKEND = module://matplotlib_inline.backend_inline
19:49:04 DEBUG opendrift:4807: DISPLAY = None
19:49:04 DEBUG opendrift:4808: Time to save animation: 0:00:01.193510
19:49:04 INFO opendrift:3191: Time to make animation: 0:00:01.681773
19:49:04 INFO opendrift:247: Saved plot to output-results_2026-04-09T194900Z_fast_True_fps_4.gif
19:49:04 DEBUG opendrift:3198: Saving animation..
19:49:04 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194900Z_profile_fps_4.gif...
19:49:05 DEBUG opendrift:4806: MPLBACKEND = module://matplotlib_inline.backend_inline
19:49:05 DEBUG opendrift:4807: DISPLAY = None
19:49:05 DEBUG opendrift:4808: Time to save animation: 0:00:00.340280
19:49:05 INFO opendrift:3407: Time to make animation: 0:00:00.352813
19:49:05 INFO opendrift:247: Saved plot to output-results_2026-04-09T194900Z_profile_fps_4.gif
19:49:05 INFO opendrift:247: Saved plot to output-results_2026-04-09T194900Z_property_variable_z.png
19:49:05 INFO opendrift:247: Saved plot to output-results_2026-04-09T194900Z_property_variable_z_mean_True.png
To show the animations:
from IPython.display import Image
gif_filename = out_plots["animation"]["filename"]
Image(filename=gif_filename)
gif_filename = out_plots["animation_profile"]["filename"]
Image(filename=gif_filename)
Demo with oil spill scenario¶
m = ptm.OpenDriftModel(drift_model="OpenOil", lon=-90, lat=28.7, number=10, duration="3h",
do3D=False, use_static_masks=True, z=0,
ocean_model="TXLA",
ocean_model_local=False,
start_time="2009-11-19T12:00",
plots={'spaghetti': {},
'spaghetti2': {'linecolor': 'viscosity', 'cmap': 'cmo.speed'},
'animation': {'filetype': 'gif'},
'animation2': {'background': 'sea_floor_depth_below_sea_level',
'cmap': 'cmo.deep', 'filetype': 'gif'},
'animation_profile': {'filetype': 'gif'},
'animation_profile2': {'markersize_scaling': 80, 'cmap': 'cmo.amp',
'color': 'mass_oil', 'fps': 4, 'filetype': 'gif'},
'property': {'variable': 'sea_water_salinity'},
'propertymean': {'variable': 'sea_water_salinity', 'mean': True},
'oil': {},
})
m.setup_for_simulation()
m.o.set_config('environment:constant:x_wind', 1)
m.o.set_config('environment:constant:y_wind', -1)
m.run_all()
2026-04-09 19:49:06 INFO root.config_logging.setup_logger:54: Particle tracking manager simulation.
2026-04-09 19:49:06 INFO root.config_logging.setup_logger:55: Log filename: output-results_2026-04-09T194906Z.log
2026-04-09 19:49:06 INFO root.config_the_manager.timedir:348: Running model forward in time.
2026-04-09 19:49:06 INFO root.config_the_manager.timedir:348: Running model forward in time.
2026-04-09 19:49:06 INFO root.config_ocean_model.register_on_the_fly:230: Registered new ocean model or altered existing ocean model in the registry.
19:49:06 INFO opendrift:568: OpenDriftSimulation initialised (version 1.14.9)
2026-04-09 19:49:06 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:187: Vstretching not found, using 1
2026-04-09 19:49:06 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:187: Vstretching not found, using 1
19:49:06 WARNING opendrift.readers.reader_ROMS_native:187: Vstretching not found, using 1
2026-04-09 19:49:06 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
2026-04-09 19:49:06 WARNING opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
19:49:06 WARNING opendrift.readers.reader_ROMS_native:310: Duplicate variables for ocean_s_coordinate_g1, selecting s_rho, and discarding s_w
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.__init__:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
19:49:06 INFO opendrift.readers.reader_ROMS_native:317: The following variables without standard_name are discarded: ['angle', 'hc', 'Cs_r', 'Cs_w', 'mask_u', 'mask_v', 'Vtransform', 'pm', 'pn', 'f', 'lon_rho', 'lat_rho', 'ocean_time', 'lon_u', 'lat_u', 'lon_v', 'lat_v']
2026-04-09 19:49:06 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:49:06 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:49:06 WARNING opendrift.readers.basereader.structured.structured.__init__:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
19:49:06 WARNING opendrift.readers.basereader.structured:50: No proj string or projection could be derived for reader TXLA, using 'fakeproj'.
2026-04-09 19:49:06 INFO opendrift.readers.basereader.structured.structured.__init__:81: Loading previously saved interpolator for lon,lat to x,y conversion.
2026-04-09 19:49:06 INFO opendrift.readers.basereader.structured.structured.__init__:81: Loading previously saved interpolator for lon,lat to x,y conversion.
2026-04-09 19:49:06 INFO opendrift.readers.basereader.structured.structured.__init__:81: Loading previously saved interpolator for lon,lat to x,y conversion.
19:49:06 INFO opendrift.readers.basereader.structured:81: Loading previously saved interpolator for lon,lat to x,y conversion.
19:49:06 INFO root:296: Using seed_flag "elements".
19:49:06 INFO root:296: Using seed_flag "elements".
19:49:06 INFO root:296: Using seed_flag "elements".
2026-04-09 19:49:06 INFO opendrift.models.openoil.adios.dirjs.dirjs.find_full_oil_from_name:86: Querying ADIOS database for oil: GENERIC BUNKER C
19:49:06 INFO opendrift.models.openoil.adios.dirjs:86: Querying ADIOS database for oil: GENERIC BUNKER C
2026-04-09 19:49:06 INFO opendrift.models.openoil.openoil.openoil.seed_elements:1726: Using density 988.1 and viscosity 0.02169233387797564 of oiltype GENERIC BUNKER C
19:49:06 INFO opendrift.models.openoil.openoil:1726: Using density 988.1 and viscosity 0.02169233387797564 of oiltype GENERIC BUNKER C
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:227: Fallback values will be used for the following variables which have no readers:
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:227: Fallback values will be used for the following variables which have no readers:
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:227: Fallback values will be used for the following variables which have no readers:
19:49:06 INFO opendrift.models.basemodel.environment:227: Fallback values will be used for the following variables which have no readers:
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: upward_sea_water_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: upward_sea_water_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: upward_sea_water_velocity: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: upward_sea_water_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_significant_height: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_significant_height: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_significant_height: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_significant_height: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_area_fraction: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_area_fraction: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_area_fraction: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_ice_area_fraction: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_x_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_x_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_x_velocity: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_ice_x_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_y_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_y_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: sea_ice_y_velocity: 0.000000
19:49:06 INFO opendrift.models.basemodel.environment:230: sea_ice_y_velocity: 0.000000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: ocean_vertical_diffusivity: 0.020000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: ocean_vertical_diffusivity: 0.020000
2026-04-09 19:49:06 INFO opendrift.models.basemodel.environment.environment.__assert_no_missing_variables__:230: ocean_vertical_diffusivity: 0.020000
19:49:06 INFO opendrift.models.basemodel.environment:230: ocean_vertical_diffusivity: 0.020000
19:49:06 INFO root:168: start_time: 2009-11-19 12:00:00, end_time: 2009-11-19 15:00:00, steps: 36, duration: 3h
19:49:06 INFO root:296: Using seed_flag "elements".
19:49:06 INFO root:348: Running model forward in time.
19:49:06 INFO opendrift:1894: Skipping environment variable upward_sea_water_velocity because of condition ['drift:vertical_advection', 'is', False]
19:49:06 INFO opendrift:1894: Skipping environment variable ocean_vertical_diffusivity because of condition ['drift:vertical_mixing', 'is', False]
19:49:06 INFO opendrift:1894: Skipping environment variable ocean_mixed_layer_thickness because of condition ['drift:vertical_mixing', 'is', False]
19:49:06 INFO opendrift:1905: Storing previous values of element property lon because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
19:49:06 INFO opendrift:1905: Storing previous values of element property lat because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
19:49:06 INFO opendrift:947: Using existing reader for land_binary_mask to move elements to ocean
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_rho:367: Using mask_rho for mask_rho
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_rho:367: Using mask_rho for mask_rho
19:49:06 INFO opendrift.readers.reader_ROMS_native:367: Using mask_rho for mask_rho
19:49:06 INFO opendrift:978: All points are in ocean
2026-04-09 19:49:06 INFO opendrift.models.openoil.openoil.openoil.prepare_run:697: Oil-water surface tension is 0.035935 Nm
19:49:06 INFO opendrift.models.openoil.openoil:697: Oil-water surface tension is 0.035935 Nm
2026-04-09 19:49:06 INFO opendrift.models.openoil.openoil.openoil.prepare_run:710: Max water fraction not available for GENERIC BUNKER C, using default
19:49:06 INFO opendrift.models.openoil.openoil:710: Max water fraction not available for GENERIC BUNKER C, using default
19:49:06 INFO opendrift:2202: 2009-11-19 12:00:00 - step 1 of 36 - 10 active elements (0 deactivated)
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.zeta:418: Using zeta for sea surface height
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.zeta:418: Using zeta for sea surface height
19:49:06 INFO opendrift.readers.reader_ROMS_native:418: Using zeta for sea surface height
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_u:388: Using mask_u for mask_u
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_u:388: Using mask_u for mask_u
19:49:06 INFO opendrift.readers.reader_ROMS_native:388: Using mask_u for mask_u
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.get_variables:639: Time: 0:00:00.088210
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.get_variables:639: Time: 0:00:00.088210
19:49:06 INFO opendrift.readers.reader_ROMS_native:639: Time: 0:00:00.088210
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_v:409: Using mask_v for mask_v
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.mask_v:409: Using mask_v for mask_v
19:49:06 INFO opendrift.readers.reader_ROMS_native:409: Using mask_v for mask_v
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.angle:432: Using angle from Dataset.
2026-04-09 19:49:06 INFO opendrift.readers.reader_ROMS_native.reader_ROMS_native.angle:432: Using angle from Dataset.
19:49:06 INFO opendrift.readers.reader_ROMS_native:432: Using angle from Dataset.
19:49:07 INFO opendrift:2202: 2009-11-19 12:05:00 - step 2 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:10:00 - step 3 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:15:00 - step 4 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:20:00 - step 5 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:25:00 - step 6 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:30:00 - step 7 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:35:00 - step 8 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:40:00 - step 9 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:45:00 - step 10 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:50:00 - step 11 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 12:55:00 - step 12 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:00:00 - step 13 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:05:00 - step 14 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:10:00 - step 15 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:15:00 - step 16 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:20:00 - step 17 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:25:00 - step 18 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:30:00 - step 19 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:35:00 - step 20 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:40:00 - step 21 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:45:00 - step 22 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:50:00 - step 23 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 13:55:00 - step 24 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:00:00 - step 25 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:05:00 - step 26 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:10:00 - step 27 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:15:00 - step 28 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:20:00 - step 29 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:25:00 - step 30 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:30:00 - step 31 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:35:00 - step 32 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:40:00 - step 33 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:45:00 - step 34 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:50:00 - step 35 of 36 - 10 active elements (0 deactivated)
19:49:07 INFO opendrift:2202: 2009-11-19 14:55:00 - step 36 of 36 - 10 active elements (0 deactivated)
19:49:07 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:08 INFO opendrift:3899: Time to make plot: 0:00:01.193383
19:49:08 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_spaghetti_fast_True.png
19:49:08 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:09 INFO opendrift:3899: Time to make plot: 0:00:00.877341
19:49:09 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_spaghetti_fast_True_linecolor_viscosity_cmap_cmo.speed.png
19:49:09 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:10 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194906Z_fast_True_fps_4_background_land_binary_mask_cmap_cmo.deep_hide_landmask_True.gif...
19:49:11 INFO opendrift:3191: Time to make animation: 0:00:01.836806
19:49:11 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_fast_True_fps_4_background_land_binary_mask_cmap_cmo.deep_hide_landmask_True.gif
19:49:11 WARNING opendrift:2565: Plotting fast. This will make your plots less accurate.
19:49:12 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194906Z_fast_True_fps_4_background_sea_floor_depth_below_sea_level_cmap_cmo.deep_hide_landmask_True.gif...
19:49:13 INFO opendrift:3191: Time to make animation: 0:00:01.871108
19:49:13 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_fast_True_fps_4_background_sea_floor_depth_below_sea_level_cmap_cmo.deep_hide_landmask_True.gif
19:49:13 WARNING py.warnings:110: /home/docs/checkouts/readthedocs.org/user_builds/particle-tracking-manager/conda/latest/lib/python3.13/site-packages/opendrift/models/basemodel/__init__.py:3387: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
plt.ylim([zmin, sky])
19:49:13 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194906Z_profile_fps_4.gif...
19:49:13 INFO opendrift:3407: Time to make animation: 0:00:00.385437
19:49:13 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_profile_fps_4.gif
19:49:13 WARNING py.warnings:110: /home/docs/checkouts/readthedocs.org/user_builds/particle-tracking-manager/conda/latest/lib/python3.13/site-packages/opendrift/models/basemodel/__init__.py:3387: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
plt.ylim([zmin, sky])
19:49:13 INFO opendrift:4768: Saving animation to output-results_2026-04-09T194906Z_profile_fps_4_markersize_scaling_80_cmap_cmo.amp_color_mass_oil.gif...
19:49:14 INFO opendrift:3407: Time to make animation: 0:00:00.416817
19:49:14 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_profile_fps_4_markersize_scaling_80_cmap_cmo.amp_color_mass_oil.gif
19:49:14 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_property_variable_sea_water_salinity.png
19:49:14 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_property_variable_sea_water_salinity_mean_True.png
19:49:15 INFO opendrift:247: Saved plot to output-results_2026-04-09T194906Z_oil_show_wind_and_current_True_show_watercontent_and_viscosity_True.png
from IPython.display import Image, HTML
import ast
filename = ast.literal_eval(m.config.plots)["oil"]["filename"]
Image(filename=filename)
To show the animations:
gif_filename = ast.literal_eval(m.config.plots)["animation"]["filename"]
Image(filename=gif_filename)
gif_filename = ast.literal_eval(m.config.plots)["animation2"]["filename"]
Image(filename=gif_filename)
gif_filename = ast.literal_eval(m.config.plots)["animation_profile"]["filename"]
Image(filename=gif_filename)
gif_filename = ast.literal_eval(m.config.plots)["animation_profile2"]["filename"]
Image(filename=gif_filename)