class Telescopes

Credits {www.nexstarsite.com/_RAC/articles/formulas.htm Mike Swanson}

Constants

DAWES_LIMIT
MM_IN_INCH
RAYLEIGH_LIMIT
UNIT_INCHES
UNIT_MILLIMETERS

Attributes

unit[RW]

Public Class Methods

new(unit = UNIT_MILLIMETERS) click to toggle source
# File lib/astro_calc/telescopes.rb, line 13
def initialize(unit = UNIT_MILLIMETERS)
  @unit = unit
end

Public Instance Methods

dawes_limit(aperture) click to toggle source

Calculates the resolving limit of the instrument according to Dawes

@param diameter [Integer] the diameter of the telescope tube @return [Float] the maximum magnification usable with the given diameter

# File lib/astro_calc/telescopes.rb, line 91
def dawes_limit(aperture)
  case @unit
  when UNIT_MILLIMETERS 
    limit = DAWES_LIMIT  / aperture / MM_IN_INCH
  when UNIT_INCHES      
    limit = DAWES_LIMIT  / aperture
  end    
end
exit_pupil_for_binoculars(aperture, magnification) click to toggle source

Calculates the diameter of the light leaving the eyepiece

@param aperture [Integer] the aperture of the telescope tube @param magnification [Integer] the magnification of the instrument @return [Float] the diameter of the total light rays

# File lib/astro_calc/telescopes.rb, line 53
def exit_pupil_for_binoculars(aperture, magnification)
  exit_pupil = aperture / magnification
end
exit_pupil_for_telescope(length, ratio) click to toggle source

Calculates the maximum probable magnification for a telescope

@param diameter [Integer] the diameter of the telescope tube @return [Float] the maximum magnification usable with the given diameter

# File lib/astro_calc/telescopes.rb, line 61
def exit_pupil_for_telescope(length, ratio)
  exit_pupil = length / ratio
end
focal_ratio(length, aperture) click to toggle source

Calculates the focal ration of a telescope

@param length [Integer] the focal length of the telescope @param aperture [Integer] the aperture of the telescope tube @return [Float] the focal ratio of the instrument

# File lib/astro_calc/telescopes.rb, line 44
def focal_ratio(length, aperture)
  ratio = length / aperture
end
light_gathering_power(large_aperture, small_aperture) click to toggle source

Calculates the light gathering power between two instruments

@param large_aperture [Integer] the aperture of the larger instrument @param small_aperture [Integer] the aperture of the smaller instrument @return [Float] the light gathering power of the instrument

# File lib/astro_calc/telescopes.rb, line 105
def light_gathering_power(large_aperture, small_aperture)
  power =  (large_aperture * large_aperture) / (small_aperture * small_aperture)
end
limiting_magnitude(aperture) click to toggle source

Calculates the maximum probable magnification for a telescope

@param aperture [Integer] the aperture in centimeters of the telescope tube @return [Float] the maximum magnitude with the given aperture

# File lib/astro_calc/telescopes.rb, line 113
def limiting_magnitude(aperture)
  case @unit
  when UNIT_MILLIMETERS 
    limit = 5 * Math::log10(aperture * 10) + 7.5
  when UNIT_INCHES      
    limit = 5 * Math::log10(aperture / 2.54) + 7.5
  end        
end
magnification(telescope, eyepiece) click to toggle source

Calculates the magnification for a given telescope and eyepiece

@param telescope [Integer] the focal length of the telescope tube @param eyepiece [Integer] the focal length of the eyepiece @return [Float] the magnification of the instrument

# File lib/astro_calc/telescopes.rb, line 22
def magnification(telescope, eyepiece)
  magnification = telescope / eyepiece
end
maximum_magnification(diameter) click to toggle source

Calculates the maximum probable magnification for a telescope

@param diameter [Integer] the diameter of the telescope tube @return [Float] the maximum magnification usable with the given diameter

# File lib/astro_calc/telescopes.rb, line 30
def maximum_magnification(diameter)
  case @unit 
  when UNIT_MILLIMETERS
    maximum = diameter * 2
  when UNIT_INCHES
    maximum = diameter * 2 / MM_IN_INCH
  end
end
rayleigh_limit(aperture) click to toggle source

Calculates the resolving limit of the instrument according to Rayleigh

@param diameter [Integer] the diameter of the telescope tube @return [Float] the maximum magnification usable with the given diameter

# File lib/astro_calc/telescopes.rb, line 78
def rayleigh_limit(aperture)
  case @unit
  when UNIT_MILLIMETERS 
    limit = RAYLEIGH_LIMIT  / aperture / MM_IN_INCH
  when UNIT_INCHES      
    limit = RAYLEIGH_LIMIT  / aperture
  end    
end
true_field_of_view(apparent, magnification) click to toggle source

Calculates the true field of view

@param apparent [Integer] the apparent field of view of the eyepiece @param magnification [Integer] the magnification of the telescope and eyepiece @return [Float] the true field of view of the instrument

# File lib/astro_calc/telescopes.rb, line 70
def true_field_of_view(apparent, magnification)
  tfov = apparent / magnification
end