Module: IERS::EarthRotationAngle

Defined in:
lib/iers/earth_rotation_angle.rb

Class Method Summary collapse

Class Method Details

.at(input = nil, jd: nil, mjd: nil, interpolation: nil) ⇒ Float

Returns Earth Rotation Angle in radians, normalized to [0, 2π).

Parameters:

  • input (Time, Date, DateTime, nil) (defaults to: nil)
  • jd (Float, nil) (defaults to: nil)

    Julian Date

  • mjd (Float, nil) (defaults to: nil)

    Modified Julian Date

  • interpolation (Symbol, nil) (defaults to: nil)

    +:lagrange+ or +:linear+

Returns:

  • (Float)

    Earth Rotation Angle in radians, normalized to [0, 2π)

Raises:



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/iers/earth_rotation_angle.rb', line 25

def at(input = nil, jd: nil, mjd: nil, interpolation: nil)
  query_mjd = TimeScale.to_mjd(input, jd: jd, mjd: mjd)
  ut1_utc = UT1.at(mjd: query_mjd, interpolation: interpolation).ut1_utc

  du = query_mjd - TimeScale::MJD_J2000 +
    ut1_utc / TimeScale::SECONDS_PER_DAY

  # IERS Conventions 2010, eq. 5.15
  turns = ERA_AT_J2000 + ERA_RATE * du
  era = (turns % 1.0) * TWO_PI
  era += TWO_PI if era < 0.0
  era
end