Coder Social home page Coder Social logo

weather-forecasts's Introduction

Weather Forecasts for Ruby

Gem Version Build Status Dependency Status Code Climate

Summary

This library provides API client access to NOAA's NDFD database for access to weather forecast information via Ruby.

NDFD Features

You can see the available forecast information that is accessible via the API on the NDFD technical description page.

In general, you can get the following:

  • Specific forecast dimensions (min/max temperature, wind speed, etc.) out to 168 hours.
  • Climate outlook probabilities (estimated averages/totals of temperature and precipitation)
  • Convective Outlook Hazard Probabilities (hazard outlook, tornadoes, etc.)
  • Probabilistic Tropical Cyclone Surface Wind Speed (measured in knots)

Client Features

The client offers a easy to use query interface and will hand back data to you in hashes, arrays and XML documents. Validates requests and data types on execution of requests (will raise contextual errors on poorly formed data in queries)

Runtime Dependencies

Ruby versions supported:

  • 2.1.x
  • 2.0.x
  • 1.9.3

Ruby versions not supported (but will be):

  • JRuby 1.7+
  • Rubinius 2.2+

Ruby versions that will not be supported:

  • <= 1.9.2 (including REE)

Libraries used:

  • savon (for SOAP support)
  • activesupport (for TimeWithZone support)
  • nokogiri (for XML/XSLT parsing)
  • httpi (for interfacing with http clients)
  • http_logger (for controlling logging output from savon)

Installation

gem install weather-forecasts

Usage

WeatherForecasts.client is the top-level start point from whence all API calls are executed.

Most calls follow the form of:

WeatherForecasts.client.
      select(:maxt, :mint, :temp, etc.).
      where(conditions).
      execute

This will return an Array or Hash containing the data from the response depending on the type of the request.

NOTE: Dates and times passed to the where must be ActiveSupport::TimeWithZone objects.

NOTE: NDFDgen and NDFDgenByDay are not implemented in favor of using the equivalent collection-based functions.

NOTE: GmlLatLonList, GmlTimeSeries are not implemented because of their limited use (and my inability to figure out what parameters to use to make a valid request). It appears to be discontinued.

Query Method API server function Description
select_hourly DigitalDWML from tabular data feed on [NWS](http://www.weather.gov/) Returns a Hash of hourly (1-hour) forecast metrics for a single latitude/longitude out to 7 days.
select NDFDgenLatLonList Returns a Hash of forecast metrics for multiple latitudes/longitudes.
select_by_days NDFDgenByDayLatLonList Returns a Hash of forecast metrics for multiple latitudes/longitudes in a 24/12 hour period for a number of days.
select_coordinates_by_zip LatLonListZipCode Returns a Hash of latitudes/longitudes for every zip code requested.
select_coordinates_by_cities LatLonListCityNames Returns a Hash of latitudes/longitudes for a pre-defined set of cities.
select_square_coordinates LatLonListSquare Returns a Array of latitudes/longitudes for the requested rectangular area.
select_gridpoint_coordinates LatLonListSubgrid Returns a Array of latitudes/longitudes for the requested subgrid.
select_linepoint_coordinates LatLonListLine Returns a Array of latitudes/longitudes between a start and end coordinate.
select_corner_coordinates CornerPoints Returns a Array of latitudes/longitudes of the corners of one of the NDFD grids.

To see a description of the NDFD Spatial Reference System (used for collecting lat/longs in an area) http://graphical.weather.gov/docs/ndfdSRS.htm

To see more detailed documention, view the API Documentation

weather-forecasts's People

Contributors

alakra avatar bitdeli-chef avatar rrrene avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

tra rrrene

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.