webtide(action=c("map", "predict"), latitude, longitude, time,
basedir="/usr/local/WebTide", region="nwatl", plot=TRUE)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.h3o is for Halifax Harbour, nwatl is for the northwest Atlantic, and sshelf
is for the Scotian Shelf and Gulf of Maine.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.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.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