Functions for Passive Particles

Mapping functions.

class passive_particles.map_fun.gridded_vars(grid)[source]

Class to hold the gridded variable data.

__init__(grid)[source]

Initialize the class.

Inputs :
gridobj

A landlab grid object.

__weakref__

list of weak references to the object (if defined)

passive_particles.map_fun.map_velocity_components_to_nodes(grid)[source]

Map the velocity components from the links to the nodes.

Inputs :
gridobj

A landlab grid object

Returns :
ebb_vel_xnumpy.ndarray

ebb x component of flow velocity

ebb_vel_ynumpy.ndarray

ebb y component of flow velocity

flood_vel_xnumpy.ndarray

flood x component of flow velocity

flood_vel_ynumpy.ndarray

flood y component of flow velocity

Plotting functions, adapted from: https://github.com/landlab/landlab/blob/gt/tidal-flow-component/notebooks/tutorials/tidal_flow/tidal_flow_calculator.ipynb

passive_particles.plot_fun.group_plot(gridded_vars)[source]

Set of plots of the gridded variables.

Inputs :
gridded_varsobj

A gridded_vars object from map_fun.py

Returns :

Draws a figure that can be rendered with plt.show()

passive_particles.plot_fun.plot_depth(grid, resample=1)[source]

Plot of water depths.

Inputs :
gridobj

A landlab grid object

resampleint

Downsampling value

Returns :

Draws a figure that can be rendered with plt.show()

passive_particles.plot_fun.plot_ebb_magnitudes(grid, resample=1)[source]

Plot of ebb velocities.

Inputs :
grid obj

A landlab grid object

resampleint

Downsampling value

Returns :

Draws a figure that can be rendered with plt.show()

passive_particles.plot_fun.plot_ebb_quiver(grid, resample=1)[source]

Quiver plot of ebb velocities.

Inputs :
gridobj

A landlab grid object

resample int

Downsampling value

Returns :

Draws a figure that can be rendered with plt.show()

passive_particles.plot_fun.plot_flood_magnitudes(grid, resample=1)[source]

Plot of flood velocities.

Inputs :
gridobj

A landlab grid object

resampleint

Downsampling value

Returns :

Draws a figure that can be rendered with plt.show()

passive_particles.plot_fun.plot_flood_quiver(grid, resample=1)[source]

Quiver plot of flood velocities.

Inputs :
gridobj

A landlab grid object

resample int

Downsampling value

Returns :

Draws a figure that can be rendered with plt.show()

Functions associated with the passive particle routing.

passive_particles.particletransport.init_particles(init_x, init_y, Np_tracer, grid_spacing, gridded_vals)[source]

Initialize the particles.

Inputs :
init_xlist

List of starting x locations for the particles

init_ylist

List of starting y locations for the particles

Np_tracerint

Number of particles to route

grid_spacingint

Size of the raster grid cells

gridded_valsobj

gridded_vals object from map_fun.py

Outputs :
paramsobj

an initialized params class

passive_particles.particletransport.tidal_particles(params, tide_period, n_tide_periods, plot_grid=None)[source]

Route the particles in tides.

Inputs :
paramsobj

params output from init_particles()

tide_periodint

tidal period in seconds

n_tide_periods‘int’

number of tidal periods to iterate particles over

plot_gridnumpy.ndarray (Optional)

grid on which to plot the particles (e.g. depth)

Returns :
walk_datalist

history of particle locations and travel times

Also saves image of particle locations to disk for each flood/ebb tide.