class Asterank::API::Skymorph

Attributes

results[R]

Public Class Methods

new() click to toggle source
# File lib/asterank-ruby/api/skymorph.rb, line 8
def initialize
  @results = nil
end

Public Instance Methods

image(key, filename, fast = true) click to toggle source
# File lib/asterank-ruby/api/skymorph.rb, line 28
def image(key, filename, fast = true)
  if fast
    endpoint = '/fast_image'
  else
    endpoint = '/image'
  end
  @results = self.class.get(endpoint, query: {key: key})
  File.open(filename, 'wb') {|f| f.write @results.parsed_response }
end
search_orbit(params) click to toggle source
# File lib/asterank-ruby/api/skymorph.rb, line 20
def search_orbit(params)
  @results = self.class.get('/search_orbit', query: cleanup_orbit_params(params))
end
search_position() click to toggle source
# File lib/asterank-ruby/api/skymorph.rb, line 24
def search_position
  @results = self.class.get('/search_orbit', query: cleanup_position_params(params))
end

Private Instance Methods

cleanup_orbit_params(params) click to toggle source
# File lib/asterank-ruby/api/skymorph.rb, line 39
def cleanup_orbit_params(params)
  params.slice(
      :ecc,
      :epoch,
      :per,
      :per_date,
      :om,
      :w,
      :i,
      :H
    )
end
cleanup_position_params(params) click to toggle source
# File lib/asterank-ruby/api/skymorph.rb, line 52
def cleanup_position_params(params)
  params.slice(
    :ra,
    :Dec,
    :time,
    :per_date,
    :om,
    :w,
    :i,
    :H 
  )
  
end