$:.unshift '.'
require 'solpos'
include Solpos

utc = Time.now.utc
degree = 178.chr


locations = Hash[
  :boston       => [ 42.364361 , -71.005194  , -5   ] , 
  :boulder      => [ 40.039430 , -105.225822 , -7   ] , 
  :los_angeles  => [ 34.071    , -118.370    , -8   ] , 
  :indianapolis => [ 39.75     , -86.33       , -6   ] , 
  :minneapolis  => [ 44.80     , -93.3        , -6   ] , 
  :tokyo        => [ 35.40     , 139.45      , +9   ] , 
  :paris        => [ 49.02     , 2.53        , +1   ] , 
  :calcutta     => [ 22.30     , 88.20       , +5.5 ] , 
]

locations.each do |location, info|
  lat, lon, tzone = info 
  localtime = utc + (tzone * 60 * 60)

  posdata = Posdata.new

  posdata.year      = localtime.year
  posdata.daynum    = localtime.yday
  posdata.hour      = localtime.hour
  posdata.minute    = localtime.min
  posdata.second    = localtime.sec
  posdata.timezone  = tzone
  posdata.latitude  = lat
  posdata.longitude = lon

  Solpos::solpos posdata

  printf "%-16.16s @ %s => %f, %f%s\n", 
    location, localtime, posdata.elevetr, posdata.azim, degree
end
