eph_bpn 0.1.1 → 0.1.2

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
2
  SHA1:
3
- metadata.gz: 0d37575850f490a07120adab907b267cf602104f
4
- data.tar.gz: 5ca94950a2bd3d28a6487fc731e8608b4895cd58
3
+ metadata.gz: 82ade37ba8efd0aa1c294324fddc96d79229a5cf
4
+ data.tar.gz: b4b1b3d03b1f41edc3f7596270100a1a88cc9f38
5
5
  SHA512:
6
- metadata.gz: 6dd46b12e43ed9a38f98e70c43b94c0d1ef5c6e54fa0b29cbc4ce37763596063c785587b27f20e2d8e169b11e4f92340fcca0f0111866f32d4b2f8e2eef13ca1
7
- data.tar.gz: 03b649e1f06eee7c89ac8f0bfd12dfa7f33f343a2fbeb74f36db01d83a592060d59eb5a18b12a8753d45899e5f39d3ced6e78e1415a71f851e085da2f69fc880
6
+ metadata.gz: 4c885105a0264105eb4ce7143e65f6a76894ebda64c1666cd0d75298d2fc2bc0bd9ab03581be55937d5a2028c1d6dc291d83ecffdfb6de1e4f48915f0df9a08f
7
+ data.tar.gz: 9477203afe7ff658c6529fb2c00058cc553942cc746f8e0697c986754930aeb9b8c7ed771ef1b0a91cf44520762b77003135c026b3a99d2e615c92235f01e9db
data/README.md CHANGED
@@ -24,6 +24,8 @@ Or install it yourself as:
24
24
 
25
25
  ### Instantiation
26
26
 
27
+ require 'eph_bpn'
28
+
27
29
  e = EphBpn.new("20160723")
28
30
  e = EphBpn.new("20160723123456")
29
31
  e = EphBpn.new
@@ -33,18 +35,20 @@ Or install it yourself as:
33
35
 
34
36
  ### Calculation
35
37
 
36
- r_i = [-0.50787065, 0.80728228, 0.34996714] # ICRS Coordinate
37
- r_b = e.apply_bias(r_i) # Apply Bias
38
- r_p = e.apply_prec(r_b) # Apply Precession
39
- r_n = e.apply_nut(r_p) # Apply Nutation
40
- puts "TDB: #{e.tdb}" #=> TDB: 2016-07-23 00:00:00 +0000
41
- puts " JD: #{e.jd}" #=> JD: 2457592.5
42
- puts " JC: #{e.jc}" #=> JC: 0.16557152635181382
43
- puts "EPS: #{e.eps}" #=> EPS: 0.40905500411767176
44
- p r_i #=> [-0.50787065, 0.80728228, 0.34996714]
45
- p r_b #=> [-0.5078706789483137, 0.8072822556207571, 0.34996715422685276]
46
- p r_p #=> [-0.5114184398597698, 0.8053953379861463, 0.3491472536549302]
47
- p r_n #=> [-0.5114184385245731, 0.8053953403876852, 0.3491472500709293]
38
+ pos_g = [-0.50787065, 0.80728228, 0.34996714] # GCRS Coordinate
39
+ pos_b = e.apply_bias(pos_g) # Apply Bias
40
+ pos_p = e.apply_prec(pos_b) # Apply Precession
41
+ pos_n = e.apply_nut(pos_p) # Apply Nutation
42
+ pos_bp = e.apply_bias_prec(pos_g) # Apply Bias + Precession
43
+ puts "TDB: #{e.tdb}" #=> TDB: 2016-07-23 00:00:00 +0000
44
+ puts " JD: #{e.jd}" #=> JD: 2457592.5
45
+ puts " JC: #{e.jc}" #=> JC: 0.16557152635181382
46
+ puts "EPS: #{e.eps}" #=> EPS: 0.40905500411767176
47
+ p pos_g #=> [-0.50787065, 0.80728228, 0.34996714]
48
+ p pos_b #=> [-0.507870315369686, 0.8072824634004779, 0.34996720255697145]
49
+ p pos_p #=> [-0.5114180771311418, 0.8053955471104202, 0.34914730256926324]
50
+ p pos_n #=> [-0.5114180757959449, 0.8053955495119587, 0.34914729898526137]
51
+ p pos_bp #=> [-0.5114184398598124, 0.805395337986056, 0.3491472536550768]
48
52
 
49
53
  ## Development
50
54
 
data/exe/eph_bpn CHANGED
@@ -3,16 +3,18 @@
3
3
  require "eph_bpn"
4
4
 
5
5
  e = EphBpn.new(ARGV[0])
6
- r_i = [-0.50787065, 0.80728228, 0.34996714] # ICRS Coordinate
7
- r_b = e.apply_bias(r_i) # Apply Bias
8
- r_p = e.apply_prec(r_b) # Apply Precession
9
- r_n = e.apply_nut(r_p) # Apply Nutation
10
- puts "TDB: #{e.tdb}" #=> TDB: 2016-07-23 00:00:00 +0000
11
- puts " JD: #{e.jd}" #=> JD: 2457592.5
12
- puts " JC: #{e.jc}" #=> JC: 0.16557152635181382
13
- puts "EPS: #{e.eps}" #=> EPS: 0.40905500411767176
14
- p r_i #=> [-0.50787065, 0.80728228, 0.34996714]
15
- p r_b #=> [-0.5078706789483137, 0.8072822556207571, 0.34996715422685276]
16
- p r_p #=> [-0.5114184398597698, 0.8053953379861463, 0.3491472536549302]
17
- p r_n #=> [-0.5114184385245731, 0.8053953403876852, 0.3491472500709293]
6
+ pos_g = [-0.50787065, 0.80728228, 0.34996714] # GCRS Coordinate
7
+ pos_b = e.apply_bias(pos_g) # Apply Bias
8
+ pos_p = e.apply_prec(pos_b) # Apply Precession
9
+ pos_n = e.apply_nut(pos_p) # Apply Nutation
10
+ pos_bp = e.apply_bias_prec(pos_g) # Apply Bias + Precession
11
+ puts "TDB: #{e.tdb}" #=> TDB: 2016-07-23 00:00:00 +0000
12
+ puts " JD: #{e.jd}" #=> JD: 2457592.5
13
+ puts " JC: #{e.jc}" #=> JC: 0.16557152635181382
14
+ puts "EPS: #{e.eps}" #=> EPS: 0.40905500411767176
15
+ p pos_g #=> [-0.50787065, 0.80728228, 0.34996714]
16
+ p pos_b #=> [-0.507870315369686, 0.8072824634004779, 0.34996720255697145]
17
+ p pos_p #=> [-0.5114180771311418, 0.8053955471104202, 0.34914730256926324]
18
+ p pos_n #=> [-0.5114180757959449, 0.8053955495119587, 0.34914729898526137]
19
+ p pos_bp #=> [-0.5114184398598124, 0.805395337986056, 0.3491472536550768]
18
20
 
@@ -107,49 +107,49 @@ module EphBpn
107
107
  # @param: <none>
108
108
  # @return: r (回転行列)
109
109
  #=========================================================================
110
- def r_generic
111
- r = r_x( -5.1 * 180 * Const::MAS2R)
112
- r = r_y(-17.3 * 180 * Const::MAS2R, r)
113
- r = r_z( 78.0 * 180 * Const::MAS2R, r)
110
+ def r_bias
111
+ r = r_x( -5.1 * Const::MAS2R)
112
+ r = r_y(-17.3 * Const::MAS2R, r)
113
+ r = r_z( 78.0 * Const::MAS2R, r)
114
114
  return r
115
115
  rescue => e
116
116
  raise
117
117
  end
118
118
 
119
119
  #=========================================================================
120
- # Bias 変換行列(IAU 2006 (Fukushima-Williams 4-angle formulation) 理論)
120
+ # Bias + Precession 変換行列
121
+ #
122
+ # * IAU 2006 (Fukushima-Williams 4-angle formulation) 理論
121
123
  #
122
124
  # @param: <none>
123
125
  # @return: r (変換行列)
124
126
  #=========================================================================
125
127
  def r_fw_iau_06
126
- jc = jd2jc(2451545.0)
127
- eps = compute_obliquity(jc)
128
128
  gamma = (-0.052928 + \
129
129
  (10.556378 + \
130
130
  ( 0.4932044 + \
131
131
  (-0.00031238 + \
132
132
  (-0.000002788 + \
133
133
  ( 0.0000000260) \
134
- * jc) * jc) * jc) * jc) * jc) * Const::AS2R
134
+ * @jc) * @jc) * @jc) * @jc) * @jc) * Const::AS2R
135
135
  phi = (84381.412819 + \
136
136
  ( -46.811016 + \
137
137
  ( 0.0511268 + \
138
138
  ( 0.00053289 + \
139
139
  ( -0.000000440 + \
140
140
  ( -0.0000000176) \
141
- * jc) * jc) * jc) * jc) * jc) * Const::AS2R
141
+ * @jc) * @jc) * @jc) * @jc) * @jc) * Const::AS2R
142
142
  psi = ( -0.041775 + \
143
143
  (5038.481484 + \
144
144
  ( 1.5584175 + \
145
145
  ( -0.00018522 + \
146
146
  ( -0.000026452 + \
147
147
  ( -0.0000000148) \
148
- * jc) * jc) * jc) * jc) * jc) * Const::AS2R
148
+ * @jc) * @jc) * @jc) * @jc) * @jc) * Const::AS2R
149
149
  r = r_z(gamma)
150
150
  r = r_x(phi, r)
151
151
  r = r_z(-psi, r)
152
- r = r_x(-eps, r)
152
+ r = r_x(-@eps, r)
153
153
  return r
154
154
  rescue => e
155
155
  raise
@@ -17,8 +17,7 @@ module EphBpn
17
17
  # @return: pos_b (適用後直角座標)
18
18
  #=========================================================================
19
19
  def apply_bias(pos)
20
- #return rotate(r_generic, pos) # 一般的な理論
21
- return rotate(r_fw_iau_06, pos) # IAU 2006 (Fukushima-Williams) 理論
20
+ return rotate(r_bias, pos)
22
21
  end
23
22
 
24
23
  #=========================================================================
@@ -31,6 +30,16 @@ module EphBpn
31
30
  return rotate(r_prec, pos)
32
31
  end
33
32
 
33
+ #=========================================================================
34
+ # Bias + Precession(歳差) 適用
35
+ #
36
+ # @param: pos (適用前直角座標)
37
+ # @return: pos_p (適用後直角座標)
38
+ #=========================================================================
39
+ def apply_bias_prec(pos)
40
+ return rotate(r_fw_iau_06, pos) # IAU 2006 (Fukushima-Williams) 理論
41
+ end
42
+
34
43
  #=========================================================================
35
44
  # Nutation(章動) 適用
36
45
  #
@@ -1,3 +1,3 @@
1
1
  module EphBpn
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eph_bpn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - komasaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler