NDBC Buoy Meteorological Data Request

The NDBC keeps a 45-day recent rolling file for each buoy. This examples shows how to access the basic meteorological data from a buoy and make a simple plot.

import matplotlib.pyplot as plt

from siphon.simplewebservice.ndbc import NDBC

Get a pandas data frame of all of the observations, meteorological data is the default observation set to query.

wind_direction wind_speed wind_gust wave_height dominant_wave_period average_wave_period dominant_wave_direction pressure air_temperature water_temperature dewpoint visibility 3hr_pressure_tendency water_level_above_mean time
0 290.0 13.0 17.0 2.6 12.0 7.0 289.0 1008.1 8.7 12.2 5.7 NaN NaN NaN 2025-03-11 16:20:00+00:00
1 280.0 12.0 17.0 NaN NaN NaN NaN 1008.0 9.8 12.2 5.9 NaN NaN NaN 2025-03-11 16:10:00+00:00
2 290.0 10.0 12.0 NaN NaN NaN NaN 1007.9 9.7 12.2 5.7 NaN -2.1 NaN 2025-03-11 16:00:00+00:00
3 280.0 9.0 12.0 2.7 11.0 6.9 300.0 1007.9 9.4 12.2 6.0 NaN NaN NaN 2025-03-11 15:50:00+00:00
4 280.0 11.0 15.0 2.7 NaN 6.9 300.0 1008.2 9.2 12.2 6.1 NaN NaN NaN 2025-03-11 15:40:00+00:00


Let’s make a simple time series plot to checkout what the data look like.

fig, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(12, 10))
ax2b = ax2.twinx()

# Pressure
ax1.plot(df['time'], df['pressure'], color='black')
ax1.set_ylabel('Pressure [hPa]')

# Wind speed, gust, direction
ax2.plot(df['time'], df['wind_speed'], color='tab:orange')
ax2.plot(df['time'], df['wind_gust'], color='tab:olive', linestyle='--')
ax2b.plot(df['time'], df['wind_direction'], color='tab:blue', linestyle='-')
ax2.set_ylabel('Wind Speed [m/s]')
ax2b.set_ylabel('Wind Direction')

# Water temperature
ax3.plot(df['time'], df['water_temperature'], color='tab:brown')
ax3.set_ylabel('Water Temperature [degC]')

plt.show()
buoy met request

Total running time of the script: (0 minutes 0.577 seconds)

Gallery generated by Sphinx-Gallery