How to use the siphon.simplewebservice.ndbc.NDBC function in siphon

To help you get started, we’ve selected a few siphon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Unidata / siphon / dev / _downloads / 94ea07e3752cae6a77f64f43a5455c2f / latest_request.py View on Github external
NDBC Latest Data Request
========================

This example shows how to use siphon's `simplewebswervice` support query the most recent
observations from all of the NDBC buoys at once.
"""

import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt

from siphon.simplewebservice.ndbc import NDBC

####################################################
# Get a pandas data frame of all of the observations
df = NDBC.latest_observations()
df.head()

####################################################
# In this case I'm going to drop buoys that do not have water temperature measurements.
df.dropna(subset=['water_temperature'], inplace=True)

####################################################
# Let's make a simple plot of the buoy positions and color by water temperature
proj = ccrs.LambertConformal(central_latitude=45., central_longitude=-100.,
                             standard_parallels=[30, 60])

fig = plt.figure(figsize=(17., 11.))
ax = plt.axes(projection=proj)
ax.coastlines('50m', edgecolor='black')
ax.add_feature(cfeature.OCEAN.with_scale('50m'))
ax.add_feature(cfeature.LAND.with_scale('50m'))
github Unidata / siphon / dev / _downloads / ac4bdcca50f8a28913d465ae3f45ea26 / buoy_type_request.py View on Github external
# Copyright (c) 2018 Siphon Contributors.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
NDBC Buoy Data Request (of any type)
====================================

The NDBC keeps a 40-day recent rolling file for each buoy. This examples shows how to access
the other types of data available for a buoy.
"""

from siphon.simplewebservice.ndbc import NDBC

####################################################
# Request the types of data available from a given buoy.
data_aval = NDBC.buoy_data_types('41002')
print(data_aval)

####################################################
# Get a pandas data frame of all of the observations, meteorological data is the default
# observation set to query.
df = NDBC.realtime_observations('41002', data_type='supl')
df.head()
github Unidata / siphon / siphon / simplewebservice / ndbc.py View on Github external
def __init__(self):
        """Set up endpoint."""
        super(NDBC, self).__init__('https://www.ndbc.noaa.gov/')