Skip to main content

Production-ready DEM generation toolkit for lunar and planetary imagery.

Project description

LunarDEM

LunarDEM is a production-oriented Python library for generating and analyzing Digital Elevation Models (DEM) from lunar and planetary imagery.

It ships with:

  • shape-from-shading (SFS) reconstruction
  • multi-scale SFS
  • plugin-ready ML method scaffolding
  • hybrid SFS + ML fusion
  • terrain analytics (slope, roughness, curvature, histograms)
  • deterministic landing suitability analysis
  • geospatial exports (GeoTIFF, OBJ, PLY)
  • CLI + Python API + PyPI-ready packaging

Installation

pip install .

Optional extras:

pip install .[viz]
pip install .[ml]
pip install .[docs]
pip install .[dev]

Quick Start (Python API)

from lunardem import generate_dem, ReconstructionConfig

config = ReconstructionConfig(
    output={"output_dir": "output", "base_name": "moon_run"},
)
result = generate_dem("data/moon1.png", method="multiscale_sfs", config=config)
print(result.exports)
print(result.metrics.stats)

Quick Start (CLI)

lunardem generate data/moon1.png --method sfs --output output
lunardem analyze output/reconstructed_dem.tif
lunardem landing output/reconstructed_dem.tif --spacecraft examples/configs/landing.yaml

Public API

  • generate_dem(input_data, method, config) -> DEMResult
  • analyze_dem(dem_or_path, analysis_config) -> TerrainMetrics
  • assess_landing(dem_or_path, landing_config) -> LandingReport

Methods

  • sfs: single-scale Lambertian SFS with optimization diagnostics
  • multiscale_sfs: coarse-to-fine SFS
  • ml: deterministic baseline scaffold with optional torch plugin path
  • hybrid: weighted SFS+ML fusion with fallback behavior

Outputs

  • DEM array in meters
  • GeoTIFF (.tif) with planetary CRS defaults
  • 3D mesh (.obj, optional .ply)
  • Visualizations (depth_map.png, surface_3d.png) with viz extra
  • JSON manifest for reproducibility

Documentation

Build docs locally:

pip install .[docs]
mkdocs serve

Development

pip install .[dev]
pytest
ruff check .
mypy lunardem
python -m build
twine check dist/*

Publish to PyPI

python -m build
twine check dist/*
twine upload dist/*

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lunadem-0.1.0-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file lunadem-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lunadem-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for lunadem-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 395f7720e04a66bab029e7f34b1af83f1491faae545d8abf9f3870845d7ec304
MD5 83ab972235120d7e955d334c58741222
BLAKE2b-256 025d5147868cc1638e0ff4d9e2c97ac4a0955427496b3a6a58a46da241243619

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page