:py:mod:`opendrift.models.oceandrift` ===================================== .. py:module:: opendrift.models.oceandrift Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: opendrift.models.oceandrift.Lagrangian3DArray opendrift.models.oceandrift.OceanDrift Attributes ~~~~~~~~~~ .. autoapisummary:: opendrift.models.oceandrift.logger .. py:data:: logger .. py:class:: Lagrangian3DArray(**kwargs) Bases: :py:obj:`opendrift.elements.LagrangianArray` Extending LagrangianArray for elements moving in 3 dimensions The Particle may be buoyant and/or subject to vertical mixing buoyant bahaviour is described by terminal velocity Initialises a LagrangianArray with given properties. Args: Keyword arguments (kwargs) with names corresponding to the OrderedDict 'variables' of the class, and corresponding values. The values must be ndarrays of equal length, or scalars. All (or none) variables must be given, unless a default value is specified in the OrderedDict 'variables' An empty object may be created by giving no input. .. py:attribute:: variables .. py:class:: OceanDrift(*args, **kwargs) Bases: :py:obj:`opendrift.models.basemodel.OpenDriftSimulation` Open source buoyant particle trajectory model based on OpenDrift. Developed at MET Norway Generic module for particles that move in 3 dimensions and may be to vertical turbulent mixing with the possibility for positive or negative buoyancy Particles could be e.g. oil droplets, plankton, nutrients or sediments, Model may be subclassed for more specific behaviour. Initialise OpenDriftSimulation Args: seed: integer or None. A given integer will yield identical random numbers drawn each simulation. Random numbers are e.g. used to distribute particles spatially when seeding, and may be used by modules (subclasses) for e.g. diffusion. Specifying a fixed value (default: 0) is useful for sensitivity tests. With seed = None, different random numbers will be drawn for subsequent runs, even with identical configuration/input. iomodule: name of module used to export data default: netcdf, see :py:mod:`opendrift.io` for more alternatives. `iomodule` is module/filename without preceeding `io_` loglevel: set to 0 (default) to retrieve all debug information. Provide a higher value (e.g. 20) to receive less output. Use the string 'custom' to configure logging from outside. logtime: if True, a time stamp is given for each logging line. logtime can also be given as a python time specifier (e.g. '%H:%M:%S') .. py:attribute:: ElementType .. py:attribute:: required_variables .. py:method:: update() Update positions and properties of elements. .. py:method:: simulate_trajectories(outfile, trajectories, number=1, wind_drift_factors=None, current_drift_factors=None, time_step=None, time_step_output=None, simulation_duration=None, simulation_interval=None) .. py:method:: wind_drift_factor_from_trajectory_lw(drifters, wind_drift_factors, simulation_length, simulation_interval) Perform simulations and use skillscore to optimize wind_drift_factor drifters: list of dictionaries with numpy arrays of 'lon' and 'lat' and list of datetimes wind_drift_factors: the wind_drift_factors to use for simulations/optimalizations .. py:method:: machine_learning_correction() .. py:method:: disable_vertical_motion() Deactivate any vertical processes/advection .. py:method:: update_terminal_velocity(Tprofiles=None, Sprofiles=None, z_index=None) Calculate terminal velocity due to bouyancy from own properties and environmental variables. Sub-modules should overload this method for particle-specific behaviour .. py:method:: prepare_vertical_mixing() .. py:method:: prepare_run() .. py:method:: vertical_advection() Move particles vertically according to vertical ocean current Vertical advection by ocean currents is normally small compared to termical velocity .. py:method:: vertical_buoyancy() Move particles vertically according to their buoyancy .. py:method:: surface_stick() To be overloaded by subclasses, e.g. downward mixing of oil .. py:method:: bottom_interaction(Zmin=None) To be overloaded by subclasses, e.g. radionuclides in sediments .. py:method:: surface_wave_mixing(time_step_seconds) To be overloaded by subclasses, e.g. downward mixing of oil .. py:method:: get_diffusivity_profile(model, depths) .. py:method:: vertical_mixing(store_depths=False) Mix particles vertically according to eddy diffusivity and buoyancy Buoyancy is expressed as terminal velocity, which is the steady-state vertical velocity due to positive or negative buoyant behaviour. It is usually a function of particle density, diameter, and shape. Vertical particle displacemend du to turbulent mixing is calculated using a random walk scheme" (Visser et al. 1996) .. py:method:: animate_vertical_distribution(depths=None, maxdepth=None, bins=50, filename=None, subsamplingstep=1) Function to animate vertical distribution of particles bins: number of bins in the histogram maxdepth: maximum depth subsamplingstep: speed-up the generation of the animation reducing the number of output frames fasterwriter: speed-up the writing to outpute file .. py:method:: plot_vertical_distribution(maxdepth=None, bins=None, maxnum=None) Function to plot vertical distribution of particles maxdepth: maximum depth considered for the profile bins: number of bins between surface and maxdepth maxnum: range of bars in histogram is [0,maxnum] .. py:method:: plotter_vertical_distribution_time(ax=None, mask=None, dz=1.0, maxrange=-100, bins=None, step=1) Function to plot vertical distribution of particles. Use mask to plot any selection of particles.