particle_tracking_manager.models.opendrift.plot

Functions

check_plots(which_plots, export_variables, ...)

Check that input plot options are valid,

make_filename_string(plot_name, filename, kwargs)

Create a filename string based on the kwargs.

make_plots(which_plots, o, filename, drift_model)

Run through each plot key and make the plot.

make_plots_after_simulation(output_filepath)

Make plots after a simulation has been run.

plot(plot_name, input_kwargs, o, filename, ...)

Create a plot based on the plot name and input kwargs.

particle_tracking_manager.models.opendrift.plot.check_plots(which_plots, export_variables, drift_model)[source]

Check that input plot options are valid,

particularly that the necessary export variables are included.

Parameters:
  • which_plots (dict) – Dictionary of plot options.

  • export_variables (list) – Variables to be saved to file.

  • drift_model (str) – Which OpenDrift model is being used.

Raises:
  • ValueError – If “all” is specified with other plot options.

  • ValueError – If necessary export variables are missing.

  • ValueError – If oil budget plot is requested with a drift model other than OpenOil.

particle_tracking_manager.models.opendrift.plot.make_filename_string(plot_name, filename, kwargs)[source]

Create a filename string based on the kwargs.

particle_tracking_manager.models.opendrift.plot.make_plots(which_plots, o, filename, drift_model)[source]

Run through each plot key and make the plot.

This extra level of abstraction is necessary to allow for multiple types of each plot to be made, for example, a spaghetti plot and a spaghetti plot with tracks colored.

particle_tracking_manager.models.opendrift.plot.make_plots_after_simulation(output_filepath, plots='all')[source]

Make plots after a simulation has been run.

Parameters:
  • output_filepath (str) – Path to the output file from the simulation.

  • which_plots (dict) – Dictionary of plot options.

Returns:

Dictionary of plot options with the filename of each plot.

Return type:

dict

particle_tracking_manager.models.opendrift.plot.plot(plot_name, input_kwargs, o, filename, drift_model)[source]

Create a plot based on the plot name and input kwargs.

Parameters:
  • plot_name (str) – Must contain key word to identify the plot type.

  • input_kwargs (dict) – Optional plot kwargs.

  • o (_type_) – OpenDrift simulation object.

  • filename (str) – Filename substring to save the plot.

  • drift_model (str) – Which OpenDrift model is being used.