eph_jpl 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 +5 -5
- data/README.md +6 -1
- data/lib/eph_jpl/binary.rb +32 -11
- data/lib/eph_jpl/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6cfa8844974136a6e16c581cee84adcb73bae98e10edc0e88c55932dc2a2695f
|
4
|
+
data.tar.gz: 7b8a01e4b91a9967491c8d97f882fc3982f74f1e21dcaaf9ad84947daad3800f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c9cf596a5a1f584baa47fa6d6d8ee3b45655b00b4e0bed56ee36c8a7f0aa0394e4ad09b90dcd8eea31a44c965941b7fec6af307f2a735397fea189ec1808ac4
|
7
|
+
data.tar.gz: 5fab9953c71418dbc358d365416d41ffc35173fb19424504f341ae9583d89c8d13c7a64813eac0881e9219ac8a48452157230acb6145a64e1fc0f9aa29493ba0
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Please refer the following links about DE datas.
|
|
19
19
|
|
20
20
|
To understand this library's in-depth specification, you need to comprehend contents of the following link well.
|
21
21
|
|
22
|
-
* [testeph.f
|
22
|
+
* [ftp://ssd.jpl.nasa.gov/pub/eph/planets/fortran/testeph.f](ftp://ssd.jpl.nasa.gov/pub/eph/planets/fortran/testeph.f)
|
23
23
|
|
24
24
|
### Supported DE Ver.
|
25
25
|
|
@@ -74,6 +74,11 @@ p obj.unit #=> UNIT of positions and velocities (String)
|
|
74
74
|
p obj.bin #=> Acquired data from binary file (Hash)
|
75
75
|
p obj.calc #=> [x, y, z-position, x, y, z-velocity]
|
76
76
|
```
|
77
|
+
About binary file.
|
78
|
+
|
79
|
+
1. Please get the binary file for DE430 from [ftp://ssd.jpl.nasa.gov/pub/eph/planets/Linux/de430/linux_p1550p2650.430].
|
80
|
+
2. Please put "linux_p1550p2650.430" into a proper directory.
|
81
|
+
3. Please rename as needed.
|
77
82
|
|
78
83
|
About arguments for target and center astronomical bodies.
|
79
84
|
|
data/lib/eph_jpl/binary.rb
CHANGED
@@ -7,17 +7,18 @@ module EphJpl
|
|
7
7
|
|
8
8
|
def get_binary
|
9
9
|
begin
|
10
|
-
ttl = get_ttl
|
11
|
-
cnams = get_cnams
|
12
|
-
sss = get_sss
|
13
|
-
ncon = get_ncon
|
14
|
-
au = get_au
|
15
|
-
emrat = get_emrat
|
16
|
-
ipts = get_ipts
|
17
|
-
numde = get_numde
|
18
|
-
ipts << get_ipts_13
|
19
|
-
|
20
|
-
|
10
|
+
ttl = get_ttl # TTL
|
11
|
+
cnams = get_cnams # CNAM
|
12
|
+
sss = get_sss # SS
|
13
|
+
ncon = get_ncon # NCON
|
14
|
+
au = get_au # AU
|
15
|
+
emrat = get_emrat # EMRAT
|
16
|
+
ipts = get_ipts # IPT
|
17
|
+
numde = get_numde # NUMDE
|
18
|
+
ipts << get_ipts_13 # IPT(Month's libration)
|
19
|
+
cnams += get_cnams_2(ncon) # CNAM(>400)
|
20
|
+
cvals = get_cvals(ncon) # CVAL(定数値)
|
21
|
+
jdepoc = cvals[4] # JDEPOC
|
21
22
|
coeffs, jds_cheb = get_coeffs(sss, ipts) # Coefficient, JDs(for Chebyshev polynomial)
|
22
23
|
return {
|
23
24
|
ttl: ttl, cnams: cnams, sss: sss, ncon: ncon, au: au, emrat: emrat,
|
@@ -209,6 +210,26 @@ module EphJpl
|
|
209
210
|
end
|
210
211
|
end
|
211
212
|
|
213
|
+
#=========================================================================
|
214
|
+
# CNAM
|
215
|
+
#
|
216
|
+
# @param: NCON
|
217
|
+
# @return: Array of CNAM
|
218
|
+
#=========================================================================
|
219
|
+
def get_cnams_2(ncon)
|
220
|
+
recl = 6
|
221
|
+
|
222
|
+
begin
|
223
|
+
cnams = (0..(ncon - 400 - 1)).map do |i|
|
224
|
+
File.binread(@bin_path, recl, @pos + recl * i).unpack("A*")[0]
|
225
|
+
end
|
226
|
+
@pos += recl * (ncon - 400)
|
227
|
+
return cnams
|
228
|
+
rescue => e
|
229
|
+
raise
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
212
233
|
#=========================================================================
|
213
234
|
# CVAL
|
214
235
|
#
|
data/lib/eph_jpl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eph_jpl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
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:
|
11
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.7.7
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Ephemeris calculation tool by JPL method.
|