Description Usage Format Author(s) References See Also Examples
Chesapeake
is a list
with the bathymetry of Chesapeake Bay, Mid-Atlantic Bight
and the initial position of the particles.
Ltrans
is an array
with output of the Lagrangian Transport model (Ltrans v.2) from
Chesapeake Bay mouth, at 37 dgN in the Mid-Atlantic Bight (Schlag and North, 2012).
1 2 |
Chesapeake
is a list
with the bathymetry of the area.
There are 154 x-values, at 77 y-values.
It contains:
lon
, the longitude, (154 x 77), dg East.
lat
, the latitude, (154 x 77), dg North.
depth
, the bathymetry (154 x 77), metres.
init
, the initial condition of the particles, a (608 x 4) matrix
with (lon, lat, depth, source
) values.
Ltrans
contains output of the Lagrangian particle transport model,
in the Chesapeake mouth area. 608 particles were released in two square regions,
and their positions followed over 108 output steps. It is an array of dimension
(608 x 4 x 108), and which contains for each of the 608 particles, and at each
of the 108 output steps the following:
lon
, the longitude of each particle.
lat
, the latitude of each particle.
depth
, the depth of each particle.
source
, the square region of release, either 1
or 2
.
Karline Soetaert <karline.soetaert@nioz.nl>
Schlag, Z. R., and E. W. North. 2012. Lagrangian TRANSport model (LTRANS v.2) User's Guide. University of Maryland Center for Environmental Science, Horn Point Laboratory. Cambridge, MD. 183 pp.
North, E. W., E. E. Adams, S. Schlag, C. R. Sherwood, R. He, S. Socolofsky. 2011. Simulating oil droplet dispersal from the Deepwater Horizon spill with a Lagrangian approach. AGU Book Series: Monitoring and Modeling the Deepwater Horizon Oil Spill: A Record Breaking Enterprise.
Sylt3D for output of a 3-D hydrodynamical model, GETM.
Oxsat for a 3-D data set, package plot3D
.
tracers2D for plotting time series of tracer distributions in 2D
tracers3D for plotting time series of tracer distributions in 3D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | # save plotting parameters
pm <- par("mfrow")
mar <- par("mar")
## =============================================================================
## Show bathymetry and initial distribution of particles
## =============================================================================
par(mfrow = c(1, 1))
lon <- Chesapeake$lon
lat <- Chesapeake$lat
depth <- Chesapeake$depth
init <- Chesapeake$init
image2D(z = depth, x = lon, y = lat, clab = c("depth", "m"),
xlab = "lon", ylab = "lat")
# position of particles
with (init, scatter2D(lon, lat, colvar = source, pch = 16, cex = 0.5,
col = c("green", "orange"), add = TRUE, colkey = FALSE))
par (mar = c(2, 2, 2, 2))
# same, as persp plot
persp3D(x = lon, y = lat, z = -depth, scale = FALSE,
expand = 0.02, main = "initial particle distribution",
plot = FALSE)
points3D(x = init$lon, y = init$lat, z = -init$depth,
colvar = init$source, col = c("green", "orange"),
pch = 16, cex = 0.5,
add = TRUE, colkey = FALSE, plot = FALSE)
## Not run:
plotdev(lighting = TRUE, lphi = 45)
## End(Not run)
plotrgl(lighting = TRUE, smooth = TRUE)
## =============================================================================
## Tracer output in 3D, traditional device
## =============================================================================
## Not run:
par(mfrow = c(2, 1), mar = c(2, 2, 2, 2))
for (i in c(50, 100))
tracers3D(Ltrans[, 1, i], Ltrans[, 2, i], Ltrans[, 3, i],
colvar = Ltrans[ ,4, i], col = c("green", "orange"),
pch = 16, cex = 0.5,
surf = list(x = lon, y = lat, z = -depth, scale = FALSE,
expand = 0.02, colkey = FALSE, shade = 0.3,
colvar = depth), colkey = FALSE,
main = paste("time ", i))
## End(Not run)
## =============================================================================
## Tracer output in 3D, using rgl
## =============================================================================
persp3D(x = lon, y = lat, z = -depth, colvar = depth, scale = FALSE,
expand = 0.02, main = "particle distribution", plot = FALSE)
plotrgl(lighting = TRUE, smooth = TRUE)
# you may zoom to the relevant region, or cut a region
# cutrgl()
for (i in seq(1, 108, by = 4)) {
tracers3Drgl(Ltrans[, 1, i], Ltrans[, 2, i], Ltrans[, 3, i],
colvar = Ltrans[ ,4, i], col = c("green", "orange"),
main = paste("time ", i))
# remove # to slow down
# Sys.sleep(0.1)
}
# using function moviepoints3D
## Not run:
persp3Drgl(x = lon, y = lat, z = -depth, colvar = depth, scale = FALSE,
expand = 0.02, main = "particle distribution",
lighting = TRUE, smooth = TRUE)
nt <- dim(Ltrans)[3] # number of time points
np <- dim(Ltrans)[1] # number of particles
times <- rep(1:nt, each = np)
moviepoints3D(x = Ltrans[, 1, ], y = Ltrans[, 2, ], z = Ltrans[, 3, ],
t = times, colvar = Ltrans[ ,4, ], col = c("green", "orange"),
cex = 5, ask = TRUE)
## End(Not run)
## =============================================================================
## Tracer output in 2D, traditional device
## =============================================================================
par(mfrow = c(2, 2))
for (i in seq(10, 106, length.out = 4))
tracers2D(Ltrans[, 1, i], Ltrans[, 2, i],
colvar = Ltrans[ ,4, i], col = c("green", "orange"),
pch = 16, cex = 0.5,
image = list(x = lon, y = lat, z = depth), colkey = FALSE,
main = paste("time ", i))
## =============================================================================
## Tracer output in 2D, rgl
## =============================================================================
image2Drgl (x = lon, y = lat, z = depth)
for (i in seq(1, 108, by = 3)) {
tracers2Drgl(Ltrans[, 1, i], Ltrans[, 2, i],
colvar = Ltrans[ ,4, i], col = c("green", "orange"))
# remove # to slow down
# Sys.sleep(0.1)
}
# reset plotting parameters
par(mar = mar)
par(mfrow = pm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.