Skip to main content

Welcome to TerraLab

TerraLab is an astrophysical mapping engine that unites terrestrial topography with precision astronomical rendering. Unlike conventional planetariums, TerraLab calculates the real horizon based on Digital Elevation Models (DEM) and estimates dynamic stellar visibility using satellite light pollution data (DVNL).

What TerraLab Does

TerraLab doesn’t just draw stars—it calculates what you can actually see from an exact point on Earth, considering:

Real Terrain Horizons

Generates 360° horizon profiles via raycasting over topographic meshes (ICGC/Copernicus DEM)

Light Pollution Analysis

Scans Day/Night Visible Lights satellite data to assign Bortle class and real stellar magnitude limits

Precision Celestial Mechanics

Integrates Gaia star catalog and DE421 ephemerides for sub-arcsecond positioning accuracy

Core Features

Horizon Engine (Raycasting)

The HorizonBaker projects thousands of rays from the observer’s position toward the horizon:
  • Depth Bands: Uses logarithmically distributed depth bands to avoid aliasing and enable realistic atmospheric gradients between near and distant mountains
  • Earth Curvature Correction: Each ray applies curvature correction for mountains beyond 100km: hcorr=d22Rearthh_{corr} = \frac{d^2}{2R_{earth}}
  • Multi-Quality Modes: 10 to 80 depth bands for performance vs. quality trade-offs

Visibility Model (DVNL → SQM → Bortle)

Converts satellite radiance into human-detectable sky quality:
  1. Gaussian Convolution with σ=1.5km\sigma=1.5km to simulate zenith light reaching an SQM (Sky Quality Meter)
  2. Empirical Formula: SQM=22.02.4log10(RadianceDVNL+0.001)SQM = 22.0 - 2.4 \cdot \log_{10}(Radiance_{DVNL} + 0.001)
  3. Bortle Classification: Industrial zones reach Bortle 9, while mountain peaks achieve Bortle 1 (SQM21.9SQM \approx 21.9)

Star Catalog Integration

  • Gaia Mission Data: High-precision stellar positions, proper motions, and photometry
  • DE421 Ephemerides: NASA/JPL planetary positions for solar system objects
  • Visual Magnitude Engine: Dynamic magnitude limits based on local light pollution

Installation

Install TerraLab and download required data files

Quick Start

Get up and running with your first astronomical visualization

Technical Philosophy

Design Decisions:
  • Python + PyQt5: Chosen for rapid iteration and NumPy’s vectorized celestial calculations
  • CRS Awareness: Engine handles metric projections (EPSG:8857) for precise geographic coordinates
  • Human Eye Focal Length: Calibrated projection where zoom=1.0 corresponds to actual human vision (36mm full-frame equivalent)

Data Sources

TerraLab builds on world-class scientific datasets:
Data TypeSourceDescription
TopographyICGC, Copernicus (ESA)Digital elevation models for terrain analysis
StarsGaia Mission (ESA)Precise stellar positions and photometry
EphemeridesNASA/JPLDE421 planetary and lunar positions
Light PollutionEarth Observation GroupDVNL satellite radiance measurements

Next Steps

Ready to start exploring the night sky with real terrain?
1

Install Dependencies

Follow the installation guide to set up Python packages
2

Download Data Files

Obtain Gaia catalog, DE421 ephemerides, and DVNL light pollution maps
3

Configure Terrain

Point TerraLab to your DEM raster files for accurate horizon calculation
4

Launch Application

Run python -m TerraLab and start exploring

Build docs developers (and LLMs) love