astronoby 0.6.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/.standard.yml +1 -0
  4. data/CHANGELOG.md +116 -0
  5. data/Gemfile.lock +45 -23
  6. data/README.md +42 -285
  7. data/UPGRADING.md +238 -0
  8. data/lib/astronoby/aberration.rb +56 -31
  9. data/lib/astronoby/angle.rb +20 -16
  10. data/lib/astronoby/angles/dms.rb +2 -2
  11. data/lib/astronoby/angles/hms.rb +2 -2
  12. data/lib/astronoby/bodies/earth.rb +56 -0
  13. data/lib/astronoby/bodies/jupiter.rb +11 -0
  14. data/lib/astronoby/bodies/mars.rb +11 -0
  15. data/lib/astronoby/bodies/mercury.rb +11 -0
  16. data/lib/astronoby/bodies/moon.rb +50 -290
  17. data/lib/astronoby/bodies/neptune.rb +11 -0
  18. data/lib/astronoby/bodies/saturn.rb +11 -0
  19. data/lib/astronoby/bodies/solar_system_body.rb +122 -0
  20. data/lib/astronoby/bodies/sun.rb +16 -220
  21. data/lib/astronoby/bodies/uranus.rb +11 -0
  22. data/lib/astronoby/bodies/venus.rb +11 -0
  23. data/lib/astronoby/constants.rb +13 -1
  24. data/lib/astronoby/coordinates/ecliptic.rb +2 -37
  25. data/lib/astronoby/coordinates/equatorial.rb +25 -7
  26. data/lib/astronoby/coordinates/horizontal.rb +0 -46
  27. data/lib/astronoby/corrections/light_time_delay.rb +90 -0
  28. data/lib/astronoby/deflection.rb +187 -0
  29. data/lib/astronoby/distance.rb +9 -0
  30. data/lib/astronoby/ephem.rb +39 -0
  31. data/lib/astronoby/equinox_solstice.rb +21 -18
  32. data/lib/astronoby/errors.rb +4 -0
  33. data/lib/astronoby/events/moon_phases.rb +2 -1
  34. data/lib/astronoby/events/rise_transit_set_calculator.rb +352 -0
  35. data/lib/astronoby/events/rise_transit_set_event.rb +13 -0
  36. data/lib/astronoby/events/rise_transit_set_events.rb +13 -0
  37. data/lib/astronoby/events/twilight_calculator.rb +166 -0
  38. data/lib/astronoby/events/twilight_event.rb +28 -0
  39. data/lib/astronoby/instant.rb +171 -0
  40. data/lib/astronoby/mean_obliquity.rb +23 -10
  41. data/lib/astronoby/nutation.rb +227 -42
  42. data/lib/astronoby/observer.rb +55 -0
  43. data/lib/astronoby/precession.rb +91 -17
  44. data/lib/astronoby/reference_frame.rb +49 -0
  45. data/lib/astronoby/reference_frames/apparent.rb +60 -0
  46. data/lib/astronoby/reference_frames/astrometric.rb +21 -0
  47. data/lib/astronoby/reference_frames/geometric.rb +20 -0
  48. data/lib/astronoby/reference_frames/mean_of_date.rb +38 -0
  49. data/lib/astronoby/reference_frames/topocentric.rb +82 -0
  50. data/lib/astronoby/true_obliquity.rb +2 -1
  51. data/lib/astronoby/util/maths.rb +70 -73
  52. data/lib/astronoby/util/time.rb +454 -31
  53. data/lib/astronoby/vector.rb +36 -0
  54. data/lib/astronoby/velocity.rb +116 -0
  55. data/lib/astronoby/version.rb +1 -1
  56. data/lib/astronoby.rb +26 -5
  57. metadata +61 -16
  58. data/.tool-versions +0 -1
  59. data/lib/astronoby/astronomical_models/ephemeride_lunaire_parisienne.rb +0 -143
  60. data/lib/astronoby/events/observation_events.rb +0 -285
  61. data/lib/astronoby/events/rise_transit_set_iteration.rb +0 -218
  62. data/lib/astronoby/events/twilight_events.rb +0 -121
  63. data/lib/astronoby/util/astrodynamics.rb +0 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15679e58775b5058f6a154502a3e94731effe12a9c90d0a28c642b96d07aa6b2
4
- data.tar.gz: 00f9bcc5a4c0fa4111e33911ba3f1e3da4829edad54e4d1419c0d716f660ea69
3
+ metadata.gz: 3406973da55433c82cd985454453f570220feb119f8274176ed8ab0539a8c99d
4
+ data.tar.gz: c4094d2e8a6d9be6c93ef0c48a8202cec8fe8e6a8f12197f9ee930b18b1e1302
5
5
  SHA512:
6
- metadata.gz: b524b994952bfec402e42e69976c5f74d69d51e1d6fbf3b2f21327c9ed0e02011c32d897d09c216f7784c3c286ed69c11beee466207a64051aef536fbc8f5a64
7
- data.tar.gz: 5ebbd92e2bb360d2d354800b7f05d35e4e74bce01cae06c8cf8176dae286e8ae70baa39c509c2c3466b05c676d624d4942a4a7cd08546ec895255785645e235b
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,121 @@
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
+
3
119
  ## 0.6.0 - 2024-12-10
4
120
 
5
121
  _If you are upgrading: please see [UPGRADING.md]._
data/Gemfile.lock CHANGED
@@ -1,26 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- astronoby (0.6.0)
4
+ astronoby (0.7.0)
5
+ ephem (~> 0.3)
5
6
  matrix (~> 0.4.2)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- ast (2.4.2)
11
+ ast (2.4.3)
11
12
  diff-lcs (1.5.1)
12
- json (2.9.0)
13
- 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)
14
20
  lint_roller (1.1.0)
15
21
  matrix (0.4.2)
22
+ minitar (0.12.1)
23
+ numo-narray (0.9.2.1)
16
24
  parallel (1.26.3)
17
- parser (3.3.6.0)
25
+ parser (3.3.7.4)
18
26
  ast (~> 2.4.1)
19
27
  racc
28
+ prism (1.4.0)
20
29
  racc (1.8.1)
21
30
  rainbow (3.1.1)
22
31
  rake (13.2.1)
23
- regexp_parser (2.9.3)
32
+ regexp_parser (2.10.0)
24
33
  rspec (3.13.0)
25
34
  rspec-core (~> 3.13.0)
26
35
  rspec-expectations (~> 3.13.0)
@@ -34,36 +43,48 @@ GEM
34
43
  diff-lcs (>= 1.2.0, < 2.0)
35
44
  rspec-support (~> 3.13.0)
36
45
  rspec-support (3.13.2)
37
- rubocop (1.68.0)
46
+ rubocop (1.75.2)
38
47
  json (~> 2.3)
39
- language_server-protocol (>= 3.17.0)
48
+ language_server-protocol (~> 3.17.0.2)
49
+ lint_roller (~> 1.1.0)
40
50
  parallel (~> 1.10)
41
51
  parser (>= 3.3.0.2)
42
52
  rainbow (>= 2.2.2, < 4.0)
43
- regexp_parser (>= 2.4, < 3.0)
44
- rubocop-ast (>= 1.32.2, < 2.0)
53
+ regexp_parser (>= 2.9.3, < 3.0)
54
+ rubocop-ast (>= 1.44.0, < 2.0)
45
55
  ruby-progressbar (~> 1.7)
46
- unicode-display_width (>= 2.4.0, < 3.0)
47
- rubocop-ast (1.36.2)
48
- parser (>= 3.3.1.0)
49
- rubocop-performance (1.22.1)
50
- rubocop (>= 1.48.1, < 2.0)
51
- 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)
52
64
  ruby-progressbar (1.13.0)
53
- rubyzip (2.3.2)
54
- standard (1.42.1)
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)
55
73
  language_server-protocol (~> 3.17.0.2)
56
74
  lint_roller (~> 1.0)
57
- rubocop (~> 1.68.0)
75
+ rubocop (~> 1.75.2)
58
76
  standard-custom (~> 1.0.0)
59
- standard-performance (~> 1.5)
77
+ standard-performance (~> 1.8)
60
78
  standard-custom (1.0.2)
61
79
  lint_roller (~> 1.0)
62
80
  rubocop (~> 1.50)
63
- standard-performance (1.5.0)
81
+ standard-performance (1.8.0)
64
82
  lint_roller (~> 1.1)
65
- rubocop-performance (~> 1.22.0)
66
- unicode-display_width (2.6.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)
67
88
 
68
89
  PLATFORMS
69
90
  ruby
@@ -74,6 +95,7 @@ DEPENDENCIES
74
95
  rake (~> 13.0)
75
96
  rspec (~> 3.0)
76
97
  rubyzip (~> 2.3)
98
+ simplecov (~> 0.22)
77
99
  standard (~> 1.3)
78
100
 
79
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,287 +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
- Only date part of the time is relevant for the calculation. The offset must
144
- be provided to the observer.
145
-
146
- ```rb
147
- utc_offset = "-05:00"
148
- time = Time.new(2015, 2, 5, 0, 0, 0, utc_offset)
149
- observer = Astronoby::Observer.new(
150
- latitude: Astronoby::Angle.from_degrees(38),
151
- longitude: Astronoby::Angle.from_degrees(-78),
152
- utc_offset: utc_offset
153
- )
154
- sun = Astronoby::Sun.new(time: time)
155
- observation_events = sun.observation_events(observer: observer)
156
-
157
- observation_events.rising_time.getlocal(utc_offset)
158
- # => 2015-02-05 07:12:59 -0500
159
-
160
- observation_events.rising_azimuth.str(:dms)
161
- # => "+109° 29′ 35.5069″"
162
-
163
- observation_events.transit_time.getlocal(utc_offset)
164
- # => 2015-02-05 12:25:59 -0500
165
-
166
- observation_events.transit_altitude.str(:dms)
167
- # => "+36° 8′ 14.9673″"
38
+ [Bundler]: https://bundler.io
168
39
 
169
- observation_events.setting_time.getlocal(utc_offset)
170
- # => 2015-02-05 17:39:27 -0500
40
+ ## Usage Documentation
171
41
 
172
- observation_events.setting_azimuth.str(:dms)
173
- # => "+250° 40′ 41.7129″"
174
- ```
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].
175
45
 
176
- #### Twilight times
46
+ [Wiki]: https://github.com/rhannequin/astronoby/wiki
47
+ [release]: https://github.com/rhannequin/astronoby/releases
177
48
 
178
- ```rb
179
- time = Time.new(2024, 1, 1)
180
- sun = Astronoby::Sun.new(time: time)
181
- observer = Astronoby::Observer.new(
182
- latitude: Astronoby::Angle.from_degrees(48.8566),
183
- longitude: Astronoby::Angle.from_degrees(2.3522)
184
- )
185
- twilight_events = sun.twilight_events(observer: observer)
49
+ ### Expected breaking changes notice
186
50
 
187
- twilight_events.morning_astronomical_twilight_time
188
- # => 2024-01-01 05:49:25 UTC
189
-
190
- twilight_events.morning_nautical_twilight_time
191
- # => 2024-01-01 06:27:42 UTC
192
-
193
- twilight_events.morning_civil_twilight_time
194
- # => 2024-01-01 07:07:50 UTC
195
-
196
- twilight_events.evening_civil_twilight_time
197
- # => 2024-01-01 16:40:01 UTC
198
-
199
- twilight_events.evening_nautical_twilight_time
200
- # => 2024-01-01 17:20:10 UTC
201
-
202
- twilight_events.evening_astronomical_twilight_time
203
- # => 2024-01-01 17:58:26 UTC
204
- ```
205
-
206
- ### Solstice and Equinox times
207
-
208
- ```rb
209
- year = 2024
210
-
211
- Astronoby::EquinoxSolstice.march_equinox(year)
212
- # => 2024-03-20 03:05:08 UTC
213
-
214
- Astronoby::EquinoxSolstice.june_solstice(year)
215
- # => 2024-06-20 20:50:18 UTC
216
- ```
217
-
218
- ### Moon
219
-
220
- #### Moon's location in the sky
221
-
222
- ```rb
223
- time = Time.utc(2023, 2, 17, 11, 0, 0)
224
-
225
- observer = Astronoby::Observer.new(
226
- latitude: Astronoby::Angle.from_degrees(48.8566),
227
- longitude: Astronoby::Angle.from_degrees(2.3522)
228
- )
229
-
230
- moon = Astronoby::Moon.new(time: time)
231
-
232
- horizontal_coordinates = moon.horizontal_coordinates(
233
- observer: observer
234
- )
235
-
236
- horizontal_coordinates.altitude.degrees
237
- # => 10.277834691708053
238
-
239
- horizontal_coordinates.altitude.str(:dms)
240
- # => "+10° 16′ 40.2048″"
241
- ```
242
-
243
- #### Moon's current attributes
244
-
245
- ```rb
246
- time = Time.utc(2024, 6, 1, 10, 0, 0)
247
- moon = Astronoby::Moon.new(time: time)
248
-
249
- moon.illuminated_fraction.round(2)
250
- # => 0.31
251
-
252
- moon.current_phase_fraction.round(2)
253
- # => 0.82
254
-
255
- moon.distance.km.round
256
- # => 368409
257
-
258
- moon.phase_angle.degrees.round
259
- # => 112
260
- ```
261
-
262
- #### Moon's phases of the month
263
-
264
- ```rb
265
- june_phases = Astronoby::Moon.monthly_phase_events(
266
- year: 2024,
267
- month: 6
268
- )
269
-
270
- june_phases.each { puts "#{_1.phase}: #{_1.time}" }
271
- # new_moon: 2024-06-06 12:37:41 UTC
272
- # first_quarter: 2024-06-14 05:18:28 UTC
273
- # full_moon: 2024-06-22 01:07:53 UTC
274
- # last_quarter: 2024-06-28 21:53:25 UTC
275
- ```
276
-
277
- #### Moonrise and moonset times and azimuths
278
-
279
- Only date part of the time is relevant for the calculation. The offset must
280
- be provided to the observer.
281
-
282
- ```rb
283
- utc_offset = "-10:00"
284
- time = Time.new(2024, 9, 1, 0, 0, 0, utc_offset)
285
- observer = Astronoby::Observer.new(
286
- latitude: Astronoby::Angle.from_degrees(-17.5325),
287
- longitude: Astronoby::Angle.from_degrees(-149.5677),
288
- utc_offset: utc_offset
289
- )
290
- moon = Astronoby::Moon.new(time: time)
291
- observation_events = moon.observation_events(observer: observer)
292
-
293
- observation_events.rising_time.getlocal(utc_offset)
294
- # => 2024-09-01 05:24:55 -1000
295
-
296
- observation_events.rising_azimuth.str(:dms)
297
- # => "+72° 15′ 19.1814″"
298
-
299
- observation_events.transit_time.getlocal(utc_offset)
300
- # => 2024-09-01 11:12:32 -1000
301
-
302
- observation_events.transit_altitude.str(:dms)
303
- # => "+56° 39′ 59.132″"
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.
304
54
 
305
- observation_events.setting_time.getlocal(utc_offset)
306
- # => 2024-09-01 16:12:08 -1000
55
+ Changes are documented in the [CHANGELOG] and adapting to breaking changes is
56
+ described in the [UPGRADING] document.
307
57
 
308
- observation_events.setting_azimuth.str(:dms)
309
- # => "+290° 25′ 42.5421″"
310
- ```
58
+ [CHANGELOG]: https://github.com/rhannequin/astronoby/blob/main/CHANGELOG.md
59
+ [UPGRADING]: https://github.com/rhannequin/astronoby/blob/main/UPGRADING.md
311
60
 
312
61
  ## Precision
313
62
 
314
- The current precision for the Sun's apparent location in the sky, compared
315
- to values computed by the [IMCCE] is approximately 1 arc minute. It corresponds
316
- 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.
317
66
 
318
- While the precision is not enough for very high accuracy computations, it is
319
- 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.
320
72
 
321
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/
322
77
 
323
78
  ## Development
324
79
 
@@ -335,7 +90,9 @@ git commits and the created tag, and push the `.gem` file to [rubygems.org].
335
90
 
336
91
  ## Contributing
337
92
 
338
- 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
339
96
 
340
97
  [code of conduct]: https://github.com/rhannequin/astronoby/blob/main/CODE_OF_CONDUCT.md
341
98
 
@@ -348,6 +105,6 @@ The gem is available as open source under the terms of the [MIT License].
348
105
  ## Code of Conduct
349
106
 
350
107
  Everyone interacting in the Astronoby project's codebases, issue trackers, chat
351
- 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].
352
109
 
353
110
  [code of conduct]: https://github.com/rhannequin/astronoby/blob/main/CODE_OF_CONDUCT.md