Class: Telescopes

Inherits:
Object
  • Object
show all
Defined in:
lib/astro_calc/telescopes.rb

Overview

Credits Mike Swanson

Constant Summary collapse

MM_IN_INCH =
25.4
RAYLEIGH_LIMIT =
5.5
DAWES_LIMIT =
4.56
UNIT_MILLIMETERS =
:millimeters
UNIT_INCHES =
:inches

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit = UNIT_MILLIMETERS) ⇒ Telescopes

Returns a new instance of Telescopes.



13
14
15
# File 'lib/astro_calc/telescopes.rb', line 13

def initialize(unit = UNIT_MILLIMETERS)
  @unit = unit
end

Instance Attribute Details

#unitObject

Returns the value of attribute unit.



11
12
13
# File 'lib/astro_calc/telescopes.rb', line 11

def unit
  @unit
end

Instance Method Details

#dawes_limit(aperture) ⇒ Float

Calculates the resolving limit of the instrument according to Dawes

Parameters:

  • diameter (Integer)

    the diameter of the telescope tube

Returns:

  • (Float)

    the maximum magnification usable with the given diameter



91
92
93
94
95
96
97
98
# 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) ⇒ Float

Calculates the diameter of the light leaving the eyepiece

Parameters:

  • aperture (Integer)

    the aperture of the telescope tube

  • magnification (Integer)

    the magnification of the instrument

Returns:

  • (Float)

    the diameter of the total light rays



53
54
55
# 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) ⇒ Float

Calculates the maximum probable magnification for a telescope

Parameters:

  • diameter (Integer)

    the diameter of the telescope tube

Returns:

  • (Float)

    the maximum magnification usable with the given diameter



61
62
63
# File 'lib/astro_calc/telescopes.rb', line 61

def exit_pupil_for_telescope(length, ratio)
  exit_pupil = length / ratio
end

#focal_ratio(length, aperture) ⇒ Float

Calculates the focal ration of a telescope

Parameters:

  • length (Integer)

    the focal length of the telescope

  • aperture (Integer)

    the aperture of the telescope tube

Returns:

  • (Float)

    the focal ratio of the instrument



44
45
46
# File 'lib/astro_calc/telescopes.rb', line 44

def focal_ratio(length, aperture)
  ratio = length / aperture
end

#light_gathering_power(large_aperture, small_aperture) ⇒ Float

Calculates the light gathering power between two instruments

Parameters:

  • large_aperture (Integer)

    the aperture of the larger instrument

  • small_aperture (Integer)

    the aperture of the smaller instrument

Returns:

  • (Float)

    the light gathering power of the instrument



105
106
107
# 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) ⇒ Float

Calculates the maximum probable magnification for a telescope

Parameters:

  • aperture (Integer)

    the aperture in centimeters of the telescope tube

Returns:

  • (Float)

    the maximum magnitude with the given aperture



113
114
115
116
117
118
119
120
# 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) ⇒ Float

Calculates the magnification for a given telescope and eyepiece

Parameters:

  • telescope (Integer)

    the focal length of the telescope tube

  • eyepiece (Integer)

    the focal length of the eyepiece

Returns:

  • (Float)

    the magnification of the instrument



22
23
24
# File 'lib/astro_calc/telescopes.rb', line 22

def magnification(telescope, eyepiece)
  magnification = telescope / eyepiece
end

#maximum_magnification(diameter) ⇒ Float

Calculates the maximum probable magnification for a telescope

Parameters:

  • diameter (Integer)

    the diameter of the telescope tube

Returns:

  • (Float)

    the maximum magnification usable with the given diameter



30
31
32
33
34
35
36
37
# 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) ⇒ Float

Calculates the resolving limit of the instrument according to Rayleigh

Parameters:

  • diameter (Integer)

    the diameter of the telescope tube

Returns:

  • (Float)

    the maximum magnification usable with the given diameter



78
79
80
81
82
83
84
85
# 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) ⇒ Float

Calculates the true field of view

Parameters:

  • apparent (Integer)

    the apparent field of view of the eyepiece

  • magnification (Integer)

    the magnification of the telescope and eyepiece

Returns:

  • (Float)

    the true field of view of the instrument



70
71
72
# File 'lib/astro_calc/telescopes.rb', line 70

def true_field_of_view(apparent, magnification)
  tfov = apparent / magnification
end