Builds URLs for consuming USNO's imagery data services. These services provide synthetic views of earth and other selected solar system bodies, e.g.
Installation
Add this line to your application's Gemfile:
gem 'usno-imagery'
And then execute:
$ bundle
Or install it yourself as:
$ gem install usno-imagery
Usage
USNO::Imagery::Earth
The earth namespace will contain classes for viewing USNO's earth images.
# Mercator projection showing day / night (at any given time)
USNO::Imagery::Earth::Map.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/earth.png?view=full&date=11/17/2013&time=1:11"
# A spherical view of Earth as seen from the sun (at any given time)
USNO::Imagery::Earth::Sun.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/earth.png?view=sun&date=11/17/2013&time=1:13"
# A spherical view of Earth as seen from the moon (at any given time)
USNO::Imagery::Earth::Moon.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/earth.png?view=moon&date=11/17/2013&time=1:12"
# Earth at sunrise
USNO::Imagery::Earth::Rise.new.call.data
#=> "http://api.usno.navy.mil/imagery/earth.png?view=rise"
# Earth at sunset
USNO::Imagery::Earth::Set.new.call.data
#=> "http://api.usno.navy.mil/imagery/earth.png?view=set"
Other celestial bodies
Synthetic views of all celestial bodies can be fetched for any time between 1700 & 2100 A.D.
# Our Moon
USNO::Imagery::Moon.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/moon.png?date=11/17/2013&time=1:13"
# Mercury
USNO::Imagery::Mercury.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/mercury.png?date=11/17/2013&time=1:13"
# Venus
USNO::Imagery::Venus.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/venus.png?date=11/17/2013&time=1:13"
# For a radar image of Venus
USNO::Imagery::Venus.new(time: Time.now, radar: true).call.data
#=> "http://api.usno.navy.mil/imagery/venus-radar.png?date=11/17/2013&time=1:13"
# Mars
USNO::Imagery::Mars.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/mars.png?date=11/17/2013&time=1:13"
# Jupiter
USNO::Imagery::Jupiter.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/jupiter.png?date=11/17/2013&time=1:13"
# Jupiter's moon Io
USNO::Imagery::Io.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/io.png?date=11/17/2013&time=1:13"
# Jupiter's moon Europa
USNO::Imagery::Europa.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/europa.png?date=11/17/2013&time=1:13"
# Jupiter's moon Ganymede
USNO::Imagery::Ganymede.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/ganymede.png?date=11/17/2013&time=1:13"
# Jupiter's moon Callisto
USNO::Imagery::Callisto.new(time: Time.now).call.data
#=> "http://api.usno.navy.mil/imagery/callisto.png?date=11/17/2013&time=1:13"
Other USNO libraries
usno-transit provides times of rise, set, and transit for major solar system bodies and selected bright stars. The output table also includes azimuth at rise and set as well as altitude at transit.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request