skymap 0.1.0 → 0.2.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 +20 -0
- data/README.md +82 -3
- data/data/constellations/iau/boundaries.csv +5110 -0
- data/lib/skymap/catalog/constellation_boundaries.rb +43 -0
- data/lib/skymap/catalog/constellation_lines.rb +1 -1
- data/lib/skymap/constellation_boundary.rb +5 -0
- data/lib/skymap/context.rb +5 -2
- data/lib/skymap/horizon.rb +32 -0
- data/lib/skymap/layers/constellation_boundaries.rb +67 -0
- data/lib/skymap/layers/constellation_lines.rb +5 -30
- data/lib/skymap/layers/moon.rb +40 -0
- data/lib/skymap/renderer/boundary.rb +7 -0
- data/lib/skymap/renderer/moon.rb +7 -0
- data/lib/skymap/renderer/svg.rb +47 -0
- data/lib/skymap/version.rb +1 -1
- data/lib/skymap.rb +7 -0
- metadata +10 -2
- /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: 2a51ef1b61aec62bb35240049a14adc40f006027f59fc30178eb973791901094
|
|
4
|
+
data.tar.gz: 1f8a1488c057a526bf1eaa7f36cb24fa78fc903e0a957fd6c946a1189ddebad6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3151561266fea54c8845be6747e32d511da079ff8f0616bed97d359e39cadeddcb72d46e79f9f94a3dd8bbd27f00dd7598db65ef2a008ee68366978c1993537d
|
|
7
|
+
data.tar.gz: 205fab1dc18044a3117bc7cdd291ff18aaf5c07e47cc77e72f306acbaf1166b2b34b0b0edacc8676340d6df8b6afe96e5e09f1ad6ed9d8e96966ab38a7b51ab4
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ 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.2.0] - 2026-10-27
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `Skymap::Layers::ConstellationBoundaries` draws the boundaries between the
|
|
15
|
+
constellations as thin dashed lines, stopping at the horizon
|
|
16
|
+
- `Skymap::Catalog::ConstellationBoundaries` gives the borders of the 88 IAU
|
|
17
|
+
constellations, in J2000 coordinates
|
|
18
|
+
- `Skymap::Layers::Moon` draws the Moon with its phase, where it is in the sky,
|
|
19
|
+
from an ephemeris given with `ephem:`
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- The data of the constellations lives in `data/constellations/iau/`:
|
|
24
|
+
`data/constellations/iau.csv` is now `data/constellations/iau/lines.csv`
|
|
25
|
+
|
|
8
26
|
## [0.1.0] - 2026-10-05
|
|
9
27
|
|
|
10
28
|
### Added
|
|
@@ -29,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
47
|
|
|
30
48
|
- Initial release to reserve the gem name on RubyGems.org
|
|
31
49
|
|
|
50
|
+
[Unreleased]: https://github.com/rhannequin/skymap/compare/v0.2.0...HEAD
|
|
51
|
+
[0.2.0]: https://github.com/rhannequin/skymap/compare/v0.1.0...v0.2.0
|
|
32
52
|
[0.1.0]: https://github.com/rhannequin/skymap/compare/v0.0.1...v0.1.0
|
|
33
53
|
[0.0.1]: https://github.com/rhannequin/skymap/releases/tag/v0.0.1
|
|
34
54
|
[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
|
|
12
|
+
alt="The sky over Paris on September 24, 2026 at 22:00 UTC, with the stars, the constellation lines, the constellation boundaries and the Moon"
|
|
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,28 @@ end
|
|
|
120
133
|
Skymap::Layers::ConstellationLines.new(lines: asterisms, stars: stars)
|
|
121
134
|
```
|
|
122
135
|
|
|
136
|
+
#### Moon
|
|
137
|
+
|
|
138
|
+
`Skymap::Layers::Moon` draws the Moon where it is in the sky, with its phase.
|
|
139
|
+
The Moon is drawn upright, as the observer sees it from the ground, so a
|
|
140
|
+
crescent over the western horizon is tilted as it is in the real sky. On the
|
|
141
|
+
chart, this means the lit side does not always face the Sun's position.
|
|
142
|
+
|
|
143
|
+
Astronoby needs an ephemeris to compute where the Moon is: download one once,
|
|
144
|
+
load it and give it to the layer (see the
|
|
145
|
+
[Astronoby documentation][astronoby-ephem] to pick one):
|
|
146
|
+
|
|
147
|
+
```ruby
|
|
148
|
+
Astronoby::Ephem.download(name: "inpop19a.bsp", target: "inpop19a.bsp")
|
|
149
|
+
ephem = Astronoby::Ephem.load("inpop19a.bsp")
|
|
150
|
+
|
|
151
|
+
Skymap::Layers::Moon.new(ephem: ephem)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The Moon is drawn larger than it is, as on most sky maps: at its true size it
|
|
155
|
+
would be a dot as small as the faintest stars. Its radius is 3% of the radius
|
|
156
|
+
of the sky. When the center of the Moon is below the horizon, it is left out.
|
|
157
|
+
|
|
123
158
|
#### Cardinal directions
|
|
124
159
|
|
|
125
160
|
`Skymap::Layers::CardinalDirections` labels the cardinal directions (N, E, S,
|
|
@@ -148,8 +183,8 @@ description of the VizieR service was published in 2000, A&AS 143, 23.
|
|
|
148
183
|
|
|
149
184
|
### Constellations
|
|
150
185
|
|
|
151
|
-
`data/constellations/iau.csv` holds the lines of the 88 IAU
|
|
152
|
-
(Mensa and Microscopium have none), one row per segment:
|
|
186
|
+
`data/constellations/iau/lines.csv` holds the lines of the 88 IAU
|
|
187
|
+
constellations (Mensa and Microscopium have none), one row per segment:
|
|
153
188
|
|
|
154
189
|
- `constellation`: the IAU abbreviation of the constellation.
|
|
155
190
|
- `from_hr`, `to_hr`: the ends of the segment, as HR numbers of stars of
|
|
@@ -170,6 +205,46 @@ The file was transcribed once from the vector PDF of each map, by matching the
|
|
|
170
205
|
ends of the lines drawn on the maps to the stars of the catalog, and checked
|
|
171
206
|
against the maps. It is not regenerated by a script.
|
|
172
207
|
|
|
208
|
+
### Constellation boundaries
|
|
209
|
+
|
|
210
|
+
`data/constellations/iau/boundaries.csv` holds the borders between the 88 IAU
|
|
211
|
+
constellations, one row per point of a border, in order:
|
|
212
|
+
|
|
213
|
+
- `border`: the number of the border. Each border between two constellations
|
|
214
|
+
is listed once.
|
|
215
|
+
- `constellations`: the IAU abbreviations of the two constellations the border
|
|
216
|
+
separates.
|
|
217
|
+
- `right_ascension` (hours) and `declination` (degrees): the coordinates of
|
|
218
|
+
the point, in J2000. The borders of the constellations are straight lines of
|
|
219
|
+
right ascension and declination in B1875, and curves in J2000: there is a
|
|
220
|
+
point about every degree to follow them.
|
|
221
|
+
|
|
222
|
+
The borders come from the [Catalogue of Constellation Boundary Data][vi49] by
|
|
223
|
+
Davenhall and Leggett (VizieR VI/49), in the version of Bill J. Gray that
|
|
224
|
+
lists the constellation on each side of a border. They are the boundaries
|
|
225
|
+
defined by Delporte in 1930, in B1875 coordinates.
|
|
226
|
+
|
|
227
|
+
> Davenhall, A. C., Leggett, S. K., 1989, _Catalogue of Constellation Boundary
|
|
228
|
+
> Data_, Royal Observatory Edinburgh.
|
|
229
|
+
|
|
230
|
+
The file is generated with `bin/build_boundaries`, which downloads the
|
|
231
|
+
catalog from CDS, keeps each shared border once, adds the points along the
|
|
232
|
+
borders and precesses them to J2000 with Astronoby.
|
|
233
|
+
|
|
234
|
+
### Ephemeris of the tests
|
|
235
|
+
|
|
236
|
+
The tests of the Moon use `spec/fixtures/de440s_moon_2025_2030_excerpt.bsp`, an
|
|
237
|
+
excerpt of DE440s, the planetary and lunar ephemeris of the [Jet Propulsion
|
|
238
|
+
Laboratory][jpl-ephemerides], distributed by [NAIF][naif]. It only keeps the
|
|
239
|
+
Earth-Moon barycenter, the Sun, the Moon and the Earth, from 2025 to 2030. As
|
|
240
|
+
NAIF asks for modified kernels, its comment area names this project as the
|
|
241
|
+
last to modify it, and points to the original kernel. It is not part of the
|
|
242
|
+
gem.
|
|
243
|
+
|
|
244
|
+
> Park, R. S., Folkner, W. M., Williams, J. G., Boggs, D. H., 2021, _The JPL
|
|
245
|
+
> Planetary and Lunar Ephemerides DE440 and DE441_, The Astronomical Journal,
|
|
246
|
+
> 161, 105.
|
|
247
|
+
|
|
173
248
|
## Development
|
|
174
249
|
|
|
175
250
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
@@ -212,5 +287,9 @@ rooms and mailing lists is expected to follow the
|
|
|
212
287
|
[MIT License]: https://opensource.org/licenses/MIT
|
|
213
288
|
[bsc5]: https://cdsarc.cds.unistra.fr/viz-bin/cat/V/50
|
|
214
289
|
[vizier-doi]: https://doi.org/10.26093/cds/vizier
|
|
290
|
+
[astronoby-ephem]: https://github.com/rhannequin/astronoby/blob/main/docs/ephem.md
|
|
215
291
|
[oae-maps]: https://www.astro4edu.org/
|
|
292
|
+
[vi49]: https://cdsarc.cds.unistra.fr/viz-bin/cat/VI/49
|
|
293
|
+
[jpl-ephemerides]: https://ssd.jpl.nasa.gov/planets/eph_export.html
|
|
294
|
+
[naif]: https://naif.jpl.nasa.gov/naif/rules.html
|
|
216
295
|
[cc-by-4]: https://creativecommons.org/licenses/by/4.0/
|