pylag.velocity_aggregator module
A velocity aggregator pulls together and combines different terms that together yield a particle’s velocity.
These include:
The effect of ocean currents
The effect of Stoke’s Drift
The effect of direct wind forcing, i.e. sail effects
The effect of buoyancy, i.e. settling or rising
The effect of movement (under development)
Any combination of the above effects may be used at any one time, with the choice determined using the run configuration file. In most cases, each velocity term is calculated using a dedicated Calculator, which is chosen by the user from a family of supported Calculators. This is designed to give flexibility in how the input fields are used to compute the velocity terms.
Separate terms are summed to give the resultant velocity experienced by the particle. Thus, if accounting for advection by surface ocean currents (vo) and direct wind forcing (vw), the velocity of the particle (vp) would be:
and vp would be returned to the caller.
Note
velocity_aggregator is implemented in Cython. Only a small portion of the API is exposed in Python with accompanying documentation.
- class pylag.velocity_aggregator.VelocityAggregator(config)
Bases:
object
- get_velocity_wrapper(self, DataReader data_reader, DTYPE_FLOAT_t time, ParticleSmartPtr particle)
Python friendly wrapper for get_velocity()
- Parameters
data_reader (pylag.data_reader.DataReader) – A concrete PyLag data reader which inherits from the base class pylag.data_reader.DataReader.
time (float) – The current time.
particle (pylag.particle_cpp_wrapper.ParticleSmartPtr) – A ParticleSmartPtr.
- Returns
velocity – Three component array giving the particle’s velocity.
- Return type
NumPy array