mk_apos 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5aec6b75740e22d2c7100f319dc71369609c23f6
4
- data.tar.gz: 194418ed217b4b657be08dbfca45a3f5ba19167f
2
+ SHA256:
3
+ metadata.gz: 837c66b936249ba907cbe6718b49c249c88db3407bfcf0a95598bbe5e86d9be1
4
+ data.tar.gz: 28237ce6ea17a306c287fa22ae55618d5cf30d7d07d4bd73c797febddbcbc0c7
5
5
  SHA512:
6
- metadata.gz: 2214911afab0f5900c0d8cda039de3de463611bed6c87ab2c279e83b7eafd8d4c4da8822b72ca22ed774b0a98546ffd140f14a72abbc8f96509cb340f60da425
7
- data.tar.gz: b9ed0e8a9e15908fe4d464447363fd0f80ce0cd6297a678ec8dfa7aba72d4a4be8beff379c4cea4eaa99949a32c33d34cf4a2d1f290c57c02193ce5cd1dfb7b7
6
+ metadata.gz: 62e2d6e5413d502778b9ba5ac9816f51b96f599b46964545508c2b9ade0c1ea12c0de15d65f080b235b66b3559f126d0daed8ddf66766b34bbb0c386f7802070
7
+ data.tar.gz: a8594715220b2a773b09d53b9dc5451e8d6c40211fa570a4c17da315de55667693d1e36d9eb88e8eee1bfa805a6470a69265963471f5ab5ff41d7e914f503ae2
@@ -15,13 +15,19 @@ module MkApos
15
15
  Const::BODIES.each { |k, v| @icrs_2[k] = get_icrs(v, @jd_tdb) }
16
16
  # === 時刻 t2(= TDB) における地球と太陽・月の距離
17
17
  @r_e = get_r_e
18
+ # === 太陽/月/地球の半径取得
19
+ e = EphJpl.new(@bin_path, 11, 3, @jd_tdb)
20
+ @asun = e.bin[:cvals][e.bin[:cnams].index("ASUN")]
21
+ @am = e.bin[:cvals][e.bin[:cnams].index("AM")]
22
+ @re = e.bin[:cvals][e.bin[:cnams].index("RE")]
18
23
  end
19
24
 
20
25
  #=========================================================================
21
26
  # SUN
22
27
  #
23
28
  # @param: <none>
24
- # @return: [lambda, beta, d] (太陽視黄経、視黄緯、地心距離)
29
+ # @return: [[lambda, beta, d], [alpha, delta, d], [apparent_radius, parallax]]
30
+ # (太陽視黄経、視黄緯、地心距離、視赤経、視赤緯、地心距離、視半径、視差))
25
31
  #=========================================================================
26
32
  def sun
27
33
  return compute_sun
@@ -31,7 +37,8 @@ module MkApos
31
37
  # MOON
32
38
  #
33
39
  # @param: <none>
34
- # @return: [alpha, delta] (月視黄経、視黄緯、地心距離)
40
+ # @return: [[lambda, beta, d], [alpha, delta, d], [apparent_radius, parallax]]
41
+ # (月視黄経、視黄緯、地心距離、視赤経、視赤緯、地心距離、視半径、視差))
35
42
  #=========================================================================
36
43
  def moon
37
44
  return compute_moon
@@ -82,7 +82,7 @@ module MkApos
82
82
  # 視黄経・視黄緯の計算(太陽)
83
83
  #
84
84
  # @param: <none>
85
- # @return: [[視赤経, 視赤緯, 地心距離], [視黄経, 視黄緯, 地心距離]]
85
+ # @return: [[視赤経, 視赤緯, 地心距離], [視黄経, 視黄緯, 地心距離], [視半径, 視差]]
86
86
  #=========================================================================
87
87
  def compute_sun
88
88
  # === 太陽が光を発した時刻 t1(JD) の計算
@@ -101,7 +101,12 @@ module MkApos
101
101
  eq_pol_s = MkCoord.rect2pol(pos_sun_bpn)
102
102
  ec_rect_s = MkCoord.rect_eq2ec(pos_sun_bpn, bpn.eps)
103
103
  ec_pol_s = MkCoord.rect2pol(ec_rect_s)
104
- return [eq_pol_s, ec_pol_s]
104
+ # === 視半径/(地平)視差計算
105
+ radius = Math.asin(@asun / (eq_pol_s[2] * Const::AU / 1000))
106
+ radius *= 180 / Math::PI * 3600
107
+ parallax = Math.asin(@re / (eq_pol_s[2] * Const::AU / 1000))
108
+ parallax *= 180 / Math::PI * 3600
109
+ return [eq_pol_s, ec_pol_s, [radius, parallax]]
105
110
  rescue => e
106
111
  raise
107
112
  end
@@ -110,7 +115,7 @@ module MkApos
110
115
  # 視黄経・視黄緯の計算(月)
111
116
  #
112
117
  # @param: <none>
113
- # @return: [[視赤経, 視赤緯, 地心距離], [視黄経, 視黄緯, 地心距離]]
118
+ # @return: [[視赤経, 視赤緯, 地心距離], [視黄経, 視黄緯, 地心距離], [視半径, 視差]]
114
119
  #=========================================================================
115
120
  def compute_moon
116
121
  # === 月が光を発した時刻 t1(jd) の計算
@@ -129,7 +134,12 @@ module MkApos
129
134
  eq_pol_m = MkCoord.rect2pol(pos_moon_bpn)
130
135
  ec_rect_m = MkCoord.rect_eq2ec(pos_moon_bpn, bpn.eps)
131
136
  ec_pol_m = MkCoord.rect2pol(ec_rect_m)
132
- return [eq_pol_m, ec_pol_m]
137
+ # === 視半径/(地平)視差計算
138
+ radius = Math.asin(@am / (eq_pol_m[2] * Const::AU / 1000))
139
+ radius *= 180 / Math::PI * 3600
140
+ parallax = Math.asin(@re / (eq_pol_m[2] * Const::AU / 1000))
141
+ parallax *= 180 / Math::PI * 3600
142
+ return [eq_pol_m, ec_pol_m, [radius, parallax]]
133
143
  rescue => e
134
144
  raise
135
145
  end
@@ -1,3 +1,3 @@
1
1
  module MkApos
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mk_apos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - komasaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-06 00:00:00.000000000 Z
11
+ date: 2018-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eph_bpn
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.6.8
157
+ rubygems_version: 2.7.7
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Apparent position calculation tool.