ephem 0.2.0 → 0.3.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
2
  SHA256:
3
- metadata.gz: 24301ad81a75b670a87dd1b33e7d8c84e9e2bd9bd007e5d6f3564dbdc5d387ae
4
- data.tar.gz: b6c16db80b49173c1aea2853774c2c1fb81bc0513d0273bb1f5564fd2043109c
3
+ metadata.gz: 0d98544b09a63e12077c978a90723c8d92a42a41260217d3fc1b894b9ac78d2d
4
+ data.tar.gz: 1504fa0469b9e1d680ca08021e422cc47e73a3de64cee1d4246467cc3d435730
5
5
  SHA512:
6
- metadata.gz: 28e9df83433cb9a338197c1911cf136147c05b22909932ed591ce6512be2d58304c182947cc8232437f65342c2ac2d600329fdde648b9378d63ba0770ef724a6
7
- data.tar.gz: 4d1a96e724299ecd9c220283807eb47312ea7134698d9cffd31edb1d3be716add8da1af15b831246066ad2cd894c6249d185c3bf8bec87c2b525c931ff3b4a70
6
+ metadata.gz: 6641b30d6863c773ad164001bc8142a1c2534a1125e19fda9f6ca8077ea3e07ffaee51520bdfec60c1d9dc53f1f038b87d59dc1ebf3e5edd67692c63c447446b
7
+ data.tar.gz: a669535384edab4b824628a508efb9becf7ad2b69b6b93bdc0753230ef3361f27e3927707b75b2cf010dd171001736d718db96614077470a498c642f84315fb5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.0] - 2025-04-30
4
+
5
+ ## Features
6
+
7
+ * Improve find_interval with binary search ([#24])
8
+ * Use alias methods to get segment position or state ([#27])
9
+
10
+ ## Improvements
11
+
12
+ * Bump irb from 1.15.1 to 1.15.2 by @dependabot ([#21])
13
+ * Bump standard from 1.47.0 to 1.49.0 by @dependabot ([#23])
14
+ * Bump csv from 3.3.3 to 3.3.4 by @dependabot ([#25])
15
+ * Bump parallel from 1.26.3 to 1.27.0 by @dependabot ([#26])
16
+
17
+ **Full Changelog**: https://github.com/rhannequin/ruby-ephem/compare/v0.2.0...v0.3.0
18
+
19
+ [#21]: https://github.com/rhannequin/ruby-ephem/pull/21
20
+ [#23]: https://github.com/rhannequin/ruby-ephem/pull/23
21
+ [#24]: https://github.com/rhannequin/ruby-ephem/pull/24
22
+ [#25]: https://github.com/rhannequin/ruby-ephem/pull/25
23
+ [#26]: https://github.com/rhannequin/ruby-ephem/pull/26
24
+ [#27]: https://github.com/rhannequin/ruby-ephem/pull/27
25
+
3
26
  ## [0.2.0] - 2025-03-28
4
27
 
5
28
  ### Features
data/README.md CHANGED
@@ -87,7 +87,7 @@ puts segment.describe(verbose: true)
87
87
  # Get the position and velocity of the target body at a given time
88
88
  # The time is expressed in Julian Date
89
89
  time = 2460676.5
90
- state = segment.compute_and_differentiate(time)
90
+ state = segment.state_at(time)
91
91
 
92
92
  # Display the position and velocity vectors
93
93
  puts "Position: #{state.position}"
@@ -71,6 +71,7 @@ module Ephem
71
71
  def compute(tdb, tdb2 = 0.0)
72
72
  Core::Vector.new(*generate(tdb, tdb2).first)
73
73
  end
74
+ alias_method :position_at, :compute
74
75
 
75
76
  # Computes both position and velocity vectors at the specified time.
76
77
  #
@@ -109,6 +110,7 @@ module Ephem
109
110
  end
110
111
  end
111
112
  end
113
+ alias_method :state_at, :compute_and_differentiate
112
114
 
113
115
  # Clears cached coefficient data, forcing reload on next computation.
114
116
  #
@@ -256,11 +258,29 @@ module Ephem
256
258
  end
257
259
 
258
260
  def find_interval(tdb_seconds)
259
- interval = (0...@midpoints.size).find do |i|
260
- time_in_interval?(tdb_seconds, i)
261
+ left = 0
262
+ right = @midpoints.size - 1
263
+
264
+ if @last_interval && time_in_interval?(tdb_seconds, @last_interval)
265
+ return @last_interval
266
+ end
267
+
268
+ while left <= right
269
+ mid = (left + right) / 2
270
+ min_time = @midpoints[mid] - @radii[mid]
271
+ max_time = @midpoints[mid] + @radii[mid]
272
+
273
+ if tdb_seconds < min_time
274
+ right = mid - 1
275
+ elsif tdb_seconds > max_time
276
+ left = mid + 1
277
+ else
278
+ @last_interval = mid
279
+ return mid
280
+ end
261
281
  end
262
282
 
263
- interval or raise OutOfRangeError.new(
283
+ raise OutOfRangeError.new(
264
284
  "Time #{tdb_seconds} is outside the coverage of this segment",
265
285
  tdb_seconds
266
286
  )
data/lib/ephem/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ephem
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ephem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rémy Hannequin
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: minitar
@@ -136,7 +136,7 @@ dependencies:
136
136
  - !ruby/object:Gem::Version
137
137
  version: '1.43'
138
138
  description: Ruby implementation of the parsing and computation of ephemerides from
139
- NASA JPL Development Ephemerides DE4xx
139
+ NASA/JPL Development Ephemerides DE4xx and IMCCE INPOP
140
140
  email:
141
141
  - remy.hannequin@gmail.com
142
142
  executables:
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.6.2
247
+ rubygems_version: 3.6.7
248
248
  specification_version: 4
249
- summary: Compute astronomical ephemerides from NASA JPL Development Ephemerides
249
+ summary: Compute astronomical ephemerides from NASA/JPL DE and IMCCE INPOP
250
250
  test_files: []