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
- JULIAN_DAY_NUMBER_OFFSET =
0.5
Class Method Summary collapse
Class Method Details
.from_time(time) ⇒ Object
14 15 16 |
# File 'lib/astronoby/epoch.rb', line 14 def self.from_time(time) time.to_datetime.ajd end |
.to_utc(epoch) ⇒ Object
18 19 20 |
# File 'lib/astronoby/epoch.rb', line 18 def self.to_utc(epoch) DateTime.jd(epoch + JULIAN_DAY_NUMBER_OFFSET).to_time.utc end |