Class: MkApos::Apos
Instance Attribute Summary collapse
-
#jd_tdb ⇒ Object
readonly
Returns the value of attribute jd_tdb.
-
#tdb ⇒ Object
readonly
Returns the value of attribute tdb.
-
#utc ⇒ Object
readonly
Returns the value of attribute utc.
Instance Method Summary collapse
-
#initialize(bin_path, utc) ⇒ Apos
constructor
A new instance of Apos.
-
#moon ⇒ Object
MOON.
-
#sun ⇒ Object
SUN.
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 19 20 21 22 23 |
# 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 # === 太陽/月/地球の半径取得 e = EphJpl.new(@bin_path, 11, 3, @jd_tdb) @asun = e.bin[:cvals][e.bin[:cnams].index("ASUN")] @am = e.bin[:cvals][e.bin[:cnams].index("AM")] @re = e.bin[:cvals][e.bin[:cnams].index("RE")] end |
Instance Attribute Details
#jd_tdb ⇒ Object (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 |
#tdb ⇒ Object (readonly)
Returns the value of attribute tdb.
3 4 5 |
# File 'lib/mk_apos/apos.rb', line 3 def tdb @tdb end |
#utc ⇒ Object (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
#moon ⇒ Object
MOON
@param: <none> @return: [[lambda, beta, d], [alpha, delta, d], [apparent_radius, parallax]]
(月視黄経、視黄緯、地心距離、視赤経、視赤緯、地心距離、視半径、視差))
43 44 45 |
# File 'lib/mk_apos/apos.rb', line 43 def moon return compute_moon end |
#sun ⇒ Object
SUN
@param: <none> @return: [[lambda, beta, d], [alpha, delta, d], [apparent_radius, parallax]]
(太陽視黄経、視黄緯、地心距離、視赤経、視赤緯、地心距離、視半径、視差))
32 33 34 |
# File 'lib/mk_apos/apos.rb', line 32 def sun return compute_sun end |