Learn R Programming

oce (version 0.8-3)

webtide: Get a tidal prediction from a WebTide database

Description

Get a tidal prediction from a WebTide database

Usage

webtide(action=c("map", "predict"), latitude, longitude, time,
        basedir="/usr/local/WebTide", region="nwatl", plot=TRUE)

Arguments

action
An indication of the action, either map to draw a map and measure the coordinates of a point the user clicks on that map, or predict to predict time-series for a specific location.
latitude
latitude at which prediction is required.
longitude
longitude at which prediction is required.
time
times at which prediction is to be made.
basedir
direction in which the WebTide databases are installed.
region
database region, given as a directory name in the WebTide directory. For example, h3o is for Halifax Harbour, nwatl is for the northwest Atlantic, and sshelf is for the Scotian Shelf and Gulf of Maine.
plot
boolean indicating whether to plot.

Value

  • If action="map", the return value is a list containing the latitude and longitude of the nearest node, and the node number ("node") of that node. If action="predict", the return value is a list containing a vector of times (time), as well as vectors of the predicted elevation in metres and the predicted horizontal components of velocity, u and v, along with the node number, and the basedir and region as supplied to this function.

concept

tide

Details

The action="map" method plots a map with a dot for the lower-left corner of each triangle used in the finite-element tidal simulation upon which WebTide predictions are based. locator is called within this method, so that the user can indicate a spot of interest on the map, and the latitude and longitude of this point are provided in the return value. This is a crude emulation of the WebTide interface, without the ability to zoom or slide reference points around with the mouse. The action="predict" method uses a latitude and longitude, possibly discovered from clicking the mouse, and calculates elevation and velocity time-series at the specified times. In the first case, a plot is drawn irrespective of the value of plot, but in the second case, a plot is only made if plot=TRUE. Naturally, none of this works unless WebTide has been installed on the computer.

References

The WebTide software may be downloaded for free at http://www.bio.gc.ca/research-recherche/WebTide-MareeWeb/webtide-eng.htm, along with a suite of databases for various geographical regions. Note that WebTide is not an open-source application, as it consists mainly of precompiled code written in Java, which precludes examination of the source.

Examples

Run this code
library(oce)
tStart <- ISOdate(2008, 7, 1, 0, 0, 0, tz="UTC")
tEnd <- ISOdate(2008, 7, 5, 0, 0, 0, tz="UTC")
time<-seq(tStart, tEnd, by=15, units="minutes")
prediction <- webtide("predict", 48.14, -69.61, time)

Run the code above in your browser using DataLab