High-Fidelity Lunar South Pole Micro-Illumination & Thermal Raytracer
A high-fidelity lunar surface thermal simulation engine using BVH-accelerated raytracing and Crank-Nicolson heat diffusion solvers to model Permanently Shadowed Regions (PSRs) and Cold Traps for the Artemis program. The engine resolves penumbral illumination from the extended solar disk, computes subsurface heat conduction through temperature-dependent regolith properties, and produces publication-quality thermal maps validated against LRO Diviner observations.
| Feature | Description |
|---|---|
| π Extended Solar Source | Penumbra modeling with 32-sample Monte Carlo integration across the solar disk (~0.533Β° angular diameter) |
| π§± Real NASA Data Support | Ingest LRO LOLA GeoTIFF DEMs via rasterio with automatic NoData masking and coordinate centering |
| π‘οΈ 1D Subsurface Heat Diffusion | Crank-Nicolson implicit solver with Newton iteration for radiative surface boundary condition |
| π¬ Temperature-Dependent Properties | Regolith conductivity k(T) = k_c + k_rΒ·TΒ³ and polynomial heat capacity following Hayne et al. (2017) |
| π GPU-Ready Architecture | Numba JIT-compiled raytracer with SAH-optimized BVH (4-leaf max, 16 SAH bins) |
| π Publication-Quality Output | Automatic hero image generation with thermal-optical compositing, colorbars, and scale bars |
At each triangular DEM facet, the surface energy balance is:
(1 β A) Β· Sβ Β· cos(ΞΈ) Β· f_illum + Q_IR + Q_geo = Ξ΅ Β· Ο Β· T_sβ΄ β k(T) Β· βT/βz |_{z=0}
where:
A= Bond albedo (0.12)Sβ= Solar constant (1361 W/mΒ²)f_illum= Illumination factor [0, 1] from raytracingΞ΅= Thermal emissivity (0.95)Ο= Stefan-Boltzmann constant
Ο(z) Β· cβ(T) Β· βT/βt = β/βz [k(T) Β· βT/βz]
Solved with a Crank-Nicolson implicit scheme on a geometrically stretched grid (20 layers, 2 m deep), with Newton iteration for the nonlinear radiative upper boundary condition.
# Clone repository
git clone https://github.com/SpaceEngineerSS/ArtemisThermalBase.git
cd ArtemisThermalBase
# Install dependencies
pip install -e ".[dev]"# Basic run with synthetic crater (24 hours, default config)
python main.py --duration 24
# Faster test run with smaller crater
python main.py --cratersize 500 --duration 1 --point-source --dt 600
# High-fidelity run (2.5 km crater, 6 hours, penumbra enabled)
python main.py --cratersize 2500 --duration 6 --dt 300 --output-interval 1800# Generate a semi-synthetic Shackleton DEM (if no real data available)
python tools/download_sample_data.py --synthetic --grid-size 501
# Run simulation with GeoTIFF DEM
python main.py --dem data/sample_lola_dem.tif --duration 6 --point-source# Re-render from saved data (no physics re-computation)
python main.py --render-only --output output --hero-dpi 600python -m pytest tests/ -vDetailed scientific and technical documentation is available in the docs/ directory:
| Document | Description |
|---|---|
| π Physics Model | Full mathematical derivation of the Surface Energy Balance, Crank-Nicolson discretization, and Raytracing algorithms. |
| βοΈ Configuration Guide | Comprehensive guide to default_config.yaml parameters, valid ranges, and physical implications. |
| Registry of all physical assumptions, known limitations (e.g., lack of multi-bounce IR), and their impact. | |
| π API Reference | Developer documentation for SimulationRunner, CrankNicolsonSolver, and other core modules. |
ArtemisThermalBase/
βββ config/ # YAML simulation parameters
β βββ default_config.yaml # All physical constants & solver settings
βββ core_engine/ # Raytracing, mesh, illumination
β βββ raytracer.py # BVH + MΓΆller-Trumbore intersection
β βββ mesh.py # DEM β triangle mesh conversion
β βββ illumination.py # Solar visibility + penumbra
β βββ constants.py # Config loader & dataclasses
βββ data_ingestion/ # DEM loading, coordinates, ephemeris
β βββ synthetic_dem.py # Parametric crater generator
β βββ lola_loader.py # NASA LRO LOLA GeoTIFF loader
β βββ ephemeris.py # Skyfield sun position
β βββ coordinate_utils.py # Selenographic β local transforms
βββ thermal_solver/ # Heat equation solver
β βββ crank_nicolson.py # CN implicit solver + Newton BC
β βββ regolith_properties.py # Hayne et al. (2017) properties
β βββ grid.py # Geometric subsurface grid
βββ simulation/ # Orchestration
β βββ runner.py # Main simulation loop
β βββ io_manager.py # NumPy data persistence
βββ visualization/ # Output rendering
β βββ plotter.py # Debug / analysis plots
β βββ hero_renderer.py # Cinematic composite renderer
βββ tools/ # Standalone utilities
β βββ download_sample_data.py # LOLA data downloader
βββ tests/ # Pytest suite
βββ main.py # CLI entry point
βββ pyproject.toml # Package configuration
| Argument | Default | Description |
|---|---|---|
--config |
config/default_config.yaml |
Path to simulation config YAML |
--cratersize |
from config | Override crater radius [m] |
--duration |
24.0 |
Simulation duration [hours] |
--dt |
from config | Time step [seconds] |
--dem |
β | Path to GeoTIFF DEM (bypasses synthetic) |
--output |
output/ |
Output directory |
--output-interval |
3600.0 |
Snapshot interval [seconds] |
--point-source |
false |
Fast mode (no penumbra) |
--render-only |
false |
Re-render hero image from saved data |
--hero-dpi |
300 |
Hero image resolution |
--log-level |
INFO |
Logging verbosity |
| # | Deliverable | Status |
|---|---|---|
| 1 | Synthetic crater + BVH raytracer + CN thermal solver | β Complete |
| 1.5 | Hero renderer + data persistence + --render-only |
β Complete |
| 2 | Real NASA LRO LOLA data pipeline + --dem flag |
β Complete |
| 3 | C++ BVH raytracer with pybind11 | β¬ Planned |
| 4 | Multi-bounce IR radiation + view factors | β¬ Planned |
| 5 | Diviner validation + documentation | β¬ Planned |
After running a 6-hour simulation on a 2.5 km synthetic crater:
Duration: 6.0 hours (72 steps)
Wall time: 1234.8 s
Final T: min=88.4 K, max=337.7 K, mean=100.5 K
Output files: illumination_map.png, thermal_map.png, time_series.png,
sun_elevation.png, hero_artemis.png
The output includes 8 raw data files (NumPy .npy + metadata JSON) enabling re-rendering without re-running the physics.
If you use ArtemisThermalBase in your research, please cite:
@software{artemis_thermal_base_2026,
author = {Gumus, Mehmet},
title = {ArtemisThermalBase: High-Fidelity Lunar South Pole Thermal Simulation},
year = {2026},
url = {https://github.com/SpaceEngineerSS/ArtemisThermalBase},
version = {0.1.0}
}- Paige, D.A., et al. (2010). "Diviner Lunar Radiometer observations of cold traps in the Moon's south polar region." Science, 330, 479-482.
- Hayne, P.O., et al. (2017). "Global regolith thermophysical properties of the Moon from the Diviner Lunar Radiometer Experiment." JGR Planets, 122, 2371-2400.
- Mazarico, E., et al. (2011). "Illumination conditions of the lunar polar regions using LOLA topography." Icarus, 211, 1066-1081.
- Vasavada, A.R., et al. (1999). "Near-surface temperatures on Mercury and the Moon and the stability of polar ice deposits." Icarus, 141, 179-193.
- Zuber, M.T., et al. (2012). "Constraints on the volatile distribution within Shackleton crater at the Moon's south pole." Nature, 486, 378-381.
- MΓΆller, T. & Trumbore, B. (1997). "Fast, minimum storage ray-triangle intersection." J. Graphics Tools, 2(1), 21-28.
- Smith, D.E., et al. (2017). "Summary of the results from the Lunar Orbiter Laser Altimeter after seven years in lunar orbit." Icarus, 283, 70-91.
MIT License β see LICENSE for details.
Author: Mehmet GΓΌmΓΌΕ Β· github.com/SpaceEngineerSS
