Class: Telescopes
- Inherits:
-
Object
- Object
- Telescopes
- 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
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#dawes_limit(aperture) ⇒ Float
Calculates the resolving limit of the instrument according to Dawes.
-
#exit_pupil_for_binoculars(aperture, magnification) ⇒ Float
Calculates the diameter of the light leaving the eyepiece.
-
#exit_pupil_for_telescope(length, ratio) ⇒ Float
Calculates the maximum probable magnification for a telescope.
-
#focal_ratio(length, aperture) ⇒ Float
Calculates the focal ration of a telescope.
-
#initialize(unit = UNIT_MILLIMETERS) ⇒ Telescopes
constructor
A new instance of Telescopes.
-
#light_gathering_power(large_aperture, small_aperture) ⇒ Float
Calculates the light gathering power between two instruments.
-
#limiting_magnitude(aperture) ⇒ Float
Calculates the maximum probable magnification for a telescope.
-
#magnification(telescope, eyepiece) ⇒ Float
Calculates the magnification for a given telescope and eyepiece.
-
#maximum_magnification(diameter) ⇒ Float
Calculates the maximum probable magnification for a telescope.
-
#rayleigh_limit(aperture) ⇒ Float
Calculates the resolving limit of the instrument according to Rayleigh.
-
#true_field_of_view(apparent, magnification) ⇒ Float
Calculates the true field of view.
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
#unit ⇒ Object
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
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
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
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
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
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
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
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
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
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
70 71 72 |
# File 'lib/astro_calc/telescopes.rb', line 70 def true_field_of_view(apparent, magnification) tfov = apparent / magnification end |