Installation
TerraLab requires Python 3.10+ and several scientific computing libraries for astronomical calculations and geospatial processing.System Requirements
- Python: 3.10 or higher (tested up to 3.12)
- Operating System: Linux, macOS, or Windows
- Disk Space: ~2GB for data files (star catalog, ephemerides, light pollution maps)
- Memory: 4GB RAM minimum, 8GB recommended
Install via pip
Install via Conda
For a more isolated environment, use the providedenvironment.yml:
Core Dependencies
The following packages are installed automatically:Required Packages
| Package | Version | Purpose |
|---|---|---|
| PyQt5 | 5.15.9+ | GUI framework for the astronomical canvas |
| numpy | 1.26+ | Vectorized celestial calculations |
| skyfield | 1.46+ | High-precision astronomical computations |
| rasterio | 1.3.10+ | GeoTIFF DEM and light pollution raster I/O |
| pyproj | 3.6+ | Coordinate reference system transformations |
| scipy | 1.11+ | Scientific computing (convolutions, interpolation) |
| scikit-learn | 1.4+ | Machine learning for SQM calibration |
| pandas | 2.1+ | Data manipulation for star catalogs |
| tqdm | 4.66+ | Progress bars for data processing |
Optional Dependencies
For advanced geospatial processing:- xarray (≥2024.1): Multi-dimensional arrays for raster analysis
- rioxarray: Xarray extension for GeoTIFF handling
- dask: Parallel processing for large DEM datasets
Development Tools
- pytest (≥8): Unit testing framework
- pytest-cov (≥4): Test coverage reporting
- ruff (≥0.6): Fast Python linter and formatter
Required Data Files
1. Gaia Star Catalog
File:gaia_stars.jsonLocation:
TerraLab/data/stars/Size: ~14 MB
Source: ESA Gaia Mission Contains stellar positions (RA/Dec), proper motions, parallax, and photometry for bright stars.
The bundled
gaia_stars.json includes stars visible to the naked eye (magnitude < 6.5) plus reference stars for telescope alignment.2. DE421 Ephemerides
File:de421.bspLocation:
TerraLab/data/stars/Size: ~16 MB
Source: NASA/JPL HORIZONS Provides high-precision positions for the Sun, Moon, and planets from 1900-2050.
3. DVNL Light Pollution Map
File:C_DVNL 2022.tifLocation:
TerraLab/data/light_pollution/Size: ~38 MB (compressed GeoTIFF)
Source: Earth Observation Group Satellite-derived visible nighttime lights for Bortle scale classification.
Directory Structure
After installation, your data directory should look like:Optional: Digital Elevation Models
For real terrain horizons, download DEM tiles for your region:Catalonia (Spain)
Source: ICGC - Institut Cartogràfic i Geològic de CatalunyaFormat: ESRI ASCII Grid (.asc) or GeoTIFF (.tif)
Resolution: 5m (urban), 15m (rural)
Europe-Wide
Source: Copernicus DEMFormat: GeoTIFF
Resolution: 25m
Coverage: Pan-European, tiled in 5°×5° blocks
United States
Source: USGS National MapFormat: GeoTIFF
Resolution: 10m (3DEP)
Recommendation: Download at least 150km radius of DEM tiles around your observing location. TerraLab supports tiled datasets—place all
.asc or .tif files in a single folder.Verify Installation
Check that all dependencies are installed:Troubleshooting
PyQt5 Installation Issues
Ifpip install PyQt5 fails:
Rasterio/GDAL Issues
Rasterio requires GDAL. If installation fails:Missing Data Files
If TerraLab launches but shows a configuration dialog:- Check that
gaia_stars.jsonandde421.bspexist inTerraLab/data/stars/ - Check that
C_DVNL 2022.tifexists inTerraLab/data/light_pollution/ - Re-clone the repository if files are missing (they should be included)