Slackwater

View on GitHub
An open source tide prediction engine

Many agencies like NOAA provide high-quality tide data and prediction services. But these services require online access, and are not available for every country. Slackwater uses standard algorithms to predict tide heights anywhere that has well-defined harmonic constituents.

Key Features

Harmonic Analysis

Uses harmonic constituents to predict tides with high accuracy, matching or exceeding commercial tide prediction software.

Fast Performance

Written in modern JavaScript/TypeScript with performance optimizations for both server and client-side predictions.

Flexible Datum Support

Calculate tides relative to different vertical datums including MLLW, MSL, MLW, and more.

Developer Friendly

Simple, well-documented API that's easy to integrate into your applications. Available as an npm package.

Using Slackwater

Installation

npm install slackwater

Example Usage

import {
  getTimelinePrediction,
  getExtremesPrediction
} from 'slackwater';

const start = new Date();
const end = new Date(Date.now() + 24 * 60 * 60 * 1000);

// Get water level predictions for San Francisco
const { timeline } = getTimelinePrediction({
  latitude: 37.8063,
  longitude: -122.4659,
  start,
  end
});

// Find high and low tides
const { extremes } = getExtremesPrediction({
  latitude: 37.8063,
  longitude: -122.4659,
  start,
  end
});

Free & Open Source

Slackwater is open source software, available under the MIT license. Use it freely in your projects, contribute improvements, or fork it for your own needs.