Every star catalog is a list of stars as seen from Earth: a direction (RA, Dec), a distance (parallax) and a brightness (apparent V magnitude). Alien Skies turns that list into true 3-D positions around the Sun, moves the observer to another star, and asks "what direction and how bright is each star from here?". The sky is computed, not painted.
The work is split by how often it has to happen:
Stage 1: Catalog row → 3-D position + absolute magnitude → Once per app start
Stage 2: Re-centre on the host star: new directions and magnitudes, culling, companions → Once per planet
Stage 3: Planet orbit and spin → observer's horizon → Every frame
Stage 4: Horizon → screen, and drawing → Every frame
Every vector in the program stays in ICRS-aligned axes (+X toward RA 0°/Dec 0°, +Y toward RA 90°, +Z toward the north celestial pole). Nothing is rotated into a planet-centred frame, so no rotation matrices pile up; the planet's horizon is simply three ICRS unit vectors.
The program queries three public TAP services with `pyvo` and writes three CSV files.
Hipparcos photometry and positions from VizieR I/239/hip_main: HIP number, ICRS RA/Dec, V magnitude, B−V.
Hipparcos parallaxes from the van Leeuwen 2007 new reduction, VizieR I/311/hip2.
Gaia DR3 ↔ Hipparcos cross-match (gaiadr3.hipparcos2_best_neighbour joined to gaia_source). It is used for three things:
* Parallax rescue: About 3,200 Hipparcos stars have a zero or negative parallax (useless as a distance). If Gaia's parallax for the same star is positive with a signal-to-noise of at least 5, it is used instead. Without this, β Phe, ρ Leo and about 25 other stars brighter than V 5 would vanish from every sky.
* De-duplication: when Gaia stars are added (below): any Gaia source already matched to a Hipparcos star is skipped. Kept, the two catalogs' slightly different parallaxes would split one star into a false double when seen from elsewhere.
* Colour calibration: an empirical BP−RP → B−V curve (binned medians over every Hipparcos star that has both colours, forced monotonic).
Optional Gaia DR3 top-up (--gaia-limit G, off by default): stars from G 8 (brighter ones saturate in Gaia) to the limit, with parallax_over_error > 5. V comes from G via the Riello et al. 2021 G−V polynomial, and B−V from the calibrated curve. Not shipped, because Gaia's licence is non-commercial (see THIRD-PARTY-NOTICES.md).
Overrides: α Cen A and B both get the joint system parallax of Kervella et al. 2016 (747.17 mas). Hipparcos fits them separately and puts them 0.07 pc apart along the line of sight, which would stop them being linked as a binary.
Proper names are carried over from the bundled sample, keyed by HIP.
The shipped catalog is about 117,000 Hipparcos stars, about 3,200 of them with Gaia parallaxes.
From the NASA Exoplanet Archive's Planetary Systems Composite Parameters table (pscomppars), every planet with a known system distance: name, host, RA/Dec, sy_dist, sy_vmag (host V), stellar radius and mass, semi-major axis, period, inclination, eccentricity and planet radius. The sample's hypothetical planets (such as the default "alf Cen A (hypothetical Earth)") are added back on top.
All 88 IAU figures from Stellarium's "modern" sky culture, stored as pairs of star ids that match stars.csv.
CatalogLoader looks for each file in %APPDATA%/AlienSkies/data, then a data folder next to the executable, then the host's platform source (Android APK assets), then the small sample embedded in AlienSkies.Core.
CatalogLoader.ParseStars turns each row into a Star record:
Rows with no parallax or a non-positive one are dropped (no usable distance).
Distance: d = 1000 / parallax_mas parsecs.
Position: Equatorial.ToCartesian(ra, dec, d), i.e. d · (cos δ cos α, cos δ sin α, sin δ), heliocentric, in parsecs.
Absolute magnitude: M = V − (5 log₁₀ d − 5). Storing M rather than V is what makes the sky portable: M is a property of the star, independent of where you stand.
B−V is kept for colour; a missing value defaults to 0.6.
AlienSky.Build(system, catalog, limitingMagnitude) does the core work. The host position comes from the archive's RA, Dec and sy_dist.
For every catalog star:
rel = star.Position − host // vector from the new viewpoint, parsecs
d = |rel|
m = M + 5 log10(d) − 5 // apparent magnitude from there
direction = rel / d // unit vector, ICRS axes
Culling: stars with m fainter than the limiting magnitude (setting, default 6.5, a dark naked-eye sky) are dropped here, so the per-frame loop only ever sees visible stars.
Self radius: catalog stars within max(0.02 pc, 0.5% of the host distance) of the host position are not background stars. They are the host itself (catalog cross-match slop) or its companions, and are set aside (section 6).
Sol is added explicitly with M = 4.83 and B−V 0.65, and is always kept even when fainter than the limit, so it can be marked.
The list is sorted faint-first so bright stars are drawn on top.
Why directions are computed only once: a planet's orbit is a few AU, while the nearest star is about 270,000 AU away. Parallax from the planet's year is negligible for background stars, so star directions are fixed for the whole visit to a planet. (Companions are the exception, below.)
Proper motion and radial velocity are not propagated; positions are the Hipparcos epoch (J1991.25).
Interstellar extinction is ignored. M already carries the dust between Earth and the star, so stars seen from closer than we are look slightly too faint. Inside about 100 pc the error is under 0.1 mag.
Distant hosts get sparse skies. Hipparcos is complete only to about V 8 as seen from Earth, so a far host's own neighbours are missing. The naked-eye count drops from 8,589 at Earth to about 6,585 at 178 pc and 1,953 at 550 pc. AlienSky.IsSparse (over 150 pc) adds a warning line to the overlay.
Core/Astronomy/StarColor.cs:
Temperature from B−V (Ballesteros 2012): T = 4600 · (1/(0.92·BV + 1.7) + 1/(0.92·BV + 0.62)). The Sun (0.65) gives about 5,780 K.
Black-body colour: a precomputed table, every 0.05 in B−V from −0.4 to 2.0, of the sRGB colour of a Planck spectrum at that temperature, integrated against the CIE 1931 2° observer, D65 white point, normalised to the brightest channel. Values between entries are linearly interpolated.
Colour boost (setting, default 1.5): saturation is scaled around the colour's own luma. 1 is true colour (subtle; the Sun is nearly white), above 1 exaggerates the tint the way long-exposure photos do.
Host stars usually have no B−V in the exoplanet archive. The host's colour comes from, in order: a circumbinary table entry, the planet definition, the catalog star at the host position (only if its absolute magnitude agrees with the archive's within 1 mag), or an estimate from absolute magnitude along the main sequence.
The host star is not drawn from the catalog list; it is a sun with a disc, re-computed every frame from the planet's actual position.
Host: apparent magnitude from the host's absolute V (sy_vmag + sy_dist) at the planet's current distance in AU; angular radius from the archive stellar radius.
Companions (second suns): catalog stars inside the self radius other than the nearest one (the host). Each moves on a binary orbit (`BinaryOrbit`):
* Measured orbits from KnownBinaries (α Cen AB from Pourbaix & Boyajian 2016).
* Otherwise a stand-in: a circular, face-on orbit at the catalog's projected separation, with a Kepler's-third-law period from both stars' estimated masses. Line-of-sight offsets are discarded as noise.
* Every frame the companion is re-aimed from the planet (companionOffset(t) − planetOffset(t)), so it shows its own orbital motion and the parallax from the planet's year.
Circumbinary planets (Kepler-16, Kepler-47, TOI-1338): the pair comes from KnownBinaries, the planet orbits the barycentre, and the archive's combined V is split between the two stars by their light fractions.
Eclipses: where a nearer disc overlaps a farther one, the farther sun is dimmed by the covered fraction of its disc (uniform discs, circle-overlap geometry in AlienSky.CoveredFraction).
Disc radii are measured where known, otherwise estimated along the main sequence (R ∝ L^0.2).
PlanetFrame builds the planet's geometry once from a PlanetConfig and evaluates it at any time t (days since J2000.0).
Orbit. Archive conventions: inclination and ascending node are measured against the plane of Earth's sky at the host (Equatorial.SkyPlaneBasis gives line of sight, north and east). Inclination 90° (the default, since most well-measured planets transit) is edge-on to us, which puts our Sun close to that planet's ecliptic, so Sol passes through their zodiac. The ascending node is rarely known and defaults to 0°. The position along the orbit comes from solving Kepler's equation (Newton iteration). Missing semi-major axis or period is filled from Kepler's third law with the host mass.
Spin. The spin pole is the orbit normal tilted by the obliquity (setting) toward a chosen direction in the orbit plane. Planets with a < 0.1 AU are treated as tidally locked by default: rotation period = orbital period, phased so longitude 0° faces the star, which gives real optical libration on eccentric orbits. Otherwise the rotation period comes from settings (default 24 h).
Horizon. For the observer's latitude and longitude (settings; tour mode picks a point uniformly on the sphere):
spin = phase0 + 2π t / P_rot + longitude
zenith = (eq1 cos spin + eq2 sin spin) cos lat + pole sin lat
east = pole × zenith // (normalised)
north = zenith × east
HorizonBasis is just those three ICRS unit vectors. Per frame, the cost of "where is every star now?" is three dot products per visible star.
Time. SkyScene.TimeDays = start day + real elapsed seconds × time scale (default 600×). Day 0 is J2000.0, which is what fixes where α Cen B and Kepler-16's stars are in their orbits.
Alt/az: alt = asin(dir · zenith), az = atan2(dir · east, dir · north), azimuth from north through east (HorizonBasis.ToHorizontal, used for the overlay text).
Local frame: for drawing, each direction becomes (east, north, up) components (HorizonBasis.ToLocal).
Camera (SkyRenderer.Camera): a rectilinear (gnomonic) projection looking at a view azimuth and altitude (defaults 180° and 25°) with a field of view (default 100°) applied to the longer screen edge, so portrait phones keep a wide sky. A point projects as x = (v·right)/(v·forward) · f, y = (v·up)/(v·forward) · f with f = halfWidth / tan(fov/2)`. Points behind the camera are rejected.
Because great circles are straight lines in a gnomonic projection, the horizon is drawn as one straight-edged ground polygon. Stars below the horizon are skipped when the ground is shown.
Multi-monitor panoramas and live-wallpaper home-screen swipes just add an azimuth offset.
SkyRenderer.DrawSurface draws, in order:
Sky colour and daylight. For each sun, SmoothStep(−18°, +6°, altitude) (astronomical twilight to full day) × a strength from its magnitude (0 at mag −12, 1 at mag −26). The brightest sun wins and tints the sky, so a dim red dwarf seen up close gives a deep-twilight sky and our Sun gives full daylight.
Limiting magnitude under daylight: limit = L − starDay · (L + 3.5), where starDay is daylight reduced by the "Stars in daylight" setting (default 0.8). The sky still brightens, but kept stars show over it, drawn whiter, larger and with a dark rim.
Milky Way (section 10).
Planet's orbit plane (their ecliptic) as a dashed great circle perpendicular to the orbit normal.
Constellations: Earth's 88 figures, drawn between the re-projected positions of their stars, so they distort with distance from Earth. A line is skipped if either star is culled.
Stars: each is a filled circle in its B−V colour. Radius (0.7 + 0.45·(limit − m)) × star scale, clamped 0.6 to 7 px (× display density); alpha rises with brightness. Named stars brighter than mag 1.5 get labels; Sol gets a gold ring and its distance in light years and magnitude.
Sibling planets: other planets of the same host on their own Kepler orbits, brightness from reflected light with a Lambert phase law; large ones are drawn as phased discs.
Suns, farthest first: a radial-gradient glow (2 to 6 disc radii depending on strength) and a disc at its true angular size (at least 3 px). A cool star crossing a hotter one is drawn dark.
The renderer only knows a canvas size and a display density, so Windows, Android (screen saver and live wallpaper), macOS and the PNG Preview tool all draw identically.
Core/Astronomy/MilkyWayModel.cs is a hand-built map of the band as seen from Earth in galactic coordinates (disc, bulge, star clouds, Great Rift, Coalsack, Magellanic Clouds, plus 3-D noise). To view it from elsewhere, the band's light is treated as lying 1.5 kpc away: a viewer at x looking along u sees what Earth sees along x + 1.5 kpc·u (Galactic.EarthDirectionOf). For nearby hosts this is the identity to under a degree; a host 500 pc above the plane sees the band drop about 19°. Viewers beyond 900 pc are clamped.
Two styles: Tint (default) traces nested brightness contours once per system on a 3° grid and fills them as flat paths each frame (about +3 ms at 1080p). Detailed maps a 1024×340 texture onto a 3° mesh drawn into a low-resolution offscreen surface and stretched, because Skia's CPU rasteriser fills textured triangles slowly.
In tour mode Core/Travel/FlightSky re-projects the whole catalog every frame from a moving viewpoint (direction plus inverse-square brightness, the same m = M + 5 log₁₀ d − 5), with optional relativistic aberration and Doppler tint at a visual top speed of 0.6 c. At both ends it agrees with the planet's AlienSky, so the surface view cross-fades in with no jump.
Proxima Centauri b, looking for the Sun:
Proxima is at about 1.30 pc. Seen from there the Sun is at d = 1.30 pc, so m = 4.83 + 5 log₁₀(1.30) − 5 ≈ 0.4: a first-magnitude star.
Its direction is the exact opposite of Proxima's direction from Earth: RA ≈ 2h 30m, Dec ≈ +62.7°, which lands it in Cassiopeia, turning the "W" into a zig-zag of six stars.
α Cen A and B, about 0.06 pc away, come out around magnitude −6.6 and −5.3 (they are farther than the 0.02 pc self radius, so they count as ordinary stars, not second suns) at the same B−V colours as from Earth (temperature doesn't change with distance), and are by far the brightest "stars" in the sky.
If the previous discussion wasn't descriptive enough about how the program works, hopefully this is. This section expands the one-line summary "turn the list into true 3-D positions around the Sun, move the observer to another star, and ask what direction and how bright each star is from there". Each step names the code that does it.
Frame. ICRS, the same frame as the catalogs. It is used as a plain Cartesian frame centred on the Sun: +X toward RA 0°, Dec 0°; +Y toward RA 90°, Dec 0°; +Z toward the north celestial pole (Core/Astronomy/Equatorial.cs). Strictly, ICRS is barycentric, but the Sun–barycentre offset (about 0.005 AU) is far too small to matter.
Units. Positions are in parsecs, held in a double-precision `Vector3d` (`Core/Math/Vector3d.cs`). Planet and binary orbits are in AU, converted with 1 pc = 206,264.806 AU (`Units.cs`). Doubles keep about 15 significant digits, so even a 5,000 pc host minus a 1 pc offset loses nothing that shows.
Epoch. Positions are taken exactly as catalogued. For Hipparcos that is epoch J1991.25 (the `RAICRS`/`DEICRS` columns of I/239). Optional Gaia stars are at J2016.0 and are not moved back; that is a 25-year mismatch, which only matters for the few stars with large proper motions.
Proper motion and radial velocity are not applied at all. The fastest star on the sky, Barnard's Star, moves 10.4″ a year, so 35 years of drift is about 6′, a fifth of the Moon's width from Earth. For everything else the error is smaller. What matters more is that the sky is a snapshot of where the stars were when we measured them, not where they "are now" from the planet (see 13.4).
CatalogLoader.ParseStars, once at startup, for each row:
d = 1000 / parallax_mas // parsecs (Equatorial.ParallaxToParsecs)
r = d · ( cos δ · cos α, cos δ · sin α, sin δ ) // Equatorial.ToCartesian
M = V − (5 · log10(d) − 5) // Units.AbsoluteMagnitude
Distance is a straight inverse of parallax: no Lutz–Kelker or other bias correction, and no Bayesian distance prior. That is accurate when the parallax error is small (most stars within about 100 pc), and increasingly noisy beyond 300 pc.
Rows with parallax ≤ 0 are skipped, because they have no distance. The catalog builder has already swapped Gaia DR3 parallaxes in for about 3,200 such Hipparcos stars where Gaia's is significant (section 2).
M is the star's luminosity in magnitude units, which does not depend on the viewer. r and M, plus B−V for colour, are all the program keeps (Core/Catalog/Star.cs).
The host star's position is built the same way, from the exoplanet archive's RA, Dec and sy_dist (ExoplanetSystem.HostPosition). Then, in AlienSky.Build, once per planet:
rel = r_star − r_host // parsecs, still ICRS-aligned
d' = |rel| // distance from the new viewpoint
û = rel / d' // direction on the alien sky
That is the whole "move to another star" step. Because the axes are not rotated, û is the star's position on the alien sky expressed in ICRS axes. If you wanted it as an "alien RA and Dec" (Equatorial.FromCartesian), it is α' = atan2(û_y, û_x) and δ' = asin(û_z). Celestial north means the same direction everywhere, so these can be compared with Earth's RA and Dec directly.
The planet's own position within its system is ignored here. A planet 1 AU from its star is displaced by 1/206,265 pc, which moves a star 1 pc away by about 1″: invisible. Only companions in the host's own system (inside the 0.02 pc self radius) are recomputed every frame from the planet's actual position (section 6).
Flux falls off with the inverse square of distance, and magnitudes are −2.5 log₁₀ of flux, so:
m' = M + 5 · log10(d') − 5 // Units.ApparentMagnitude
m' = m_Earth + 5 · log10(d' / d_Earth) // the same thing, written as a change from what Earth sees
Halve the distance and a star gets 1.5 magnitudes brighter (four times the flux); double it and it gets 1.5 magnitudes fainter.
This is V-band (visual) brightness, because the catalogs give V.
Extinction. The Earth-side dust is already baked into M (it was derived from a dimmed V), and no dust is added along the new line of sight. Inside the Local Bubble (about 100 pc) both errors are under 0.1 magnitude.
Light-travel time. Each star's light reaching the planet left that star at a different time than the light we see. The program uses the catalog positions as if they were simultaneous, which, with no proper motion, is the same approximation as 13.1.
A star's color depends on its temperature, which doesn't change with distance, so B−V is carried over unchanged (VisibleStar.ColorBV) and turned into a black-body sRGB colour at draw time (section 5). The only exception is a tour flight at near-light speed, where FlightSky Doppler-shifts B−V ahead of and behind the ship.
Once per planet, by brightness. Stars with m' fainter than the limiting magnitude (default 6.5) are dropped in AlienSky.Build. Of about 117,000 catalog stars, roughly 8,000 to 9,000 survive for a nearby host, and that short list is all the per-frame code ever touches. Sol is always kept so it can be marked.
Every frame, by daylight. The effective limit drops as the sky brightens: limit = L − starDay · (L + 3.5). With the sun well up and "Stars in daylight" at 0, only stars brighter than about −3.5 would show.
Every frame, by horizon. With the ground shown, anything with a negative "up" component is skipped.
Every frame, by camera. Points behind the camera, or more than four screen half-widths outside the view, are rejected by Camera.Project.
PlanetFrame.Horizon(t) gives three ICRS unit vectors for the observer at time t: zenith z, north n and east e (section 7). For any star direction û:
local = ( û·e, û·n, û·z ) // east, north, up (HorizonBasis.ToLocal)
alt = asin(û·z)
az = atan2(û·e, û·n) // from north through east (HorizonBasis.ToHorizontal)
The planet's rotation, orbit, tilt and the observer's latitude and longitude all live in z, n and e. So the star list never changes while the sky turns. Only these three vectors do, and each star costs three dot products per frame.
SkyRenderer.Camera is a pinhole (gnomonic, rectilinear) camera in the local east-north-up frame:
forward = (cos a · sin A, cos a · cos A, sin a) // view azimuth A, altitude a
right = normalise(forward × up)
camUp = right × forward
f = (longer screen edge / 2) / tan(FOV / 2) // focal length in pixels
depth = local · forward //(rejected if ≤ 0.001: behind the viewer)
x_px = W/2 + f · (local · right) / depth
y_px = H/2 − f · (local · camUp) / depth // (screen y grows downward)
This is the same projection as a normal camera lens. Straight lines on screen are great circles on the sky, which is why the horizon and the orbit plane can be drawn as lines and paths.
Near the edge of a wide field of view the projection stretches things, as a wide-angle lens does. At the default 100°, things at the left and right edges look about 2.4× larger than at the centre (1 / cos² 50°), and more in the corners.
The field of view applies to the longer edge, so a portrait phone keeps a wide sky.
SkyRenderer.DrawStars maps magnitude to a filled circle:
radius = clamp( (0.7 + 0.45 · (limit − m')) · StarScale, 0.6, 7 ) · density // pixels
alpha = clamp( (limit − m' + 0.6) / 2.5 · 255, 60, 255 )
color = StarColor.FromBV(B−V, ColorBoost)
So a star at the limit is a faint dot 0.7 px across, and each magnitude brighter adds 0.45 px of radius until it caps at 7 px. This is a display mapping chosen for readability, not a physical point-spread function. Stars are drawn faint first, so bright ones end up on top.
From the bundled sample catalog, for Proxima Cen b (host at RA 217.4289°, Dec −62.6795°, 1.301 pc):
Sun Sirius α Cen A
Catalog (Earth) — RA 101.3°, RA 219.9°,
Dec −16.7°, Dec −60.8°,
plx 379.21 mas, plx 747.1 mas,
V −1.46 V −0.01
Distance from Earth d — 2.637 pc 1.339 pc
Absolute magnitude M 4.83 +1.43 +4.36
Distance from Proxima d' 1.301 pc 2.867 pc 0.063 pc
Apparent magnitude from Proxima m' +0.40 −1.28 −6.65
Direction from Proxima (α′, δ′) 37.4°,+62.7° 90.4°,+8.0° 244.9°,−11.9°
Sirius is slightly fainter (it is a little farther away) and has moved about 27° across the sky, from Canis Major to within about 1.5° of Betelgeuse in Orion. α Cen A is only 0.063 pc (13,000 AU) away, so it outshines everything except Proxima itself, and its direction is wildly different from what Earth sees because we're now right next to it.