sl.trackingshot.way: Create tracking shot path

Description Usage Arguments Author(s) Examples

View source: R/sl.trackingshot.way.R

Description

Takes list of class sl.waypoints containing all waypoints and a numeric vector of times between the waypoints. They are turned into a list of class sl.way and returned.

Usage

1
sl.trackingshot.way(waypoints, times, smooth.line = 0, ignore.checks = F)

Arguments

waypoints

list of class sl.waypoints containing waypoints.

times

numeric vector of times between waypoints. Element 1 is the time between waypoints 1 and 2, and so on...

smooth.line

(WIP) logical value indicating if lines should be smoothed.

ignore.checks

logical value indicating if correctness checks should be avoided.

Author(s)

Lukas M<c3><bc>ller

Examples

 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
## Not run: 
### read mesh
mesh = sl.grid.readFESOM(griddir="somedir",rot=TRUE,rot.invert=TRUE,rot.abg=c(50,15,-90))
# a sample mesh can be obtained from GitHub, e.g., using 'svn checkout' from the command line:
# > svn checkout https://github.com/FESOM/FESOM-data/trunk/pi-grid ~/pi-grid

### read corresponding data
require(ncdf4)
dat.file = nc_open(filename="somecorrespondingdata.nc")
dat = ncvar_get(nc=dat.file)
nc_close(nc=dat.file)

### define projection and way
projection = "polar"
p1 = sl.trackingshot.waypoint(projection = projection, time = 1, polar.lonlatrot = c(0,90,0), polar.latbound = 0)
p2 = sl.trackingshot.waypoint(projection = projection, time = 1, polar.lonlatrot = c(15,50,0), polar.latbound = 20)
p3 = sl.trackingshot.waypoint(projection = projection, time = 1, polar.lonlatrot = c(-60,-30,0), polar.latbound = 60)
p4 = sl.trackingshot.waypoint(projection = projection, time = 1, polar.lonlatrot = c(100,40,0), polar.latbound = 20)
p5 = p1
p5$time = 0
points = sl.trackingshot.waypoints(projection = projection, p1, p2, p3, p4, p5)
way = sl.trackingshot.way(waypoints = points, times = c(5,5,5,5))

### make video
sl.trackingshot(way = way, num = dat, lon = mesh$lon, lat=mesh$lat, elem=mesh$elem, fps = 30L, width = 1920, threads = 3, file.name = paste0("~/video_", projection, ".mp4"))

## End(Not run)

helgegoessling/spheRlab documentation built on Sept. 29, 2017, 6:36 a.m.