skymap 0.1.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 +4 -4
- data/CHANGELOG.md +53 -0
- data/README.md +186 -3
- data/data/constellations/iau/boundaries.csv +5110 -0
- data/data/constellations/iau/names.csv +89 -0
- data/lib/skymap/canvas.rb +9 -0
- data/lib/skymap/catalog/constellation_boundaries.rb +45 -0
- data/lib/skymap/catalog/constellation_lines.rb +3 -1
- data/lib/skymap/catalog/constellation_names.rb +26 -0
- data/lib/skymap/catalog/stars.rb +2 -0
- data/lib/skymap/constellation_boundary.rb +5 -0
- data/lib/skymap/context.rb +10 -7
- data/lib/skymap/horizon.rb +73 -0
- data/lib/skymap/layers/constellation_boundaries.rb +23 -0
- data/lib/skymap/layers/constellation_lines.rb +6 -31
- data/lib/skymap/layers/constellation_names.rb +46 -0
- data/lib/skymap/layers/ecliptic.rb +44 -0
- data/lib/skymap/layers/moon.rb +40 -0
- data/lib/skymap/layers/planets.rb +77 -0
- data/lib/skymap/layers/stars.rb +3 -10
- data/lib/skymap/layers/sun.rb +29 -0
- data/lib/skymap/renderer/boundary.rb +7 -0
- data/lib/skymap/renderer/caption.rb +13 -0
- data/lib/skymap/renderer/ecliptic.rb +7 -0
- data/lib/skymap/renderer/moon.rb +7 -0
- data/lib/skymap/renderer/planet.rb +7 -0
- data/lib/skymap/renderer/sun.rb +7 -0
- data/lib/skymap/renderer/svg.rb +94 -1
- data/lib/skymap/star.rb +5 -1
- data/lib/skymap/star_size.rb +15 -0
- data/lib/skymap/version.rb +1 -1
- data/lib/skymap.rb +16 -0
- metadata +22 -4
- /data/data/constellations/{iau.csv → iau/lines.csv} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 36a82d2da6f139662ddad63ac5f7a61d4228d2665106c7102a828710cf3da940
|
|
4
|
+
data.tar.gz: 446b8d777d47bc92fe8878247f61d45168f0e469180d779d304b3e66da5cb185
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3703c46d73bdad50017a6b00d06038ecb8876f7d7522b2699db3c1793d5e547e48511e372979be603ebf618bd6d0448140821e71e3397ec9c6b43eae58c18d88
|
|
7
|
+
data.tar.gz: e842f5ebbc50609e9904ac20a0f284286277b9d96eb3b24c82ed50764a3452412f6384bbb9e64592e25f54b3cc7bf5b40d2f772fb532fa1be4720f44e8e890a1
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,56 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.0] - 2026-11-01
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `Skymap::Layers::Ecliptic` draws the ecliptic, the line the Sun follows in
|
|
15
|
+
the sky, stopping at the horizon
|
|
16
|
+
- `Skymap::Layers::Planets` draws the planets, from Mercury to Neptune, sized
|
|
17
|
+
by their magnitude, down to a `magnitude_limit:` (5 by default), from an
|
|
18
|
+
ephemeris given with `ephem:`, and writes their names with `labels: true`
|
|
19
|
+
or the names given with `names:`
|
|
20
|
+
- `Skymap::Layers::Sun` draws the Sun where it is in the sky, from an ephemeris
|
|
21
|
+
given with `ephem:`
|
|
22
|
+
- `Skymap::Layers::ConstellationNames` writes the name of each constellation in
|
|
23
|
+
the middle of its stars, from `Skymap::Catalog::ConstellationNames` or the
|
|
24
|
+
names given with `names:`
|
|
25
|
+
- `Skymap::Catalog::ConstellationNames` gives the English name of each of the
|
|
26
|
+
88 IAU constellations
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- `Skymap::Canvas` raises an `ArgumentError` when the padding is negative or
|
|
31
|
+
leaves no room for the sky
|
|
32
|
+
- Rendering is about 20 times faster: the precession, nutation and sidereal
|
|
33
|
+
time are computed once per chart instead of once per point, using
|
|
34
|
+
`Astronoby::HorizontalTransformation`
|
|
35
|
+
- Skymap requires Astronoby 0.11 or later
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- The catalogs give an enumerator when `each` is called without a block,
|
|
40
|
+
instead of raising a `LocalJumpError`
|
|
41
|
+
|
|
42
|
+
## [0.2.0] - 2026-10-27
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- `Skymap::Layers::ConstellationBoundaries` draws the boundaries between the
|
|
47
|
+
constellations as thin dashed lines, stopping at the horizon
|
|
48
|
+
- `Skymap::Catalog::ConstellationBoundaries` gives the borders of the 88 IAU
|
|
49
|
+
constellations, in J2000 coordinates
|
|
50
|
+
- `Skymap::Layers::Moon` draws the Moon with its phase, where it is in the sky,
|
|
51
|
+
from an ephemeris given with `ephem:`
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- The data of the constellations lives in `data/constellations/iau/`:
|
|
56
|
+
`data/constellations/iau.csv` is now `data/constellations/iau/lines.csv`
|
|
57
|
+
|
|
8
58
|
## [0.1.0] - 2026-10-05
|
|
9
59
|
|
|
10
60
|
### Added
|
|
@@ -29,6 +79,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
79
|
|
|
30
80
|
- Initial release to reserve the gem name on RubyGems.org
|
|
31
81
|
|
|
82
|
+
[Unreleased]: https://github.com/rhannequin/skymap/compare/v0.3.0...HEAD
|
|
83
|
+
[0.3.0]: https://github.com/rhannequin/skymap/compare/v0.2.0...v0.3.0
|
|
84
|
+
[0.2.0]: https://github.com/rhannequin/skymap/compare/v0.1.0...v0.2.0
|
|
32
85
|
[0.1.0]: https://github.com/rhannequin/skymap/compare/v0.0.1...v0.1.0
|
|
33
86
|
[0.0.1]: https://github.com/rhannequin/skymap/releases/tag/v0.0.1
|
|
34
87
|
[Astronoby]: https://github.com/rhannequin/astronoby
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Skymap is a Ruby library for generating maps of the sky.
|
|
|
9
9
|
<img
|
|
10
10
|
src="https://raw.githubusercontent.com/rhannequin/skymap/main/sky_map.svg"
|
|
11
11
|
width="480"
|
|
12
|
-
alt="The sky over Paris on September 24, 2026 at 22:00 UTC, with the stars and the
|
|
12
|
+
alt="The sky over Paris on September 24, 2026 at 22:00 UTC, with the stars, the constellation lines, boundaries and names, the ecliptic, the Moon and Saturn"
|
|
13
13
|
>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
@@ -49,6 +49,9 @@ stars = Skymap::Catalog::Stars.new.to_a
|
|
|
49
49
|
|
|
50
50
|
chart = Skymap::Chart.new(observer: observer, instant: instant, canvas: canvas)
|
|
51
51
|
svg = chart.render(
|
|
52
|
+
Skymap::Layers::ConstellationBoundaries.new(
|
|
53
|
+
boundaries: Skymap::Catalog::ConstellationBoundaries.new
|
|
54
|
+
),
|
|
52
55
|
Skymap::Layers::ConstellationLines.new(
|
|
53
56
|
lines: Skymap::Catalog::ConstellationLines.new,
|
|
54
57
|
stars: stars
|
|
@@ -95,6 +98,16 @@ fewer stars:
|
|
|
95
98
|
Skymap::Layers::Stars.new(stars: stars, magnitude_limit: 6)
|
|
96
99
|
```
|
|
97
100
|
|
|
101
|
+
#### Constellation boundaries
|
|
102
|
+
|
|
103
|
+
`Skymap::Layers::ConstellationBoundaries` draws the boundaries between the
|
|
104
|
+
constellations as thin dashed lines, and stops the ones that cross the horizon
|
|
105
|
+
at the edge of the sky. `Skymap::Catalog::ConstellationBoundaries` gives the
|
|
106
|
+
borders of the 88 IAU constellations (see [Data sources](#data-sources)).
|
|
107
|
+
|
|
108
|
+
Layers are drawn in the order they are given: put the boundaries first to draw
|
|
109
|
+
them below the lines and the stars.
|
|
110
|
+
|
|
98
111
|
#### Constellation lines
|
|
99
112
|
|
|
100
113
|
`Skymap::Layers::ConstellationLines` draws the lines of the constellations.
|
|
@@ -120,6 +133,126 @@ end
|
|
|
120
133
|
Skymap::Layers::ConstellationLines.new(lines: asterisms, stars: stars)
|
|
121
134
|
```
|
|
122
135
|
|
|
136
|
+
#### Constellation names
|
|
137
|
+
|
|
138
|
+
`Skymap::Layers::ConstellationNames` writes the name of each constellation in
|
|
139
|
+
the middle of its stars. It takes the same lines and stars as the
|
|
140
|
+
constellation lines layer, since the lines tell which stars belong to which
|
|
141
|
+
constellation:
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
lines = Skymap::Catalog::ConstellationLines.new.to_a
|
|
145
|
+
|
|
146
|
+
Skymap::Layers::ConstellationNames.new(lines: lines, stars: stars)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Reading the lines into an array with `to_a`, once, saves the layers from
|
|
150
|
+
reading the file again each.
|
|
151
|
+
|
|
152
|
+
A constellation is named when more than half of its stars are above the
|
|
153
|
+
horizon. When its figure is in several parts, such as Serpens, the name goes in
|
|
154
|
+
the middle of the biggest part that is above the horizon. Mensa and
|
|
155
|
+
Microscopium have no lines, so they have no name on the map.
|
|
156
|
+
|
|
157
|
+
The names are in English, from `Skymap::Catalog::ConstellationNames`. Use
|
|
158
|
+
`names:` to write them differently: it takes anything that gives a name from
|
|
159
|
+
the IAU abbreviation of a constellation, such as a hash. A constellation
|
|
160
|
+
without a name is left out:
|
|
161
|
+
|
|
162
|
+
```ruby
|
|
163
|
+
Skymap::Layers::ConstellationNames.new(
|
|
164
|
+
lines: lines,
|
|
165
|
+
stars: stars,
|
|
166
|
+
names: {"UMa" => "Grande Ourse", "UMi" => "Petite Ourse"}
|
|
167
|
+
)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Moon
|
|
171
|
+
|
|
172
|
+
`Skymap::Layers::Moon` draws the Moon where it is in the sky, with its phase.
|
|
173
|
+
The Moon is drawn upright, as the observer sees it from the ground, so a
|
|
174
|
+
crescent over the western horizon is tilted as it is in the real sky. On the
|
|
175
|
+
chart, this means the lit side does not always face the Sun's position.
|
|
176
|
+
|
|
177
|
+
Astronoby needs an ephemeris to compute where the Moon is: download one once,
|
|
178
|
+
load it and give it to the layer (see the
|
|
179
|
+
[Astronoby documentation][astronoby-ephem] to pick one):
|
|
180
|
+
|
|
181
|
+
```ruby
|
|
182
|
+
Astronoby::Ephem.download(name: "inpop19a.bsp", target: "inpop19a.bsp")
|
|
183
|
+
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
184
|
+
|
|
185
|
+
Skymap::Layers::Moon.new(ephem: ephem)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The Moon is drawn larger than it is, as on most sky maps: at its true size it
|
|
189
|
+
would be a dot as small as the faintest stars. Its radius is 3% of the radius
|
|
190
|
+
of the sky. When the center of the Moon is below the horizon, it is left out.
|
|
191
|
+
|
|
192
|
+
#### Sun
|
|
193
|
+
|
|
194
|
+
`Skymap::Layers::Sun` draws the Sun where it is in the sky. Like the Moon, it
|
|
195
|
+
needs an ephemeris (see [Moon](#moon)):
|
|
196
|
+
|
|
197
|
+
```ruby
|
|
198
|
+
Skymap::Layers::Sun.new(ephem: ephem)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The Sun is drawn larger than it is, at the same size as the Moon: 3% of the
|
|
202
|
+
radius of the sky. When the center of the Sun is below the horizon, it is left
|
|
203
|
+
out.
|
|
204
|
+
|
|
205
|
+
#### Planets
|
|
206
|
+
|
|
207
|
+
`Skymap::Layers::Planets` draws the planets, from Mercury to Neptune, where
|
|
208
|
+
they are in the sky. They need an ephemeris too (see [Moon](#moon)). A planet
|
|
209
|
+
is drawn as a star would be, bigger the brighter it is, with a warm tint so it
|
|
210
|
+
stands out from the stars:
|
|
211
|
+
|
|
212
|
+
```ruby
|
|
213
|
+
Skymap::Layers::Planets.new(ephem: ephem)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
As for the stars, only planets of magnitude 5 or brighter are drawn by
|
|
217
|
+
default, which leaves out Uranus and Neptune. Use `magnitude_limit:` to draw
|
|
218
|
+
more or fewer planets. The magnitude of a planet changes over time, so a
|
|
219
|
+
planet can come in and out of the map:
|
|
220
|
+
|
|
221
|
+
```ruby
|
|
222
|
+
Skymap::Layers::Planets.new(ephem: ephem, magnitude_limit: 6)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Planets below the horizon are left out.
|
|
226
|
+
|
|
227
|
+
Use `labels: true` to write the name of each planet next to it, on the side of
|
|
228
|
+
the center of the map so it stays inside the sky:
|
|
229
|
+
|
|
230
|
+
```ruby
|
|
231
|
+
Skymap::Layers::Planets.new(ephem: ephem, labels: true)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
The names are in English. Use `names:` to write them differently, with a hash
|
|
235
|
+
of the planets (`:mercury`, `:venus`, `:mars`, `:jupiter`, `:saturn`,
|
|
236
|
+
`:uranus` and `:neptune`). A planet without a name is drawn without it:
|
|
237
|
+
|
|
238
|
+
```ruby
|
|
239
|
+
Skymap::Layers::Planets.new(
|
|
240
|
+
ephem: ephem,
|
|
241
|
+
labels: true,
|
|
242
|
+
names: {saturn: "Saturne", jupiter: "Jupiter"}
|
|
243
|
+
)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Ecliptic
|
|
247
|
+
|
|
248
|
+
`Skymap::Layers::Ecliptic` draws the ecliptic, the line the Sun follows in the
|
|
249
|
+
sky over a year. The Moon and the planets are always close to it. It needs no
|
|
250
|
+
data, and it stops at the horizon:
|
|
251
|
+
|
|
252
|
+
```ruby
|
|
253
|
+
Skymap::Layers::Ecliptic.new
|
|
254
|
+
```
|
|
255
|
+
|
|
123
256
|
#### Cardinal directions
|
|
124
257
|
|
|
125
258
|
`Skymap::Layers::CardinalDirections` labels the cardinal directions (N, E, S,
|
|
@@ -148,8 +281,8 @@ description of the VizieR service was published in 2000, A&AS 143, 23.
|
|
|
148
281
|
|
|
149
282
|
### Constellations
|
|
150
283
|
|
|
151
|
-
`data/constellations/iau.csv` holds the lines of the 88 IAU
|
|
152
|
-
(Mensa and Microscopium have none), one row per segment:
|
|
284
|
+
`data/constellations/iau/lines.csv` holds the lines of the 88 IAU
|
|
285
|
+
constellations (Mensa and Microscopium have none), one row per segment:
|
|
153
286
|
|
|
154
287
|
- `constellation`: the IAU abbreviation of the constellation.
|
|
155
288
|
- `from_hr`, `to_hr`: the ends of the segment, as HR numbers of stars of
|
|
@@ -170,6 +303,52 @@ The file was transcribed once from the vector PDF of each map, by matching the
|
|
|
170
303
|
ends of the lines drawn on the maps to the stars of the catalog, and checked
|
|
171
304
|
against the maps. It is not regenerated by a script.
|
|
172
305
|
|
|
306
|
+
### Constellation names
|
|
307
|
+
|
|
308
|
+
`data/constellations/iau/names.csv` gives the English name of each of the 88
|
|
309
|
+
IAU constellations from its IAU abbreviation, as listed by the International
|
|
310
|
+
Astronomical Union.
|
|
311
|
+
|
|
312
|
+
### Constellation boundaries
|
|
313
|
+
|
|
314
|
+
`data/constellations/iau/boundaries.csv` holds the borders between the 88 IAU
|
|
315
|
+
constellations, one row per point of a border, in order:
|
|
316
|
+
|
|
317
|
+
- `border`: the number of the border. Each border between two constellations
|
|
318
|
+
is listed once.
|
|
319
|
+
- `constellations`: the IAU abbreviations of the two constellations the border
|
|
320
|
+
separates.
|
|
321
|
+
- `right_ascension` (hours) and `declination` (degrees): the coordinates of
|
|
322
|
+
the point, in J2000. The borders of the constellations are straight lines of
|
|
323
|
+
right ascension and declination in B1875, and curves in J2000: there is a
|
|
324
|
+
point about every degree to follow them.
|
|
325
|
+
|
|
326
|
+
The borders come from the [Catalogue of Constellation Boundary Data][vi49] by
|
|
327
|
+
Davenhall and Leggett (VizieR VI/49), in the version of Bill J. Gray that
|
|
328
|
+
lists the constellation on each side of a border. They are the boundaries
|
|
329
|
+
defined by Delporte in 1930, in B1875 coordinates.
|
|
330
|
+
|
|
331
|
+
> Davenhall, A. C., Leggett, S. K., 1989, _Catalogue of Constellation Boundary
|
|
332
|
+
> Data_, Royal Observatory Edinburgh.
|
|
333
|
+
|
|
334
|
+
The file is generated with `bin/build_boundaries`, which downloads the
|
|
335
|
+
catalog from CDS, keeps each shared border once, adds the points along the
|
|
336
|
+
borders and precesses them to J2000 with Astronoby.
|
|
337
|
+
|
|
338
|
+
### Ephemeris of the tests
|
|
339
|
+
|
|
340
|
+
The tests of the Sun, the Moon and the planets use
|
|
341
|
+
`spec/fixtures/de440s_2025_2030_excerpt.bsp`, an excerpt of DE440s, the
|
|
342
|
+
planetary and lunar ephemeris of the [Jet Propulsion Laboratory][jpl-ephemerides],
|
|
343
|
+
distributed by [NAIF][naif]. It only keeps the barycenters of the planets, the
|
|
344
|
+
Sun, the Moon and the Earth, from 2025 to 2030. As NAIF asks for modified
|
|
345
|
+
kernels, its comment area names this project as the last to modify it, and
|
|
346
|
+
points to the original kernel. It is not part of the gem.
|
|
347
|
+
|
|
348
|
+
> Park, R. S., Folkner, W. M., Williams, J. G., Boggs, D. H., 2021, _The JPL
|
|
349
|
+
> Planetary and Lunar Ephemerides DE440 and DE441_, The Astronomical Journal,
|
|
350
|
+
> 161, 105.
|
|
351
|
+
|
|
173
352
|
## Development
|
|
174
353
|
|
|
175
354
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
@@ -212,5 +391,9 @@ rooms and mailing lists is expected to follow the
|
|
|
212
391
|
[MIT License]: https://opensource.org/licenses/MIT
|
|
213
392
|
[bsc5]: https://cdsarc.cds.unistra.fr/viz-bin/cat/V/50
|
|
214
393
|
[vizier-doi]: https://doi.org/10.26093/cds/vizier
|
|
394
|
+
[astronoby-ephem]: https://github.com/rhannequin/astronoby/blob/main/docs/ephem.md
|
|
215
395
|
[oae-maps]: https://www.astro4edu.org/
|
|
396
|
+
[vi49]: https://cdsarc.cds.unistra.fr/viz-bin/cat/VI/49
|
|
397
|
+
[jpl-ephemerides]: https://ssd.jpl.nasa.gov/planets/eph_export.html
|
|
398
|
+
[naif]: https://naif.jpl.nasa.gov/naif/rules.html
|
|
216
399
|
[cc-by-4]: https://creativecommons.org/licenses/by/4.0/
|