class Forecaster::Configuration

Configure how to fetch and read from a forecast file.

Attributes

cache_dir[RW]
curl_path[RW]
records[RW]
server[RW]
wgrib2_path[RW]

Public Class Methods

configure(options) click to toggle source
# File lib/forecaster/configuration.rb, line 25
def self.configure(options)
  options.each do |option, value|
    self[option] = value
  end
end
new() click to toggle source
# File lib/forecaster/configuration.rb, line 7
def initialize
  @server = "http://www.ftp.ncep.noaa.gov/data/nccf/com/gfs/prod"
  @cache_dir = "/tmp/forecaster"
  @wgrib2_path = "wgrib2"

  # See: http://www.nco.ncep.noaa.gov/pmb/products/gfs/gfs_upgrade/gfs.t06z.pgrb2.0p25.f006.shtml
  # See: http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
  # Use `variable` and `level` attributes separated by colons to identify
  # the records to download and read.
  @records = {
    :prate => ":PRATE:surface:",
    :tmp   => ":TMP:2 m above ground:",
    :ugrd  => ":UGRD:10 m above ground:",
    :vgrd  => ":VGRD:10 m above ground:",
    :tcdc  => ":TCDC:entire atmosphere:"
  }
end