1.3.15 • Published 8 years ago

buoyjs v1.3.15

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Build Status Coverage Status

buoyjs

Update: 1.3.8

You can now use .ocean realtime2 data.

Parse data from http://www.ndbc.noaa.gov/ and http://tidesandcurrents.noaa.gov

Buoy Data

Buoy data can be loaded from the latest observation url: http://www.ndbc.noaa.gov/data/latest_obs/latest_obs.txt

And then passed to Buoy.lastestObservation(rawData) to get an object of stations and their current conditions.

Or it can be loaded from: http://www.ndbc.noaa.gov/data/realtime2/{stationID}.txt

OR http://www.ndbc.noaa.gov/data/realtime2/{stationID}.ocean

And passed to Buoy.realTime(rawData) to get a single station an its history of conditions.

Tide Data

Tide data can be loaded by using: http://tidesandcurrents.noaa.gov/api/

And then passed to Tide.parse(rawData)

This returns a tide object, that can be passed to Tide.getCurrent(tideObject, forDate) to return the current tide.

To find the next high or low tide, use Tide.getNextHighOrLow(tideObject, forDate)

For both methods, the second argument is Date object, and the default value is now, if left unspecified.

For parsing published Tide Table data, use Tide.parseTideTable(rawData)

Tide Tables can be found on pages like: http://tidesandcurrents.noaa.gov/noaatidepredictions/NOAATidesFacade.jsp?Stationid=8516881

Example

Using Meteor:

import Buoy from 'buoyjs';

let ndbcRootUrl = `http://www.ndbc.noaa.gov/data/realtime2/`;
let stationId = 44941; // Gooses Reef

HTTP.get(`${ndbcRootUrl}${stationId}.ocean`, (error, response) => {
	let buoyData = Buoy.Buoy.realTime(response.content);
	
	console.log(buoyData);
})
1.3.15

8 years ago

1.3.14

8 years ago

1.3.13

8 years ago

1.3.12

8 years ago

1.3.11

8 years ago

1.3.10

8 years ago

1.3.9

8 years ago

1.3.8

8 years ago

1.3.7

8 years ago

1.3.6

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago