A Python tool that generates beautiful stereographic projections of the night sky from any location on Earth. Visualize visible stars, constellations, and planets with accurate astronomical data.
- Accurate star positions using the Hipparcos catalog (~118,000 stars)
- Planet positions for all major planets and the Moon
- Constellation lines and labels with proper astronomical designations
- Multiple viewing modes: visible sky, non-visible sky, or both sides
- Time-based plotting - visualize the sky at any date/time
- Customizable limiting magnitude to simulate different viewing conditions (light pollution, dark sky, etc.)
- High-performance caching for fast repeated renders
pip install skyfield geopy matplotlib numpy
from plot import plot_constellations # Plot visible sky from Reykjavik (current time) plot_constellations(place="Reykjavik")
plot_constellations( place="Los Angeles", # Location name limiting_magnitude=6.0, # Star visibility (4.0=city, 6.0=suburbs, 7.0+=dark sky) time=None, # datetime object (None = current time) fname=None, # Custom filename (None = auto-generated) mode="visible" # "visible", "nonvisible", or "both" )
from plot import plot_constellations from datetime import datetime, timezone # Show both visible and non-visible sky side-by-side plot_constellations(place="Reykjavik", mode="both") # Non-visible constellations only (opposite side of Earth) plot_constellations(place="Sydney", mode="nonvisible") # Specific date/time winter_solstice = datetime(2025, 12, 21, 0, 0, tzinfo=timezone.utc) plot_constellations(place="Los Angeles", time=winter_solstice) # Only show brighter stars plot_constellations(place="Tokyo", limiting_magnitude=4.0) # Custom filename plot_constellations(place="Cape Town", fname="my_custom_sky.png")
Shows both the visible sky and the non-visible sky (opposite side of Earth) simultaneously.
Current visible constellations from Los Angeles.
Winter night sky in Berlin with enhanced star visibility.
Shows what's on the opposite side of Earth from Sydney.
Simulates city viewing conditions with limiting magnitude 4.0.
- Geocoding: Converts place names to coordinates using Nominatim (with LRU caching)
- Astronomical Calculations: Uses Skyfield to compute star and planet positions
- Stereographic Projection: Maps the celestial sphere onto a 2D plane centered on zenith
- Rendering: Matplotlib generates publication-quality images
The tool uses aggressive caching for optimal performance:
- Module-level caching: Star catalogs and ephemeris data loaded once at import
- LRU cache: Geocoding results cached to avoid repeated network calls
- First run: ~2-5 seconds (loads astronomical data)
- Subsequent runs: Much faster (only calculations needed)
plot.py- Main plotting functionsdemo.py- Example showcase script demonstrating all featuresdaily.py- Automated daily sky generation for 8 global citiesconstellationship.fab- Constellation line dataconstellation_abbreviations.json- Constellation name mappingsde421.bsp- JPL planetary ephemeris (auto-downloaded by Skyfield)hip_main.dat- Hipparcos star catalog (auto-downloaded by Skyfield)
- Star data: Hipparcos Catalog
- Planetary positions: JPL DE421 Ephemeris
- Constellation data: Stellarium
- Astronomical calculations: Skyfield




