Class: Astronoby::GreenwichApparentSiderealTime
- Inherits:
-
GreenwichSiderealTime
- Object
- SiderealTime
- GreenwichSiderealTime
- Astronoby::GreenwichApparentSiderealTime
- Defined in:
- lib/astronoby/time/greenwich_apparent_sidereal_time.rb
Overview
Greenwich Apparent Sidereal Time (GAST). Derived from GMST by applying the equation of the equinoxes (nutation correction).
Constant Summary
Constants inherited from SiderealTime
Instance Attribute Summary
Attributes inherited from SiderealTime
Class Method Summary collapse
-
.from_utc(utc) ⇒ Astronoby::GreenwichApparentSiderealTime
Creates GAST from UTC by computing GMST and applying the equation of the equinoxes.
Instance Method Summary collapse
-
#initialize(date:, time:) ⇒ GreenwichApparentSiderealTime
constructor
A new instance of GreenwichApparentSiderealTime.
Methods inherited from GreenwichSiderealTime
apparent_from_utc, mean_from_utc, #to_lst, #to_utc
Methods inherited from SiderealTime
#apparent?, #mean?, normalize_time, #normalize_time, validate_type!
Constructor Details
#initialize(date:, time:) ⇒ GreenwichApparentSiderealTime
Returns a new instance of GreenwichApparentSiderealTime.
27 28 29 |
# File 'lib/astronoby/time/greenwich_apparent_sidereal_time.rb', line 27 def initialize(date:, time:) super(date: date, time: time, type: APPARENT) end |
Class Method Details
.from_utc(utc) ⇒ Astronoby::GreenwichApparentSiderealTime
Creates GAST from UTC by computing GMST and applying the equation of the equinoxes.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/astronoby/time/greenwich_apparent_sidereal_time.rb', line 12 def self.from_utc(utc) gmst = GreenwichMeanSiderealTime.from_utc(utc) instant = Instant.from_time(utc) nutation = Nutation.new(instant: instant) mean_obliquity = MeanObliquity.at(instant) equation_of_equinoxes = nutation.nutation_in_longitude.hours * mean_obliquity.cos gast_time = normalize_time(gmst.time + equation_of_equinoxes) new(date: gmst.date, time: gast_time) end |