Get a tidal prediction from a WebTide database. This only works if the standalone WebTide application is installed, and if it is installed in a standard location. The details of installation are not within the oce purview.
The WebTide software may be downloaded for free at the
Department of Fisheries and Oceans (Canada) website at
(checked February 2016 and May 2017).
An indication of the action, either
draw a map or
action="predict" to get a prediction; see
optional location at which prediction is required (ignored if
node is given).
optional integer relating to a node in the database. If
is given, then neither
longitude may be given.
node is positive, then specifies indicates the node. If it is negative,
locator() is called so that the user can click (once) on the map, after
which the node is displayed on the map.
a vector of times (in the UTC timezone)
at which prediction is to be made.
If not supplied, this will be the week starting at the present time,
presentTime(), with a 15 minute increment.
directory containing the
database region, given as a directory name in the WebTide
directory. For example,
h3o is for Halifax Harbour,
for the northwest Atlantic, and
sshelf is for the Scotian Shelf and
Gulf of Maine.
boolean indicating whether to plot.
an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many
oce functions. Generally, setting
turns off the printing, while higher values suggest that more information
be printed. If one function calls another, it usually reduces the value of
debug first, so that a user can often obtain deeper debugging
by specifying higher
optional arguments passed to plotting functions. A common
example is to set
ylim, to focus a map region.
The value depends on
action="map" the return value is a
list containing the index of the nearest node, along with the
longitude of that node. If
FALSE, this value is returned invisibly.
action="predict", the return value is a list containing a vector
of times (
time), as well as vectors of the predicted
in metres and the predicted horizontal components of velocity,
v, along with the
node number, and the
region as supplied to this function. If
this value is returned invisibly.
There are two methods of using this function.
action="map". In this case, if
FALSE, a list is returned, containing
nodes in the selected database, along with all
longitudes. This value is
also returned (silently) if
plot is true, but in that case,
a plot is drawn to indicate the node locations. If
longitude are given, then the node nearest that spot is indicated on
the map; otherwise, if
node is given, then the location of that
node is indicated. There is also a special case: if
node is negative
locator() is called, and the node nearest the spot
where the user clicks the mouse is indicated in the plot and in the
then a list is returned, indicating
elevation, velocity components
node number, the name of the
TRUE, this list is returned
silently, and time-series plots are drawn for elevation, u, and v.
webtide will not work unless WebTide has been installed on
WebTide is not an open-source application, so the present function was designed based on little more than guesses about the WebTide file structure. Users should be on the lookout for odd results.
# needs WebTide at the system level library(oce) # 1. prediction at Halifax NS longitude <- -63.57 latitude <- 44.65 prediction <- webtide("predict", longitude=longitude, latitude=latitude) mtext(paste0("prediction at ", latitude, "N and ", longitude, "E"), line=0.75, side=3) # 2. map webtide(lon=-63.57,lat=44.65,xlim=c(-64,-63),ylim=c(43.0,46))