Class: MkApos::Apos

Inherits:
Object
  • Object
show all
Includes:
Compute
Defined in:
lib/mk_apos/apos.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Compute

calc_dist, calc_pos, calc_t1, calc_unit_vector, calc_velocity, compute_moon, compute_sun, conv_lorentz, get_icrs, get_jd, get_r_e, inner_prod, utc2tdb

Constructor Details

#initialize(bin_path, utc) ⇒ Apos

Returns a new instance of Apos.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/mk_apos/apos.rb', line 6

def initialize(bin_path, utc)
  @bin_path, @utc = bin_path, utc
  # === t1(= TDB), t2(= TDB) における位置・速度(ICRS 座標)用Hash
  @icrs_1, @icrs_2 = Hash.new, Hash.new
  # === 時刻 t2 の変換(UTC(協定世界時) -> TDB(太陽系力学時))
  @tdb = utc2tdb(@utc)
  # === 時刻 t2 のユリウス日
  @jd_tdb = get_jd(@tdb)
  # === 時刻 t2(= TDB) におけるの位置・速度(ICRS 座標)の計算 (地球, 月, 太陽)
  Const::BODIES.each { |k, v| @icrs_2[k] = get_icrs(v, @jd_tdb) }
  # === 時刻 t2(= TDB) における地球と太陽・月の距離
  @r_e = get_r_e
end

Instance Attribute Details

#jd_tdbObject (readonly)

Returns the value of attribute jd_tdb.



3
4
5
# File 'lib/mk_apos/apos.rb', line 3

def jd_tdb
  @jd_tdb
end

#tdbObject (readonly)

Returns the value of attribute tdb.



3
4
5
# File 'lib/mk_apos/apos.rb', line 3

def tdb
  @tdb
end

#utcObject (readonly)

Returns the value of attribute utc.



3
4
5
# File 'lib/mk_apos/apos.rb', line 3

def utc
  @utc
end

Instance Method Details

#moonObject

MOON

@param: <none> @return: [alpha, delta] (月視黄経、視黄緯、地心距離)



36
37
38
# File 'lib/mk_apos/apos.rb', line 36

def moon
  return compute_moon
end

#sunObject

SUN

@param: <none> @return: [lambda, beta, d] (太陽視黄経、視黄緯、地心距離)



26
27
28
# File 'lib/mk_apos/apos.rb', line 26

def sun
  return compute_sun
end