Joe Thorley at Poisson Consulting has released a new R package, rtide, (on which I am listed as a co-author) that provides the ability to predict future (and past) tide heights for 637 different tide stations in the United States and associated territories. The underlying data, consisting of tide harmonic constituents, are collected and released by the National Oceanic and Atmospheric Administration. The author of the definitive open source tide prediction software, XTide, collates those harmonic data into a usable format, and we have harvested the data to create the rtide package which operates in R without the need to have XTide installed.

An example tide prediction for Monterey Harbor, California, produced by rtide.

You can install and load the rtide package by simply running the following commands at your R console:

The results in dat will be a 3-column ‘tibble’ (essentially a data frame) consisting of the
station name (Monterey Harbor), the DateTime column (which should be in the given time zone, which we specified as Pacific Daylight Time), and TideHeight, which is in units of meters. The time step between estimates is declared by the minutes argument, and we set it to 10 minutes above.

You could then use these predicted tide heights for any number of things, such as figuring out when your field site might be exposed or underwater at a given time, or making pretty plots of the tide cycle at your favorite location. The plot above was generated using the example data produced here and the code below:

The available sites for tide prediction can be found by calling the tide_stations() function. If you’re concerned about the accuracy of the predictions, you can always double-check them against the official NOAA tide predictions available on the http://tidesandcurrents.noaa.gov/ website.

Some folks will be wondering whether rtide can produce predictions for other locations around the world (for instance, Canada). At the present time there is no facility to predict the tides for other countries, primarily because other countries do not release their tidal harmonic data into the public domain like the US does. Hopefully this will be rectified in the future via legislative action (don’t hold your breath), but for the present time we are limited to providing predictions for the US.

You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.