Learn R Programming

ocean (version 0.1-0)

lagrangian.pdd: Lagrangian probability density distribution

Description

Generates a Lagrangian probability density distribution and plots it on an unstructured grid. This function follows the method described in Simons et al 2013: first vertically integrating the data, then dividing by the number of particles spawned, and finally applying an Gaussian blur filter. The coordinates should be passed in as x,y in meters, then are projected into lat/long using the PROJ.4 library.

Usage

lagrangian.pdd(grid, x, y, proj='', npart.released=length(x), res=c(1e3,
               1e3), log=F,
               xlim=c(min(x), max(x)), ylim=c(min(y), max(y)), zlim=NA)

Arguments

grid
An unstructured grid that could be passed to plot.att
x
A vector of particle x locations.
y
A vector of particle y locations.
proj
A string to project the (x,y) coordinates to latitude-longitude using the PROJ.4 library. If proj is an empty string, the points are not projected, and units='m' is passed to att.plot.
npart.released
The number of particles released.
res
The size of the grid cells to bin particles into in meters.
log
Should the data be plotted on a log scale
xlim
x limits for plotting and binning the data.
ylim
y limits for plotting and binning the data.
zlim
z limits to be passed through to image.

References

Simons, R.D. and Siegel, D.A. and Brown K.S. 2013 Model sensitivity and robustness in the estimation of larval transport: A study of particle tracking parameters J. Marine Systems 119--120: 19--29.

Examples

Run this code
# Use the grid from the att.plot example
example(att.plot)
# Create a set of particle locations
x <- rnorm(10000)
y <- rnorm(10000)
# Plot the locations
grd <- lagrangian.pdd(grid, x, y, res=c(0.03, 0.03))

Run the code above in your browser using DataLab