mk_apos 0.1.0 → 0.1.1

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: fa8ede1b3c58383c1fc41348959bedb24e34c72f
4
- data.tar.gz: da78fd2c8b82bc794e3986ccbcebc2d4118e0a99
3
+ metadata.gz: 054bb2399bcee90974a5609f7691a180932c7068
4
+ data.tar.gz: fb7bf3c226a47822d6acea87dd0d0f142f363fbe
5
5
  SHA512:
6
- metadata.gz: f6473dd4869c17c5f1881ec19881de77acab0738a81d4abfdbf0253071c9503df892f37b9922be14bb9ad6b22ec34aeea402212de64269c343bcbbeaa587d963
7
- data.tar.gz: 570c104c39aca9be932492d883e247ff17960b43b9a248422ceb1d1534b4bba8721d7c95250ee0c4e50961d7df21c2ab8dc7f030ef8201e90c796d7aea572654
6
+ metadata.gz: 3bac2c9d72a28e6a7cf6ccb47616d0a50461358b961d41acc83a2ea3eb85efbdbfcd6a7c788f80b47a6901af1a65c24c4ad074110bb9d8ca7cf9a49feabe061f
7
+ data.tar.gz: 155ff625ca45b805073d695d66120d7b4cd57568d879f54b3de07cafb9dfc7cfac816add7d0fd330a697b24424a7a3b8f4fb3623df624db6f1cc463d8907d7ca
data/README.md CHANGED
@@ -38,7 +38,7 @@ Or install it yourself as:
38
38
  a = MkApos.new("/path/to/<JPLEPH binary>")
39
39
 
40
40
  * You can set UTC formatted `YYYYMMDD` or `YYYYMMDDHHMMSS` or `YYYYMMDDHHMMSSU...` as an argument. (`U` is microsecond)
41
- * If you don't set a second argument, this class considers the system time to have been set as a second argument.
41
+ * If you don't set a second argument, this class considers the system time to have been set as a second argument(UTC).
42
42
 
43
43
  ### Calculation
44
44
 
@@ -150,7 +150,7 @@ module MkApos
150
150
  t_2 = t_1
151
151
  pv_1 = @icrs_2[target]
152
152
  df, m = 1.0, 0
153
- while df > 1.0e-10 || m > 10
153
+ while df > 1.0e-10
154
154
  r_12 = (0..2).map { |i| pv_1[i] - @icrs_2[:earth][i] }
155
155
  r_12_d = calc_dist(pv_1, @icrs_2[:earth])
156
156
  df = (Const::C * Const::DAYSEC / Const::AU) * (t_2 - t_1) - r_12_d
@@ -158,6 +158,7 @@ module MkApos
158
158
  df /= ((Const::C * Const::DAYSEC / Const::AU) + (df_wk) / r_12_d)
159
159
  t_1 += df
160
160
  m += 1
161
+ raise Const::MSG_ERR_5 if m > 10
161
162
  pv_1 = get_icrs(Const::BODIES[target], t_1)
162
163
  end
163
164
  return t_1
data/lib/mk_apos/const.rb CHANGED
@@ -4,6 +4,7 @@ module MkApos
4
4
  MSG_ERR_2 = "[ERROR] Format: YYYYMMDD or YYYYMMDDHHMMSS or YYYYMMDDHHMMSSU..."
5
5
  MSG_ERR_3 = "[ERROR] Invalid date-time!"
6
6
  MSG_ERR_4 = "[ERROR] Binary file is not found!"
7
+ MSG_ERR_5 = "[ERROR] Newton method error!"
7
8
  BODIES = {earth: 3, moon: 10, sun: 11} # 天体名と JPL での天体番号
8
9
  AU = 149597870700 # 1天文単位 (m)
9
10
  C = 299792458 # 光速 (m/s)
@@ -1,3 +1,3 @@
1
1
  module MkApos
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - komasaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2016-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eph_bpn