astronoby 0.5.0 → 0.7.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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/.standard.yml +1 -0
  4. data/CHANGELOG.md +162 -0
  5. data/Gemfile.lock +54 -34
  6. data/README.md +42 -272
  7. data/UPGRADING.md +238 -0
  8. data/benchmark/README.md +131 -0
  9. data/benchmark/benchmark.rb +259 -0
  10. data/benchmark/data/imcce.csv.zip +0 -0
  11. data/benchmark/data/sun_calc.csv.zip +0 -0
  12. data/lib/astronoby/aberration.rb +56 -31
  13. data/lib/astronoby/angle.rb +20 -16
  14. data/lib/astronoby/angles/dms.rb +2 -2
  15. data/lib/astronoby/angles/hms.rb +2 -2
  16. data/lib/astronoby/bodies/earth.rb +56 -0
  17. data/lib/astronoby/bodies/jupiter.rb +11 -0
  18. data/lib/astronoby/bodies/mars.rb +11 -0
  19. data/lib/astronoby/bodies/mercury.rb +11 -0
  20. data/lib/astronoby/bodies/moon.rb +50 -285
  21. data/lib/astronoby/bodies/neptune.rb +11 -0
  22. data/lib/astronoby/bodies/saturn.rb +11 -0
  23. data/lib/astronoby/bodies/solar_system_body.rb +122 -0
  24. data/lib/astronoby/bodies/sun.rb +16 -220
  25. data/lib/astronoby/bodies/uranus.rb +11 -0
  26. data/lib/astronoby/bodies/venus.rb +11 -0
  27. data/lib/astronoby/constants.rb +13 -1
  28. data/lib/astronoby/coordinates/ecliptic.rb +2 -37
  29. data/lib/astronoby/coordinates/equatorial.rb +25 -7
  30. data/lib/astronoby/coordinates/horizontal.rb +0 -46
  31. data/lib/astronoby/corrections/light_time_delay.rb +90 -0
  32. data/lib/astronoby/deflection.rb +187 -0
  33. data/lib/astronoby/distance.rb +9 -0
  34. data/lib/astronoby/ephem.rb +39 -0
  35. data/lib/astronoby/equinox_solstice.rb +21 -18
  36. data/lib/astronoby/errors.rb +4 -0
  37. data/lib/astronoby/events/moon_phases.rb +2 -1
  38. data/lib/astronoby/events/rise_transit_set_calculator.rb +352 -0
  39. data/lib/astronoby/events/rise_transit_set_event.rb +13 -0
  40. data/lib/astronoby/events/rise_transit_set_events.rb +13 -0
  41. data/lib/astronoby/events/twilight_calculator.rb +166 -0
  42. data/lib/astronoby/events/twilight_event.rb +28 -0
  43. data/lib/astronoby/instant.rb +171 -0
  44. data/lib/astronoby/mean_obliquity.rb +23 -10
  45. data/lib/astronoby/nutation.rb +227 -42
  46. data/lib/astronoby/observer.rb +66 -1
  47. data/lib/astronoby/precession.rb +91 -17
  48. data/lib/astronoby/reference_frame.rb +49 -0
  49. data/lib/astronoby/reference_frames/apparent.rb +60 -0
  50. data/lib/astronoby/reference_frames/astrometric.rb +21 -0
  51. data/lib/astronoby/reference_frames/geometric.rb +20 -0
  52. data/lib/astronoby/reference_frames/mean_of_date.rb +38 -0
  53. data/lib/astronoby/reference_frames/topocentric.rb +82 -0
  54. data/lib/astronoby/time/greenwich_sidereal_time.rb +1 -1
  55. data/lib/astronoby/true_obliquity.rb +2 -1
  56. data/lib/astronoby/util/maths.rb +68 -49
  57. data/lib/astronoby/util/time.rb +466 -32
  58. data/lib/astronoby/vector.rb +36 -0
  59. data/lib/astronoby/velocity.rb +116 -0
  60. data/lib/astronoby/version.rb +1 -1
  61. data/lib/astronoby.rb +26 -5
  62. metadata +81 -18
  63. data/.tool-versions +0 -1
  64. data/lib/astronoby/astronomical_models/ephemeride_lunaire_parisienne.rb +0 -143
  65. data/lib/astronoby/events/observation_events.rb +0 -259
  66. data/lib/astronoby/events/rise_transit_set_iteration.rb +0 -215
  67. data/lib/astronoby/events/twilight_events.rb +0 -121
  68. data/lib/astronoby/util/astrodynamics.rb +0 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43ef390a6ab6a498edbf148b2af44c906daf73ff9ba61b5aafeadd828fb550e4
4
- data.tar.gz: b2cf0743676aa49f95f24c62b3d5d759553014bc52114260a71ecedfb9e6c1cb
3
+ metadata.gz: 3406973da55433c82cd985454453f570220feb119f8274176ed8ab0539a8c99d
4
+ data.tar.gz: c4094d2e8a6d9be6c93ef0c48a8202cec8fe8e6a8f12197f9ee930b18b1e1302
5
5
  SHA512:
6
- metadata.gz: 052bfebf4ddaf6ef3f24883fec090a831d38a9e4124dd5f561d6b1dd7074b6385502396edddd5496ab6066ff93acab4f220ec3aaa244ad0638c0b65fbaace55f
7
- data.tar.gz: fe37ac2714328893b068ba958e37a3b057a76ddfa1b299a35f22be005687d3168d20e98ebe571db519bd6cf69227cc0f0dc4c0889dd9ca5bb9d1abb2b1ee550d
6
+ metadata.gz: 49156fb3ade1cc6b3d15120e4942c0a798b00fdff3b35024cf3ffe8f1bf9c8d7f1eeae40d457485ae3a225e418fa5f8e5c4bc95e826ed14b3ff26b71b2fa6200
7
+ data.tar.gz: cee4783838c39d8df122dc5542cc52eee1527aa37a6fab493759c58a89686b0bc2b9cc547cbec2bd6feaee2a46bc094a72dba0a372719a4875355d1af8440f00
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.3
data/.standard.yml ADDED
@@ -0,0 +1 @@
1
+ ruby_version: 3.0.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,167 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0 - 2025-05-12
4
+
5
+ _If you are upgrading: please see [UPGRADING.md]._
6
+
7
+ ### Bug fixes
8
+
9
+ * Fix Moon monthly phase events calculation by @valeriy-sokoloff in ([#124])
10
+
11
+ ### Features
12
+
13
+ * Add `Instant` value object ([#121])
14
+ * Introduce barycentric position of Solar System major bodies ([#127])
15
+ * Introduce Astrometric position for planets ([#129])
16
+ * Rename Barycentric into Geometric ([#130])
17
+ * Rename IRCF and remove module Position ([#131])
18
+ * Geometric and Astrometric reference frames with coordinates ([#132])
19
+ * Ecliptic coordinates for Geometric and Astrometric reference frames ([#134])
20
+ * Add Geometric and Astrometric positions for `Sun` and `Moon` ([#135])
21
+ * Implement new aberration correction ([#136])
22
+ * Precession matrix for 2006 P03 model ([#137])
23
+ * Introduce `MeanOfDate` reference frame ([#138])
24
+ * New nutation model ([#141])
25
+ * Light deflection correction ([#142])
26
+ * Introduce `Apparent` reference frame ([#143])
27
+ * Introduce `Topocentric` reference frame ([#145])
28
+ * Improve Vector integration with value objects ([#146])
29
+ * Handle refracted topocentric horizontal coordinates ([#147])
30
+ * Add `#angular_diameter` to apparent and topocentric reference frames ([#149])
31
+ * Introduce new calculator for rising, transit and setting times ([#148])
32
+ * Clean code after Ephem refactoring ([#152])
33
+ * Improve `RisingTransitSettingEventsCalculator` ([#155])
34
+ * Simplify `RisingTransitSettingEventsCalculator` ([#156])
35
+ * Lazy-load reference frames ([#157])
36
+ * Overall performance improvements ([#163])
37
+ * Add support for IMCCE INPOP by @JoelQ and @rhannequin ([#166])
38
+ * Update INPOP excerpt in spec data ([#167])
39
+ * Introduce a better rise/transit/set calculator ([#168])
40
+ * Drop `Astronoby::Observer#observe` ([#174])
41
+
42
+ ### Improvements
43
+
44
+ * Bump standard from 1.42.1 to 1.49.0 by @dependabot ([#123], [#128], [#150], [#165])
45
+ * Bump rubyzip from 2.3.2 to 2.4.1 by @dependabot ([#120])
46
+ * Add more tests for Julian Date conversion ([#122])
47
+ * Upgrade main Ruby version and supported ones ([#125])
48
+ * Update email address and gem description ([#126])
49
+ * Increase precision of mean obliquity ([#133])
50
+ * Add supported Rubies ([#139])
51
+ * Set Ruby 3.4.2 as default version ([#140])
52
+ * Fix dependency secutiry patch ([#151])
53
+ * Improve HMS/DMS formats ([#153])
54
+ * Use excerpts ephemerides for specs of Sun and Moon ([#154])
55
+ * Add link to deprecated documentation ([#160])
56
+ * Default Ruby 3.4.3 and support recent rubies ([#169])
57
+ * Better Moon phases test coverage ([#172])
58
+ * Optimize Observer with GMST from Instant ([#173])
59
+ * Update README about documentation location ([#175])
60
+ * Add GitHub Actions permissions ([#176])
61
+
62
+ ### New Contributors
63
+
64
+ * @valeriy-sokoloff made their first contribution in https://github.com/rhannequin/astronoby/pull/124
65
+ * @JoelQ made their first contribution in https://github.com/rhannequin/astronoby/pull/166
66
+
67
+ **Full Changelog**: https://github.com/rhannequin/astronoby/compare/v0.6.0...v0.7.0
68
+
69
+ [#120]: https://github.com/rhannequin/astronoby/pull/120
70
+ [#121]: https://github.com/rhannequin/astronoby/pull/121
71
+ [#122]: https://github.com/rhannequin/astronoby/pull/122
72
+ [#123]: https://github.com/rhannequin/astronoby/pull/123
73
+ [#124]: https://github.com/rhannequin/astronoby/pull/124
74
+ [#125]: https://github.com/rhannequin/astronoby/pull/125
75
+ [#126]: https://github.com/rhannequin/astronoby/pull/126
76
+ [#127]: https://github.com/rhannequin/astronoby/pull/127
77
+ [#128]: https://github.com/rhannequin/astronoby/pull/128
78
+ [#129]: https://github.com/rhannequin/astronoby/pull/129
79
+ [#130]: https://github.com/rhannequin/astronoby/pull/130
80
+ [#131]: https://github.com/rhannequin/astronoby/pull/131
81
+ [#132]: https://github.com/rhannequin/astronoby/pull/132
82
+ [#133]: https://github.com/rhannequin/astronoby/pull/133
83
+ [#134]: https://github.com/rhannequin/astronoby/pull/134
84
+ [#135]: https://github.com/rhannequin/astronoby/pull/135
85
+ [#136]: https://github.com/rhannequin/astronoby/pull/136
86
+ [#137]: https://github.com/rhannequin/astronoby/pull/137
87
+ [#138]: https://github.com/rhannequin/astronoby/pull/138
88
+ [#139]: https://github.com/rhannequin/astronoby/pull/139
89
+ [#140]: https://github.com/rhannequin/astronoby/pull/140
90
+ [#141]: https://github.com/rhannequin/astronoby/pull/141
91
+ [#142]: https://github.com/rhannequin/astronoby/pull/142
92
+ [#143]: https://github.com/rhannequin/astronoby/pull/143
93
+ [#145]: https://github.com/rhannequin/astronoby/pull/145
94
+ [#146]: https://github.com/rhannequin/astronoby/pull/146
95
+ [#147]: https://github.com/rhannequin/astronoby/pull/147
96
+ [#148]: https://github.com/rhannequin/astronoby/pull/148
97
+ [#149]: https://github.com/rhannequin/astronoby/pull/149
98
+ [#150]: https://github.com/rhannequin/astronoby/pull/150
99
+ [#151]: https://github.com/rhannequin/astronoby/pull/151
100
+ [#152]: https://github.com/rhannequin/astronoby/pull/152
101
+ [#153]: https://github.com/rhannequin/astronoby/pull/153
102
+ [#154]: https://github.com/rhannequin/astronoby/pull/154
103
+ [#155]: https://github.com/rhannequin/astronoby/pull/155
104
+ [#156]: https://github.com/rhannequin/astronoby/pull/156
105
+ [#157]: https://github.com/rhannequin/astronoby/pull/157
106
+ [#160]: https://github.com/rhannequin/astronoby/pull/160
107
+ [#163]: https://github.com/rhannequin/astronoby/pull/163
108
+ [#165]: https://github.com/rhannequin/astronoby/pull/165
109
+ [#166]: https://github.com/rhannequin/astronoby/pull/166
110
+ [#167]: https://github.com/rhannequin/astronoby/pull/167
111
+ [#168]: https://github.com/rhannequin/astronoby/pull/168
112
+ [#169]: https://github.com/rhannequin/astronoby/pull/169
113
+ [#172]: https://github.com/rhannequin/astronoby/pull/172
114
+ [#173]: https://github.com/rhannequin/astronoby/pull/173
115
+ [#174]: https://github.com/rhannequin/astronoby/pull/174
116
+ [#175]: https://github.com/rhannequin/astronoby/pull/175
117
+ [#176]: https://github.com/rhannequin/astronoby/pull/176
118
+
119
+ ## 0.6.0 - 2024-12-10
120
+
121
+ _If you are upgrading: please see [UPGRADING.md]._
122
+
123
+ [UPGRADING.md]: https://github.com/rhannequin/astronoby/blob/main/UPGRADING.md
124
+
125
+ ### Bug fixes
126
+
127
+ * Fix `ObservationEvents` infinite loop in ([#110])
128
+ * Fix observation events times with local time dates in ([#105])
129
+ * Fix `IncompatibleArgumentsError` on Moon's observation events in ([#111])
130
+
131
+ ### Features
132
+
133
+ * Add `Astronoby::Moon#current_phase_fraction` in ([#115])
134
+ * Add sources and results for comparison in ([#114])
135
+
136
+ ### Improvements
137
+
138
+ * Bump standard from 1.36.0 to 1.39.2 by @dependabot in ([#95])
139
+ * Bump standard from 1.39.2 to 1.40.0 by @dependabot in ([#96])
140
+ * Bump dependencies in ([#100])
141
+ * Move dependencies to development ones in ([#99])
142
+ * Bump standard from 1.40.0 to 1.41.1 by @dependabot in ([#104])
143
+ * Bump standard from 1.41.1 to 1.42.0 by @dependabot in ([#107])
144
+ * Bump standard from 1.42.0 to 1.42.1 by @dependabot in ([#108])
145
+ * Bump dependencies in ([#116])
146
+ * Add supported Ruby versions in ([#117])
147
+
148
+ **Full Changelog**: https://github.com/rhannequin/astronoby/compare/v0.5.0...v0.6.0
149
+
150
+ [#95]: https://github\.com/rhannequin/astronoby/pull/95
151
+ [#96]: https://github\.com/rhannequin/astronoby/pull/96
152
+ [#99]: https://github\.com/rhannequin/astronoby/pull/99
153
+ [#100]: https://github\.com/rhannequin/astronoby/pull/100
154
+ [#104]: https://github\.com/rhannequin/astronoby/pull/104
155
+ [#105]: https://github\.com/rhannequin/astronoby/pull/105
156
+ [#107]: https://github\.com/rhannequin/astronoby/pull/107
157
+ [#108]: https://github\.com/rhannequin/astronoby/pull/108
158
+ [#110]: https://github\.com/rhannequin/astronoby/pull/110
159
+ [#111]: https://github\.com/rhannequin/astronoby/pull/111
160
+ [#114]: https://github\.com/rhannequin/astronoby/pull/114
161
+ [#115]: https://github\.com/rhannequin/astronoby/pull/115
162
+ [#116]: https://github\.com/rhannequin/astronoby/pull/116
163
+ [#117]: https://github\.com/rhannequin/astronoby/pull/117
164
+
3
165
  ## 0.5.0 - 2024-06-11
4
166
 
5
167
  _If you are upgrading: please see [UPGRADING.md]._
data/Gemfile.lock CHANGED
@@ -1,74 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- astronoby (0.5.0)
4
+ astronoby (0.7.0)
5
+ ephem (~> 0.3)
5
6
  matrix (~> 0.4.2)
6
- rake (~> 13.0)
7
- rspec (~> 3.0)
8
7
 
9
8
  GEM
10
9
  remote: https://rubygems.org/
11
10
  specs:
12
- ast (2.4.2)
11
+ ast (2.4.3)
13
12
  diff-lcs (1.5.1)
14
- json (2.7.2)
15
- language_server-protocol (3.17.0.3)
13
+ docile (1.4.1)
14
+ ephem (0.3.0)
15
+ minitar (~> 0.12)
16
+ numo-narray (~> 0.9.2.1)
17
+ zlib (~> 3.2)
18
+ json (2.10.2)
19
+ language_server-protocol (3.17.0.4)
16
20
  lint_roller (1.1.0)
17
21
  matrix (0.4.2)
18
- parallel (1.24.0)
19
- parser (3.3.1.0)
22
+ minitar (0.12.1)
23
+ numo-narray (0.9.2.1)
24
+ parallel (1.26.3)
25
+ parser (3.3.7.4)
20
26
  ast (~> 2.4.1)
21
27
  racc
22
- racc (1.7.3)
28
+ prism (1.4.0)
29
+ racc (1.8.1)
23
30
  rainbow (3.1.1)
24
31
  rake (13.2.1)
25
- regexp_parser (2.9.1)
26
- rexml (3.2.8)
27
- strscan (>= 3.0.9)
32
+ regexp_parser (2.10.0)
28
33
  rspec (3.13.0)
29
34
  rspec-core (~> 3.13.0)
30
35
  rspec-expectations (~> 3.13.0)
31
36
  rspec-mocks (~> 3.13.0)
32
- rspec-core (3.13.0)
37
+ rspec-core (3.13.2)
33
38
  rspec-support (~> 3.13.0)
34
- rspec-expectations (3.13.0)
39
+ rspec-expectations (3.13.3)
35
40
  diff-lcs (>= 1.2.0, < 2.0)
36
41
  rspec-support (~> 3.13.0)
37
- rspec-mocks (3.13.0)
42
+ rspec-mocks (3.13.2)
38
43
  diff-lcs (>= 1.2.0, < 2.0)
39
44
  rspec-support (~> 3.13.0)
40
- rspec-support (3.13.1)
41
- rubocop (1.63.5)
45
+ rspec-support (3.13.2)
46
+ rubocop (1.75.2)
42
47
  json (~> 2.3)
43
- language_server-protocol (>= 3.17.0)
48
+ language_server-protocol (~> 3.17.0.2)
49
+ lint_roller (~> 1.1.0)
44
50
  parallel (~> 1.10)
45
51
  parser (>= 3.3.0.2)
46
52
  rainbow (>= 2.2.2, < 4.0)
47
- regexp_parser (>= 1.8, < 3.0)
48
- rexml (>= 3.2.5, < 4.0)
49
- rubocop-ast (>= 1.31.1, < 2.0)
53
+ regexp_parser (>= 2.9.3, < 3.0)
54
+ rubocop-ast (>= 1.44.0, < 2.0)
50
55
  ruby-progressbar (~> 1.7)
51
- unicode-display_width (>= 2.4.0, < 3.0)
52
- rubocop-ast (1.31.3)
53
- parser (>= 3.3.1.0)
54
- rubocop-performance (1.21.0)
55
- rubocop (>= 1.48.1, < 2.0)
56
- rubocop-ast (>= 1.31.1, < 2.0)
56
+ unicode-display_width (>= 2.4.0, < 4.0)
57
+ rubocop-ast (1.44.0)
58
+ parser (>= 3.3.7.2)
59
+ prism (~> 1.4)
60
+ rubocop-performance (1.25.0)
61
+ lint_roller (~> 1.1)
62
+ rubocop (>= 1.75.0, < 2.0)
63
+ rubocop-ast (>= 1.38.0, < 2.0)
57
64
  ruby-progressbar (1.13.0)
58
- standard (1.36.0)
65
+ rubyzip (2.4.1)
66
+ simplecov (0.22.0)
67
+ docile (~> 1.1)
68
+ simplecov-html (~> 0.11)
69
+ simplecov_json_formatter (~> 0.1)
70
+ simplecov-html (0.13.1)
71
+ simplecov_json_formatter (0.1.4)
72
+ standard (1.49.0)
59
73
  language_server-protocol (~> 3.17.0.2)
60
74
  lint_roller (~> 1.0)
61
- rubocop (~> 1.63.0)
75
+ rubocop (~> 1.75.2)
62
76
  standard-custom (~> 1.0.0)
63
- standard-performance (~> 1.4)
77
+ standard-performance (~> 1.8)
64
78
  standard-custom (1.0.2)
65
79
  lint_roller (~> 1.0)
66
80
  rubocop (~> 1.50)
67
- standard-performance (1.4.0)
81
+ standard-performance (1.8.0)
68
82
  lint_roller (~> 1.1)
69
- rubocop-performance (~> 1.21.0)
70
- strscan (3.1.0)
71
- unicode-display_width (2.5.0)
83
+ rubocop-performance (~> 1.25.0)
84
+ unicode-display_width (3.1.4)
85
+ unicode-emoji (~> 4.0, >= 4.0.4)
86
+ unicode-emoji (4.0.4)
87
+ zlib (3.2.1)
72
88
 
73
89
  PLATFORMS
74
90
  ruby
@@ -76,6 +92,10 @@ PLATFORMS
76
92
 
77
93
  DEPENDENCIES
78
94
  astronoby!
95
+ rake (~> 13.0)
96
+ rspec (~> 3.0)
97
+ rubyzip (~> 2.3)
98
+ simplecov (~> 0.22)
79
99
  standard (~> 1.3)
80
100
 
81
101
  BUNDLED WITH
data/README.md CHANGED
@@ -2,30 +2,22 @@
2
2
 
3
3
  [![Tests](https://github.com/rhannequin/astronoby/workflows/Ruby/badge.svg)](https://github.com/rhannequin/astronoby/actions?query=workflow%3ARuby)
4
4
 
5
- Ruby library to provide a useful API to compute astronomical calculations, based
6
- on astrometry books.
5
+ Ruby library to provide a useful API to compute astronomical calculations.
7
6
 
8
- The main reference is:
9
- - _Astronomical Algorithms_ by Jean Meeus
10
- - _Celestial Calculations_ by J. L. Lawrence
11
- - _Practical Astronomy with your Calculator or Spreadsheet_ by Peter
7
+ Some algorithms are based on the following astrometry books:
8
+ * _Astronomical Algorithms_ by Jean Meeus
9
+ * _Celestial Calculations_ by J. L. Lawrence
10
+ * _Practical Astronomy with your Calculator or Spreadsheet_ by Peter
12
11
  Duffet-Smith and Jonathan Zwart
13
12
 
13
+ Solar System body's positions are computed based on ephemerides coming from
14
+ the [IMCCE] or [NASA/JPL].
15
+
16
+ [NASA/JPL]: https://ssd.jpl.nasa.gov/planets/eph_export.html
17
+
14
18
  ## Content
15
19
  - [Installation](#installation)
16
- - [Usage](#usage)
17
- - [Angle manipulation](#angle-manipulation)
18
- - [Coordinates conversion](#coordinates-conversion)
19
- - [Sun](#sun)
20
- - [Sun's location in the sky](#suns-location-in-the-sky)
21
- - [Sunrise and sunset times and azimuths](#sunrise-and-sunset-times-and-azimuths)
22
- - [Twilight times](#twilight-times)
23
- - [Solstice and Equinox times](#solstice-and-equinox-times)
24
- - [Moon](#moon)
25
- - [Moon's location in the sky](#moons-location-in-the-sky)
26
- - [Moon's current attributes](#moons-current-attributes)
27
- - [Moon's phases of the month](#moons-phases-of-the-month)
28
- - [Moonrise and moonset times and azimuths](#moonrise-and-moonset-times-and-azimuths)
20
+ - [Usage Documentation](#usage-documentation)
29
21
  - [Precision](#precision)
30
22
  - [Development](#development)
31
23
  - [Contributing](#contributing)
@@ -38,274 +30,50 @@ Install the gem and add to the application's Gemfile by executing:
38
30
 
39
31
  $ bundle add astronoby
40
32
 
41
- If bundler is not being used to manage dependencies, install the gem by
33
+ If [Bundler] is not being used to manage dependencies, install the gem by
42
34
  executing:
43
35
 
44
36
  $ gem install astronoby
45
37
 
46
- ## Usage
47
-
48
- This library is still in heavy development. The public is not stable, please
49
- be aware new minor versions will probably lead to breaking changes until a
50
- major one is released.
51
-
52
- ### Angle manipulation
53
-
54
- ```rb
55
- angle1 = Astronoby::Angle.from_degrees(90)
56
- angle2 = Astronoby::Angle.from_radians(Math::PI / 2)
57
- angle3 = Astronoby::Angle.from_hours(12)
58
-
59
- angle1 == angle2
60
- # => true
61
-
62
- angle1 < angle3
63
- # => true
64
-
65
- angle = angle1 + angle2 + angle3
66
- angle.cos
67
- # => 1.0
68
- ```
69
-
70
- ### Distance manipulation
71
-
72
- ```rb
73
- distance1 = Astronoby::Distance.from_astronomical_units(1)
74
- distance2 = Astronoby::Distance.from_kilometers(149_597_870.7)
75
- distance3 = Astronoby::Distance.from_meters(300)
76
-
77
- distance1 == distance2
78
- # => true
79
-
80
- distance1 > distance3
81
- # => true
82
-
83
- distance =
84
- Astronoby::Distance.from_m(300) +
85
- Astronoby::Distance.from_km(3)
86
-
87
- distance.km
88
- # => 3.3
89
- ```
90
-
91
- ### Coordinates conversion
92
-
93
- ```rb
94
- observer = Astronoby::Observer.new(
95
- latitude: Astronoby::Angle.from_degrees(38),
96
- longitude: Astronoby::Angle.from_degrees(-78)
97
- )
98
-
99
- equatorial = Astronoby::Coordinates::Equatorial.new(
100
- right_ascension: Astronoby::Angle.from_hms(17, 43, 54),
101
- declination: Astronoby::Angle.from_dms(-22, 10, 0)
102
- )
103
-
104
- horizontal = equatorial.to_horizontal(
105
- time: Time.new(2016, 1, 21, 21, 30, 0, "-05:00"),
106
- observer: observer
107
- )
108
-
109
- horizontal.altitude.str(:dms)
110
- # => "-73° 27′ 19.1557″"
111
-
112
- horizontal.azimuth.str(:dms)
113
- # => "+341° 33′ 21.587″"
114
- ```
115
-
116
- ### Sun
117
-
118
- #### Sun's location in the sky
119
-
120
- ```rb
121
- time = Time.utc(2023, 2, 17, 11, 0, 0)
122
-
123
- observer = Astronoby::Observer.new(
124
- latitude: Astronoby::Angle.from_degrees(48.8566),
125
- longitude: Astronoby::Angle.from_degrees(2.3522)
126
- )
127
-
128
- sun = Astronoby::Sun.new(time: time)
129
-
130
- horizontal_coordinates = sun.horizontal_coordinates(
131
- observer: observer
132
- )
133
-
134
- horizontal_coordinates.altitude.degrees
135
- # => 27.500082409271247
136
-
137
- horizontal_coordinates.altitude.str(:dms)
138
- # => "+27° 30′ 0.2966″"
139
- ```
140
-
141
- #### Sunrise and sunset times and azimuths
142
-
143
- ```rb
144
- time = Time.new(2015, 2, 5)
145
- observer = Astronoby::Observer.new(
146
- latitude: Astronoby::Angle.from_degrees(38),
147
- longitude: Astronoby::Angle.from_degrees(-78)
148
- )
149
- sun = Astronoby::Sun.new(time: time)
150
- observation_events = sun.observation_events(observer: observer)
151
-
152
- observation_events.rising_time
153
- # => 2015-02-05 12:12:59 UTC
154
-
155
- observation_events.rising_azimuth.str(:dms)
156
- # => "+109° 29′ 34.3674″"
157
-
158
- observation_events.transit_time
159
- # => 2015-02-05 17:25:59 UTC
160
-
161
- observation_events.transit_altitude.str(:dms)
162
- # => "+36° 8′ 15.8197″"
38
+ [Bundler]: https://bundler.io
163
39
 
164
- observation_events.setting_time
165
- # => 2015-02-05 22:39:27 UTC
40
+ ## Usage Documentation
166
41
 
167
- observation_events.setting_azimuth.str(:dms)
168
- # => "+250° 40′ 42.8609″"
169
- ```
42
+ Since version 0.7.0, the usage documentation resides in the [Wiki]. For
43
+ previous versions, you can access the documentation in the README for each
44
+ [release].
170
45
 
171
- #### Twilight times
46
+ [Wiki]: https://github.com/rhannequin/astronoby/wiki
47
+ [release]: https://github.com/rhannequin/astronoby/releases
172
48
 
173
- ```rb
174
- time = Time.new(2024, 1, 1)
175
- sun = Astronoby::Sun.new(time: time)
176
- observer = Astronoby::Observer.new(
177
- latitude: Astronoby::Angle.from_degrees(48.8566),
178
- longitude: Astronoby::Angle.from_degrees(2.3522)
179
- )
180
- twilight_events = sun.twilight_events(observer: observer)
49
+ ### Expected breaking changes notice
181
50
 
182
- twilight_events.morning_astronomical_twilight_time
183
- # => 2024-01-01 05:49:25 UTC
184
-
185
- twilight_events.morning_nautical_twilight_time
186
- # => 2024-01-01 06:27:42 UTC
187
-
188
- twilight_events.morning_civil_twilight_time
189
- # => 2024-01-01 07:07:50 UTC
190
-
191
- twilight_events.evening_civil_twilight_time
192
- # => 2024-01-01 16:40:01 UTC
193
-
194
- twilight_events.evening_nautical_twilight_time
195
- # => 2024-01-01 17:20:10 UTC
196
-
197
- twilight_events.evening_astronomical_twilight_time
198
- # => 2024-01-01 17:58:26 UTC
199
- ```
200
-
201
- ### Solstice and Equinox times
202
-
203
- ```rb
204
- year = 2024
205
-
206
- Astronoby::EquinoxSolstice.march_equinox(year)
207
- # => 2024-03-20 03:05:08 UTC
208
-
209
- Astronoby::EquinoxSolstice.june_solstice(year)
210
- # => 2024-06-20 20:50:18 UTC
211
- ```
212
-
213
- ### Moon
214
-
215
- #### Moon's location in the sky
216
-
217
- ```rb
218
- time = Time.utc(2023, 2, 17, 11, 0, 0)
219
-
220
- observer = Astronoby::Observer.new(
221
- latitude: Astronoby::Angle.from_degrees(48.8566),
222
- longitude: Astronoby::Angle.from_degrees(2.3522)
223
- )
224
-
225
- moon = Astronoby::Moon.new(time: time)
226
-
227
- horizontal_coordinates = moon.horizontal_coordinates(
228
- observer: observer
229
- )
230
-
231
- horizontal_coordinates.altitude.degrees
232
- # => 10.277834691708053
233
-
234
- horizontal_coordinates.altitude.str(:dms)
235
- # => "+10° 16′ 40.2048″"
236
- ```
237
-
238
- #### Moon's current attributes
239
-
240
- ```rb
241
- time = Time.utc(2024, 6, 1, 10, 0, 0)
242
- moon = Astronoby::Moon.new(time: time)
243
-
244
- moon.illuminated_fraction.round(2)
245
- # => 0.31
246
-
247
- moon.distance.km.round
248
- # => 368409
249
-
250
- moon.phase_angle.degrees.round
251
- # => 112
252
- ```
253
-
254
- #### Moon's phases of the month
255
-
256
- ```rb
257
- june_phases = Astronoby::Moon.monthly_phase_events(
258
- year: 2024,
259
- month: 6
260
- )
261
-
262
- june_phases.each { puts "#{_1.phase}: #{_1.time}" }
263
- # new_moon: 2024-06-06 12:37:41 UTC
264
- # first_quarter: 2024-06-14 05:18:28 UTC
265
- # full_moon: 2024-06-22 01:07:53 UTC
266
- # last_quarter: 2024-06-28 21:53:25 UTC
267
- ```
268
-
269
- #### Moonrise and moonset times and azimuths
270
-
271
- ```rb
272
- time = Time.utc(2024, 6, 1, 10, 0, 0)
273
- observer = Astronoby::Observer.new(
274
- latitude: Astronoby::Angle.from_degrees(48.8566),
275
- longitude: Astronoby::Angle.from_degrees(2.3522)
276
- )
277
- moon = Astronoby::Moon.new(time: time)
278
- observation_events = moon.observation_events(observer: observer)
279
-
280
- observation_events.rising_time
281
- # => 2024-06-01 00:35:36 UTC
282
-
283
- observation_events.rising_azimuth.str(:dms)
284
- # => "+93° 7′ 43.2347″"
285
-
286
- observation_events.transit_time
287
- # => 2024-06-01 02:42:43 UTC
288
-
289
- observation_events.transit_altitude.str(:dms)
290
- # => "+26° 59′ 30.9915″"
51
+ This library is still in heavy development. The public is not stable, please
52
+ be aware new minor versions will probably lead to breaking changes until a
53
+ major one is released.
291
54
 
292
- observation_events.setting_time
293
- # => 2024-06-01 16:02:26 UTC
55
+ Changes are documented in the [CHANGELOG] and adapting to breaking changes is
56
+ described in the [UPGRADING] document.
294
57
 
295
- observation_events.setting_azimuth.str(:dms)
296
- # => "+273° 29′ 30.0954″"
297
- ```
58
+ [CHANGELOG]: https://github.com/rhannequin/astronoby/blob/main/CHANGELOG.md
59
+ [UPGRADING]: https://github.com/rhannequin/astronoby/blob/main/UPGRADING.md
298
60
 
299
61
  ## Precision
300
62
 
301
- The current precision for the Sun's apparent location in the sky, compared
302
- to values computed by the [IMCCE] is approximately 1 arc minute. It corresponds
303
- to twice the apparent size of Jupiter when it is the closest to Earth.
63
+ The current precision for the major Solar System bodies' location in the sky
64
+ as seen from an observer on Earth is below 10 arc seconds. It corresponds to
65
+ half the size of Saturn when it is the closest to Earth.
304
66
 
305
- While the precision is not enough for very high accuracy computations, it is
306
- equal to the Human naked eye's angular resolution.
67
+ While the precision is not enough for spacecraft navigation, it is enough for
68
+ automated guiding of amateur telescopes.
69
+
70
+ The compared sources are: [IMCCE], [JPL Horizons], [Stellarium], and the
71
+ [Skyfield] library.
307
72
 
308
73
  [IMCCE]: https://www.imcce.fr
74
+ [JPL Horizons]: https://ssd.jpl.nasa.gov/horizons.cgi
75
+ [Stellarium]: https://stellarium.org
76
+ [Skyfield]: https://rhodesmill.org/skyfield/
309
77
 
310
78
  ## Development
311
79
 
@@ -322,7 +90,9 @@ git commits and the created tag, and push the `.gem` file to [rubygems.org].
322
90
 
323
91
  ## Contributing
324
92
 
325
- Please see [CONTRIBUTING.md](https://github.com/rhannequin/astronoby/blob/main/CONTRIBUTING.md).
93
+ Please see [CONTRIBUTING.md].
94
+
95
+ [CONTRIBUTING.md]: https://github.com/rhannequin/astronoby/blob/main/CONTRIBUTING.md
326
96
 
327
97
  [code of conduct]: https://github.com/rhannequin/astronoby/blob/main/CODE_OF_CONDUCT.md
328
98
 
@@ -335,6 +105,6 @@ The gem is available as open source under the terms of the [MIT License].
335
105
  ## Code of Conduct
336
106
 
337
107
  Everyone interacting in the Astronoby project's codebases, issue trackers, chat
338
- rooms and mailing lists is expected to follow the [code of conduct].
108
+ rooms and mailing lists are expected to follow the [code of conduct].
339
109
 
340
110
  [code of conduct]: https://github.com/rhannequin/astronoby/blob/main/CODE_OF_CONDUCT.md