Class: Astronoby::Epoch
- Inherits:
-
Object
- Object
- Astronoby::Epoch
- Defined in:
- lib/astronoby/epoch.rb
Constant Summary collapse
- B1900 =
2415020.3135
- J1900 =
2415020.0
- B1950 =
2433282.4235
- J1950 =
2433282.5
- J2000 =
2451545.0
- DEFAULT_EPOCH =
J2000
- DAYS_PER_JULIAN_CENTURY =
36525.0
- JULIAN_DAY_NUMBER_OFFSET =
0.5
Class Method Summary collapse
Class Method Details
.from_time(time) ⇒ Object
16 17 18 |
# File 'lib/astronoby/epoch.rb', line 16 def self.from_time(time) time.to_datetime.ajd end |
.to_utc(epoch) ⇒ Object
20 21 22 |
# File 'lib/astronoby/epoch.rb', line 20 def self.to_utc(epoch) DateTime.jd(epoch + JULIAN_DAY_NUMBER_OFFSET).to_time.utc end |