class MkGreenwich::Greenwich
Attributes
tdb[R]
tt[R]
ut1[R]
utc[R]
Public Class Methods
new(utc)
click to toggle source
# File lib/mk_greenwich/greenwich.rb, line 5 def initialize(utc) @utc = utc # 協定世界時 t_utc = MkTime.new(@utc.strftime("%Y%m%d%H%M%S")) @tt = t_utc.tt # 地球時(for UTC) @ut1 = t_utc.ut1 # 世界時1(for TT) @tdb = t_utc.tdb # 太陽系力学時(for TT) @jd = t_utc.jd # ユリウス日(for TT) @jc = calc_jc(@jd) # ユリウス世紀数(for TT) @jd_ut1 = MkTime.new(@ut1.strftime("%Y%m%d%H%M%S")).jd # ユリウス日(for UT1) @t = @jd_ut1 - Const::J2000 bpn = EphBpn.new(@tdb.strftime("%Y%m%d%H%M%S")) @r_mtx = bpn.r_bias_prec_nut cc = CipCio.new(@jc) x, y = cc.bpn2xy(@r_mtx) @s = cc.calc_s_06(x, y) @e = EraEors.new(@jd_ut1) end
Public Instance Methods
ee()
click to toggle source
ee_deg()
click to toggle source
ee_hms()
click to toggle source
eo()
click to toggle source
era()
click to toggle source
gast()
click to toggle source
gast_deg()
click to toggle source
gast_hms()
click to toggle source
gmst()
click to toggle source
gmst_deg()
click to toggle source
Private Instance Methods
calc_jc(jd)
click to toggle source
# File lib/mk_greenwich/greenwich.rb, line 166 def calc_jc(jd) return (jd - Const::J2000) / Const::JC rescue => e raise end
deg2hms(deg)
click to toggle source
# File lib/mk_greenwich/greenwich.rb, line 172 def deg2hms(deg) sign = "" begin h = (deg / 15.0).truncate _m = (deg - h * 15.0) * 4.0 m = _m.truncate s = (_m - m) * 60.0 if s < 0 s *= -1 sign = "-" end return sprintf("%s%d h %02d m %06.3f s", sign, h, m, s) rescue => e raise end end