astronoby 0.8.0 → 0.10.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 +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +159 -0
- data/README.md +12 -5
- data/UPGRADING.md +109 -0
- data/docs/README.md +109 -16
- data/docs/angles.md +2 -1
- data/docs/configuration.md +20 -17
- data/docs/coordinates.md +73 -13
- data/docs/deep_sky_bodies.md +101 -0
- data/docs/ephem.md +6 -3
- data/docs/equinoxes_solstices_times.md +4 -3
- data/docs/glossary.md +97 -1
- data/docs/iers.md +40 -0
- data/docs/instant.md +21 -16
- data/docs/lunar_eclipses.md +93 -0
- data/docs/lunar_observation.md +87 -0
- data/docs/moon_phases.md +5 -2
- data/docs/observer.md +21 -7
- data/docs/planetary_phenomena.md +78 -0
- data/docs/reference_frames.md +193 -35
- data/docs/rise_transit_set_times.md +10 -8
- data/docs/{celestial_bodies.md → solar_system_bodies.md} +27 -5
- data/docs/twilight_times.md +25 -21
- data/lib/astronoby/angle.rb +69 -4
- data/lib/astronoby/angles/dms.rb +18 -1
- data/lib/astronoby/angles/hms.rb +14 -1
- data/lib/astronoby/angular_velocity.rb +97 -0
- data/lib/astronoby/bodies/deep_sky_object.rb +49 -0
- data/lib/astronoby/bodies/deep_sky_object_position.rb +142 -0
- data/lib/astronoby/bodies/earth.rb +9 -42
- data/lib/astronoby/bodies/jupiter.rb +10 -0
- data/lib/astronoby/bodies/mars.rb +10 -0
- data/lib/astronoby/bodies/mercury.rb +10 -0
- data/lib/astronoby/bodies/moon.rb +162 -15
- data/lib/astronoby/bodies/neptune.rb +10 -0
- data/lib/astronoby/bodies/saturn.rb +10 -0
- data/lib/astronoby/bodies/solar_system_body.rb +257 -53
- data/lib/astronoby/bodies/sun.rb +79 -4
- data/lib/astronoby/bodies/uranus.rb +10 -0
- data/lib/astronoby/bodies/venus.rb +10 -0
- data/lib/astronoby/body.rb +6 -0
- data/lib/astronoby/cache.rb +1 -0
- data/lib/astronoby/center.rb +84 -0
- data/lib/astronoby/constants.rb +7 -2
- data/lib/astronoby/constellation.rb +9 -1
- data/lib/astronoby/coordinates/ecliptic.rb +10 -1
- data/lib/astronoby/coordinates/equatorial.rb +66 -13
- data/lib/astronoby/coordinates/geodetic.rb +102 -0
- data/lib/astronoby/coordinates/horizontal.rb +13 -1
- data/lib/astronoby/distance.rb +41 -0
- data/lib/astronoby/duration.rb +116 -0
- data/lib/astronoby/earth_rotation.rb +70 -0
- data/lib/astronoby/equinox_solstice.rb +31 -8
- data/lib/astronoby/errors.rb +11 -0
- data/lib/astronoby/events/conjunction.rb +51 -0
- data/lib/astronoby/events/conjunction_opposition_calculator.rb +84 -0
- data/lib/astronoby/events/eclipse_phase.rb +27 -0
- data/lib/astronoby/events/extremum_calculator.rb +80 -0
- data/lib/astronoby/events/extremum_event.rb +15 -0
- data/lib/astronoby/events/greatest_elongation.rb +58 -0
- data/lib/astronoby/events/greatest_elongation_calculator.rb +56 -0
- data/lib/astronoby/events/lunar_eclipse.rb +99 -0
- data/lib/astronoby/events/lunar_eclipse_calculator.rb +285 -0
- data/lib/astronoby/events/opposition.rb +19 -0
- data/lib/astronoby/events/rise_transit_set_calculator.rb +9 -6
- data/lib/astronoby/events/rise_transit_set_event.rb +12 -1
- data/lib/astronoby/events/rise_transit_set_events.rb +12 -1
- data/lib/astronoby/events/twilight_calculator.rb +1 -1
- data/lib/astronoby/events/twilight_event.rb +24 -6
- data/lib/astronoby/events/twilight_events.rb +26 -6
- data/lib/astronoby/extremum_finder.rb +148 -0
- data/lib/astronoby/instant.rb +35 -9
- data/lib/astronoby/libration.rb +25 -0
- data/lib/astronoby/mean_obliquity.rb +8 -0
- data/lib/astronoby/moon_orientation_ephemeris.rb +69 -0
- data/lib/astronoby/moon_physical_ephemeris.rb +263 -0
- data/lib/astronoby/nutation.rb +10 -20
- data/lib/astronoby/observer.rb +67 -49
- data/lib/astronoby/orientation.rb +107 -0
- data/lib/astronoby/position.rb +16 -0
- data/lib/astronoby/precession.rb +61 -60
- data/lib/astronoby/reference_frame.rb +73 -7
- data/lib/astronoby/reference_frames/apparent.rb +25 -16
- data/lib/astronoby/reference_frames/astrometric.rb +14 -1
- data/lib/astronoby/reference_frames/geometric.rb +7 -1
- data/lib/astronoby/reference_frames/mean_of_date.rb +13 -1
- data/lib/astronoby/reference_frames/teme.rb +153 -0
- data/lib/astronoby/reference_frames/topocentric.rb +31 -5
- data/lib/astronoby/refraction.rb +26 -5
- data/lib/astronoby/root_finder.rb +83 -0
- data/lib/astronoby/rotation.rb +49 -0
- data/lib/astronoby/stellar_propagation.rb +162 -0
- data/lib/astronoby/time/greenwich_apparent_sidereal_time.rb +31 -0
- data/lib/astronoby/time/greenwich_mean_sidereal_time.rb +101 -0
- data/lib/astronoby/time/greenwich_sidereal_time.rb +41 -58
- data/lib/astronoby/time/local_apparent_sidereal_time.rb +63 -0
- data/lib/astronoby/time/local_mean_sidereal_time.rb +63 -0
- data/lib/astronoby/time/local_sidereal_time.rb +59 -26
- data/lib/astronoby/time/sidereal_time.rb +64 -0
- data/lib/astronoby/true_obliquity.rb +4 -0
- data/lib/astronoby/util/maths.rb +8 -0
- data/lib/astronoby/util/time.rb +10 -467
- data/lib/astronoby/vector.rb +10 -0
- data/lib/astronoby/velocity.rb +44 -0
- data/lib/astronoby/version.rb +1 -1
- data/lib/astronoby.rb +33 -0
- metadata +58 -6
data/docs/reference_frames.md
CHANGED
|
@@ -3,28 +3,42 @@
|
|
|
3
3
|
A given body at a given time can be perceived at different positions, depending
|
|
4
4
|
on the reference frame and the corrections applied.
|
|
5
5
|
|
|
6
|
-
Astronoby provides five reference frames for
|
|
6
|
+
Astronoby provides five reference frames for celestial bodies, forming a
|
|
7
|
+
transformation chain:
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
```
|
|
10
|
+
Geometric (BCRS)
|
|
11
|
+
→ Astrometric (GCRS)
|
|
12
|
+
→ Mean of date
|
|
13
|
+
→ Apparent
|
|
14
|
+
→ Topocentric
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Each step applies physical corrections to move closer to what an observer
|
|
18
|
+
actually sees. The standard reference systems used follow the IAU/IERS
|
|
19
|
+
conventions (see [Standard reference systems](#standard-reference-systems)
|
|
20
|
+
below).
|
|
21
|
+
|
|
22
|
+
A separate **TEME** (True Equator, Mean Equinox) frame is also available for
|
|
23
|
+
satellite tracking. See [TEME](#teme) below.
|
|
13
24
|
|
|
14
25
|
All reference frames provide this common interface:
|
|
15
26
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
- `#position`: Vector of position as x,y,z `Astronoby::Distance` objects
|
|
28
|
+
- `#velocity`: Vector of velocity as x,y,z `Astronoby::Velocity` objects
|
|
29
|
+
- `#distance`: Distance from the centre (`Astronoby::Distance`)
|
|
30
|
+
- `#center`: The centre the frame is relative to (`Astronoby::Center`)
|
|
31
|
+
- `#equatorial`: Equatorial coordinates (`Astronoby::Coordinates::Equatorial`)
|
|
32
|
+
- `#ecliptic`: Ecliptic coordinates (`Astronoby::Coordinates::Ecliptic`)
|
|
33
|
+
- `#separation_from(other)`: Angular separation to another frame
|
|
34
|
+
(`Astronoby::Angle`)
|
|
21
35
|
|
|
22
36
|
## Geometric
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
The geometric frame corresponds to the **Barycentric Celestial Reference System
|
|
39
|
+
(BCRS)**, centered on the Solar System barycentre, with axes aligned to the
|
|
40
|
+
**International Celestial Reference System (ICRS)**. It is the raw position
|
|
41
|
+
read from the ephemeris file, with no corrections applied.
|
|
28
42
|
|
|
29
43
|
```rb
|
|
30
44
|
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
@@ -36,7 +50,7 @@ geometric = moon.geometric
|
|
|
36
50
|
# => #<Astronoby::Geometric:0x000000011e7ffd40
|
|
37
51
|
|
|
38
52
|
geometric.distance.au
|
|
39
|
-
# => 1.
|
|
53
|
+
# => 1.0095091267969827
|
|
40
54
|
|
|
41
55
|
geometric.equatorial.right_ascension.str(:hms, precision: 0)
|
|
42
56
|
# => "20h 13m 52s"
|
|
@@ -44,11 +58,11 @@ geometric.equatorial.right_ascension.str(:hms, precision: 0)
|
|
|
44
58
|
|
|
45
59
|
## Astrometric
|
|
46
60
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
The astrometric frame corresponds to the **Geocentric Celestial Reference System
|
|
62
|
+
(GCRS)**, centered on the Earth's centre, with axes still aligned to the ICRS.
|
|
63
|
+
It is obtained by subtracting the Earth's barycentric position from the target's
|
|
64
|
+
light-time-corrected barycentric position. All subsequent frames are also
|
|
65
|
+
Earth-centered.
|
|
52
66
|
|
|
53
67
|
```rb
|
|
54
68
|
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
@@ -67,10 +81,13 @@ astrometric.equatorial.right_ascension.str(:hms, precision: 0)
|
|
|
67
81
|
|
|
68
82
|
## Mean of date
|
|
69
83
|
|
|
70
|
-
This
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
This frame is referred to the **mean equator and mean equinox of the date**. It
|
|
85
|
+
is obtained by applying the precession-bias matrix to the geocentric ICRS
|
|
86
|
+
position, rotating it from the ICRS axes to the mean pole and equinox at the
|
|
87
|
+
given instant.
|
|
73
88
|
|
|
89
|
+
Astronoby uses the **IAU 2006 precession** model in its Fukushima-Williams
|
|
90
|
+
four-angle parameterization, which includes the ICRS-to-J2000 frame bias.
|
|
74
91
|
|
|
75
92
|
```rb
|
|
76
93
|
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
@@ -86,11 +103,17 @@ mean_of_date.equatorial.right_ascension.str(:hms, precision: 0)
|
|
|
86
103
|
|
|
87
104
|
## Apparent
|
|
88
105
|
|
|
89
|
-
This
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
106
|
+
This frame is referred to the **true equator and true equinox of the date**. It
|
|
107
|
+
represents the position of a celestial object as seen from the centre of the
|
|
108
|
+
Earth. The following corrections are applied to the astrometric position:
|
|
109
|
+
|
|
110
|
+
- **Aberration**: relativistic stellar aberration due to Earth's velocity
|
|
111
|
+
(Explanatory Supplement, Ch. 7.2.3)
|
|
112
|
+
- **Precession**: IAU 2006 Fukushima-Williams precession-bias matrix
|
|
113
|
+
- **Nutation**: IAU 2000B 77-term nutation model
|
|
114
|
+
|
|
115
|
+
The combined N \* PB matrix rotates the aberration-corrected GCRS position into
|
|
116
|
+
the true equator and equinox frame of the date.
|
|
94
117
|
|
|
95
118
|
```rb
|
|
96
119
|
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
@@ -106,10 +129,16 @@ apparent.equatorial.right_ascension.str(:hms, precision: 0)
|
|
|
106
129
|
|
|
107
130
|
## Topocentric
|
|
108
131
|
|
|
109
|
-
This
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
132
|
+
This is the final frame in the chain, providing the position of a celestial body
|
|
133
|
+
as seen from a specific location on Earth's surface. It can only be produced
|
|
134
|
+
given an observer (`Astronoby::Observer`). It provides an additional set of
|
|
135
|
+
coordinates: horizontal (`Astronoby::Coordinates::Horizontal`).
|
|
136
|
+
|
|
137
|
+
To go from the apparent frame (true equator and equinox) to the topocentric
|
|
138
|
+
frame, the observer's position must be transformed from the **International
|
|
139
|
+
Terrestrial Reference System (ITRS)** into the same true-equinox frame. This is
|
|
140
|
+
done by applying the **IERS polar motion matrix** (W) followed by the Earth
|
|
141
|
+
rotation via **Greenwich Apparent Sidereal Time (GAST)**.
|
|
113
142
|
|
|
114
143
|
```rb
|
|
115
144
|
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
@@ -124,15 +153,144 @@ moon = Astronoby::Moon.new(ephem: ephem, instant: instant)
|
|
|
124
153
|
topocentric = moon.observed_by(observer)
|
|
125
154
|
|
|
126
155
|
topocentric.horizontal.azimuth.str(:dms, precision: 0)
|
|
127
|
-
# => "+90° 14′
|
|
156
|
+
# => "+90° 14′ 24″"
|
|
128
157
|
```
|
|
129
158
|
|
|
130
159
|
You can learn more about observers on the [Observer page].
|
|
131
160
|
|
|
161
|
+
## Angular separation
|
|
162
|
+
|
|
163
|
+
Any two frames can be compared with `#separation_from`, which returns the
|
|
164
|
+
angular separation (an `Astronoby::Angle`, between 0° and 180°) between the two
|
|
165
|
+
targets' directions as seen from their shared centre.
|
|
166
|
+
|
|
167
|
+
The two frames may belong to different kinds of objects (a Solar System body
|
|
168
|
+
and a deep-sky object, for example) as long as they are in the same reference
|
|
169
|
+
frame and at the same instant. Otherwise the separation is not physically
|
|
170
|
+
meaningful and an `Astronoby::IncompatibleArgumentsError` is raised.
|
|
171
|
+
|
|
172
|
+
```rb
|
|
173
|
+
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
174
|
+
instant = Astronoby::Instant.from_time(Time.utc(2020, 12, 21, 18))
|
|
175
|
+
|
|
176
|
+
jupiter = Astronoby::Jupiter.new(ephem: ephem, instant: instant)
|
|
177
|
+
saturn = Astronoby::Saturn.new(ephem: ephem, instant: instant)
|
|
178
|
+
|
|
179
|
+
# The 2020 "Great Conjunction", the closest since 1623
|
|
180
|
+
separation = jupiter.apparent.separation_from(saturn.apparent)
|
|
181
|
+
|
|
182
|
+
separation.str(:dms, precision: 0)
|
|
183
|
+
# => "+0° 6′ 6″"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## TEME
|
|
187
|
+
|
|
188
|
+
The **TEME (True Equator, Mean Equinox)** frame is the output frame of the
|
|
189
|
+
SGP4/SDP4 satellite orbit propagators. Unlike the five frames above, TEME is
|
|
190
|
+
not part of the celestial body chain — it is constructed directly from SGP4
|
|
191
|
+
output and provides its own conversion methods.
|
|
192
|
+
|
|
193
|
+
TEME shares the true equator with the apparent frame but uses the mean equinox
|
|
194
|
+
(tracked by GMST) instead of the true equinox (tracked by GAST). The
|
|
195
|
+
difference between the two is the equation of the equinoxes.
|
|
196
|
+
|
|
197
|
+
### Conversions
|
|
198
|
+
|
|
199
|
+
`Astronoby::Teme` provides three conversion methods:
|
|
200
|
+
|
|
201
|
+
- `#to_ecef` - ECEF position and velocity, using R₃(GMST) and the ω×r
|
|
202
|
+
velocity correction. The returned `EcefCoordinates` object also provides
|
|
203
|
+
a `#geodetic` method to convert to WGS-84 geodetic coordinates
|
|
204
|
+
(`Astronoby::Coordinates::Geodetic`)
|
|
205
|
+
- `#to_gcrs` - GCRS position and velocity (returns an `Astronoby::Astrometric`
|
|
206
|
+
frame), using the transposed precession and nutation matrices
|
|
207
|
+
- `#observed_by(observer)` - topocentric position as seen from a specific
|
|
208
|
+
observer (returns an `Astronoby::Topocentric` frame)
|
|
209
|
+
|
|
210
|
+
```rb
|
|
211
|
+
instant = Astronoby::Instant.from_time(Time.utc(2025, 6, 15, 12))
|
|
212
|
+
|
|
213
|
+
# Construct from SGP4 output
|
|
214
|
+
teme = Astronoby::Teme.new(
|
|
215
|
+
position: Astronoby::Distance.vector_from_meters(
|
|
216
|
+
[4_154_639.35, 768_141.62, -5_327_440.29]
|
|
217
|
+
),
|
|
218
|
+
velocity: Astronoby::Velocity.vector_from_mps(
|
|
219
|
+
[-1152.15, 7561.14, 192.76]
|
|
220
|
+
),
|
|
221
|
+
instant: instant
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
# Convert to ECEF
|
|
225
|
+
ecef = teme.to_ecef
|
|
226
|
+
ecef.position[0].km
|
|
227
|
+
# => 1196.49...
|
|
228
|
+
|
|
229
|
+
# Convert ECEF to geodetic (WGS-84)
|
|
230
|
+
geodetic = ecef.geodetic
|
|
231
|
+
geodetic.latitude.str(:dms)
|
|
232
|
+
# => "+10° 29′ 51.7526″"
|
|
233
|
+
|
|
234
|
+
# Convert to GCRS
|
|
235
|
+
gcrs = teme.to_gcrs
|
|
236
|
+
gcrs.equatorial.right_ascension.str(:hms, precision: 0)
|
|
237
|
+
# => "0h 40m 42s"
|
|
238
|
+
|
|
239
|
+
# Observe from a location
|
|
240
|
+
observer = Astronoby::Observer.new(
|
|
241
|
+
latitude: Astronoby::Angle.from_degrees(48.8566),
|
|
242
|
+
longitude: Astronoby::Angle.from_degrees(2.3522)
|
|
243
|
+
)
|
|
244
|
+
topocentric = teme.observed_by(observer)
|
|
245
|
+
topocentric.horizontal.azimuth.str(:dms, precision: 0)
|
|
246
|
+
# => "+223° 53′ 41″"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Earth rotation
|
|
250
|
+
|
|
251
|
+
`Astronoby::EarthRotation` provides standalone Earth rotation matrices:
|
|
252
|
+
|
|
253
|
+
- `EarthRotation.matrix_for(instant)` — R₃(GAST), the apparent rotation
|
|
254
|
+
matrix (used for observer placement in the true-equinox frame)
|
|
255
|
+
- `EarthRotation.mean_matrix_for(instant)` — R₃(GMST), the mean rotation
|
|
256
|
+
matrix (used for TEME ↔ ECEF conversions)
|
|
257
|
+
|
|
258
|
+
Both return 3×3 orthogonal rotation matrices that transform ECEF coordinates
|
|
259
|
+
into the corresponding celestial frame.
|
|
260
|
+
|
|
261
|
+
## Standard reference systems
|
|
262
|
+
|
|
263
|
+
The table below maps Astronoby's reference frames to standard IAU/IERS
|
|
264
|
+
reference systems and lists the corrections applied at each step.
|
|
265
|
+
|
|
266
|
+
| Astronoby frame | Standard system | Origin | Axes | Corrections applied |
|
|
267
|
+
| --------------- | --------------- | ----------------------- | ----------------------------------- | ----------------------------------------------------------------------- |
|
|
268
|
+
| Geometric | BCRS | Solar System barycentre | ICRS | None (raw ephemeris) |
|
|
269
|
+
| Astrometric | GCRS | Earth centre | ICRS | Light-time, origin shift |
|
|
270
|
+
| Mean of date | — | Earth centre | Mean equator & equinox of date | IAU 2006 precession (Fukushima-Williams, incl. frame bias) |
|
|
271
|
+
| Apparent | — | Earth centre | True equator & equinox of date | Aberration, precession, IAU 2000B nutation |
|
|
272
|
+
| Topocentric | — | Observer | True equator & equinox of date | GAST earth rotation, IERS polar motion, observer position (WGS-84/ITRS) |
|
|
273
|
+
| TEME | — | Earth centre | True equator & mean equinox of date | SGP4/SDP4 output frame; converts to ECEF, GCRS, or topocentric |
|
|
274
|
+
|
|
275
|
+
### Models and references
|
|
276
|
+
|
|
277
|
+
- **Precession**: IAU 2006 P03, Fukushima-Williams parameterization including
|
|
278
|
+
ICRS frame bias (IERS Conventions 2010, Section 5.6.4; ERFA `eraPfw06` /
|
|
279
|
+
`eraFw2m`)
|
|
280
|
+
- **Nutation**: IAU 2000B, 77-term truncation of the IAU 2000A model (IERS
|
|
281
|
+
Conventions 2010, Section 5.5.2)
|
|
282
|
+
- **Aberration**: Relativistic stellar aberration (Explanatory Supplement to the
|
|
283
|
+
Astronomical Almanac, Ch. 7.2.3)
|
|
284
|
+
- **Earth rotation**: Greenwich Apparent Sidereal Time (GAST) computed as GMST +
|
|
285
|
+
equation of equinoxes (IERS Conventions 2010, Section 5.5.7)
|
|
286
|
+
- **Polar motion**: IERS Earth Orientation Parameters via the `iers` gem
|
|
287
|
+
- **Observer coordinates**: WGS-84 geodetic to geocentric (ITRS/ECEF) conversion
|
|
288
|
+
|
|
132
289
|
## See also
|
|
290
|
+
|
|
133
291
|
- [Coordinates](coordinates.md) - for understanding coordinate systems
|
|
134
292
|
- [Observer](observer.md) - for location setup
|
|
135
|
-
- [
|
|
293
|
+
- [Solar System Bodies](solar_system_bodies.md) - for object positions
|
|
136
294
|
- [Ephemerides](ephem.md) - for data sources
|
|
137
295
|
|
|
138
296
|
[Observer page]: observer.md
|
|
@@ -10,12 +10,13 @@ Once instantiated, the calculator doesn't do anything yet, it waits for your
|
|
|
10
10
|
instruction.
|
|
11
11
|
|
|
12
12
|
It takes as key arguments:
|
|
13
|
-
* `body` (`Astronoby::SolarSystemBody`): any supported celestial body,
|
|
14
|
-
e.g. `Astronoby::Sun`
|
|
15
|
-
* `observer` (`Astronoby::Observer`): location on Earth of the observer
|
|
16
|
-
* `ephem`: ephemeris to provide the initial raw data
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
- `body` (`Astronoby::SolarSystemBody` or `Astronoby::DeepSkyObject`): any
|
|
15
|
+
supported celestial body, e.g. `Astronoby::Sun`
|
|
16
|
+
- `observer` (`Astronoby::Observer`): location on Earth of the observer
|
|
17
|
+
- `ephem`: ephemeris to provide the initial raw data
|
|
18
|
+
|
|
19
|
+
You can learn more about [Solar System bodies] and [ephemerides].
|
|
19
20
|
|
|
20
21
|
```rb
|
|
21
22
|
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
@@ -56,7 +57,7 @@ events.transit_times
|
|
|
56
57
|
# => [2025-05-01 07:21:34 UTC, 2025-05-02 07:18:01 UTC]
|
|
57
58
|
|
|
58
59
|
events.setting_times
|
|
59
|
-
# => [2025-05-01 13:14:24 UTC, 2025-05-02 13:10:
|
|
60
|
+
# => [2025-05-01 13:14:24 UTC, 2025-05-02 13:10:58 UTC]
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
## `#events_on`
|
|
@@ -109,11 +110,12 @@ event.setting_time.localtime(utc_offset)
|
|
|
109
110
|
# => 2025-05-01 16:14:24 +0300
|
|
110
111
|
```
|
|
111
112
|
|
|
112
|
-
[
|
|
113
|
+
[Solar System bodies]: solar_system_bodies.md
|
|
113
114
|
[ephemerides]: ephem.md
|
|
114
115
|
|
|
115
116
|
## See also
|
|
117
|
+
|
|
116
118
|
- [Twilight Times](twilight_times.md) - for sun-related events
|
|
117
|
-
- [
|
|
119
|
+
- [Solar System Bodies](solar_system_bodies.md) - for object information
|
|
118
120
|
- [Observer](observer.md) - for location setup
|
|
119
121
|
- [Ephemerides](ephem.md) - for data sources
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Solar System Bodies
|
|
2
2
|
|
|
3
3
|
Currently, Astronoby only supports the following major bodies of the Solar
|
|
4
4
|
System:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
- the Sun (`Astronoby::Sun`)
|
|
7
|
+
- planets from Mercury to Neptune, including the Earth (`Astronoby::Earth`, ...)
|
|
8
|
+
- the Moon (`Astronoby::Moon`)
|
|
8
9
|
|
|
9
10
|
Given an ephemeris (`Astronoby::Ephem`) and an instant object
|
|
10
11
|
(`Astronoby::Instant`), these classes enable you to get instances which provide
|
|
@@ -21,7 +22,7 @@ venus = Astronoby::Venus.new(ephem: ephem, instant: instant)
|
|
|
21
22
|
apparent_position = venus.apparent.position
|
|
22
23
|
|
|
23
24
|
apparent_position.x.km.round
|
|
24
|
-
# => -
|
|
25
|
+
# => -148794597
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
Each of these bodies also provides its own equatorial radius
|
|
@@ -60,6 +61,26 @@ venus.constellation.abbreviation
|
|
|
60
61
|
# => "Cnc"
|
|
61
62
|
```
|
|
62
63
|
|
|
64
|
+
### `#elongation`
|
|
65
|
+
|
|
66
|
+
Apparent angular distance between the body and the Sun, as seen from Earth
|
|
67
|
+
("Sun-Earth-object" angle). Returns a `Astronoby::Angle` object.
|
|
68
|
+
|
|
69
|
+
```rb
|
|
70
|
+
venus.elongation.degrees.round
|
|
71
|
+
# => 41
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `#eastern?` and `#western?`
|
|
75
|
+
|
|
76
|
+
Whether the body lies east of the Sun (visible in the evening) or west of it
|
|
77
|
+
(visible in the morning). Both return a `Boolean`.
|
|
78
|
+
|
|
79
|
+
```rb
|
|
80
|
+
venus.eastern? # => false
|
|
81
|
+
venus.western? # => true
|
|
82
|
+
```
|
|
83
|
+
|
|
63
84
|
### `#phase_angle`
|
|
64
85
|
|
|
65
86
|
"Sun-object-Earth" angle. Returns a `Astronoby::Angle` object.
|
|
@@ -101,6 +122,7 @@ Astronoby::Venus.absolute_magnitude
|
|
|
101
122
|
[reference frames]: reference_frames.md
|
|
102
123
|
|
|
103
124
|
## See also
|
|
125
|
+
|
|
104
126
|
- [Ephemerides](ephem.md) - for understanding data sources
|
|
105
127
|
- [Reference Frames](reference_frames.md) - for coordinate systems
|
|
106
128
|
- [Observer](observer.md) - for setting up observation locations
|
data/docs/twilight_times.md
CHANGED
|
@@ -5,14 +5,15 @@ some of its light still illuminates the atmosphere, making the sky brighter than
|
|
|
5
5
|
during full night.
|
|
6
6
|
|
|
7
7
|
We usually define 4 moments when talking about twilight:
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
- sunrise/sunset: right when the Sun goes above the horizon or right after it
|
|
9
10
|
goes below the horizon. The Sun's horizon angle is 0°.
|
|
10
|
-
|
|
11
|
+
- civil twilight: when the horizon angle is between 0° and -6°. Usually, during
|
|
11
12
|
this time, artificial light is not needed yet.
|
|
12
|
-
|
|
13
|
+
- nautical twilight: when the horizon angle is between -6° and -12°. When the
|
|
13
14
|
nautical twilight starts, the difference between the horizon at sea and the
|
|
14
15
|
sky cannot be seen clearly anymore.
|
|
15
|
-
|
|
16
|
+
- astronomical twilight: when the horizon angle is between -12° and -18°. Some
|
|
16
17
|
stars can be seen during this time.
|
|
17
18
|
|
|
18
19
|
These moments change every day and depend on the observer's location. They can
|
|
@@ -24,8 +25,9 @@ Once instantiated, the calculator doesn't do anything yet, it waits for your
|
|
|
24
25
|
instruction.
|
|
25
26
|
|
|
26
27
|
It takes as key arguments:
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
- `observer` (`Astronoby::Observer`): location on Earth of the observer
|
|
30
|
+
- `ephem`: ephemeris to provide the initial raw data
|
|
29
31
|
|
|
30
32
|
You can learn more about ephemerides on the [Ephem page].
|
|
31
33
|
|
|
@@ -53,17 +55,18 @@ that will happen between two dates.
|
|
|
53
55
|
|
|
54
56
|
It returns a `Astronoby::TwilightEvents` object which exposes the 6 following
|
|
55
57
|
instance methods:
|
|
56
|
-
|
|
58
|
+
|
|
59
|
+
- `#morning_astronomical_twilight_times`: when the rising Sun reaches 18° below
|
|
57
60
|
the horizon
|
|
58
|
-
|
|
61
|
+
- `#morning_nautical_twilight_times`: when the rising Sun reaches 12° below the
|
|
59
62
|
horizon
|
|
60
|
-
|
|
63
|
+
- `#morning_civil_twilight_times`: when the rising Sun reaches 6° below the
|
|
61
64
|
horizon
|
|
62
|
-
|
|
65
|
+
- `#evening_civil_twilight_times`: when the setting Sun reaches 6° below the
|
|
63
66
|
horizon
|
|
64
|
-
|
|
67
|
+
- `#evening_nautical_twilight_times`: when the setting Sun reaches 12° below the
|
|
65
68
|
horizon
|
|
66
|
-
|
|
69
|
+
- `#evening_astronomical_twilight_times`: when the setting Sun reaches 18° below
|
|
67
70
|
the horizon
|
|
68
71
|
|
|
69
72
|
```rb
|
|
@@ -76,11 +79,11 @@ events.morning_civil_twilight_times
|
|
|
76
79
|
# =>
|
|
77
80
|
# [2025-08-01 02:29:17 UTC,
|
|
78
81
|
# 2025-08-02 02:30:21 UTC,
|
|
79
|
-
# 2025-08-03 02:31:
|
|
82
|
+
# 2025-08-03 02:31:25 UTC,
|
|
80
83
|
# 2025-08-04 02:32:30 UTC,
|
|
81
|
-
# 2025-08-05 02:33:
|
|
82
|
-
# 2025-08-06 02:34:
|
|
83
|
-
# 2025-08-07 02:35:
|
|
84
|
+
# 2025-08-05 02:33:34 UTC,
|
|
85
|
+
# 2025-08-06 02:34:39 UTC,
|
|
86
|
+
# 2025-08-07 02:35:44 UTC]
|
|
84
87
|
```
|
|
85
88
|
|
|
86
89
|
## `#event_on`
|
|
@@ -98,25 +101,26 @@ instance methods: `#morning_astronomical_twilight_time`,
|
|
|
98
101
|
event = calculator.event_on(Date.new(2025, 5, 1))
|
|
99
102
|
|
|
100
103
|
event.morning_astronomical_twilight_time
|
|
101
|
-
# => 2025-05-01 01:
|
|
104
|
+
# => 2025-05-01 01:16:21 UTC
|
|
102
105
|
|
|
103
106
|
event.morning_nautical_twilight_time
|
|
104
|
-
# => 2025-05-01 01:
|
|
107
|
+
# => 2025-05-01 01:55:54 UTC
|
|
105
108
|
|
|
106
109
|
event.evening_civil_twilight_time
|
|
107
|
-
# => 2025-05-01 17:
|
|
110
|
+
# => 2025-05-01 17:30:45 UTC
|
|
108
111
|
|
|
109
112
|
event.evening_nautical_twilight_time
|
|
110
|
-
# => 2025-05-01 18:
|
|
113
|
+
# => 2025-05-01 18:07:13 UTC
|
|
111
114
|
|
|
112
115
|
event.evening_astronomical_twilight_time
|
|
113
|
-
# => 2025-05-01 18:
|
|
116
|
+
# => 2025-05-01 18:46:47 UTC
|
|
114
117
|
```
|
|
115
118
|
|
|
116
119
|
[Ephem page]: ephem.md
|
|
117
120
|
[Observer page]: observer.md
|
|
118
121
|
|
|
119
122
|
## See also
|
|
123
|
+
|
|
120
124
|
- [Rise, Transit and Set Times](rise_transit_set_times.md) - for sun and moon events
|
|
121
125
|
- [Observer](observer.md) - for location setup
|
|
122
126
|
- [Ephemerides](ephem.md) - for data sources
|