Skip to main content

Lunar DEM generation, Kaguya scene analysis, metadata prediction, and rover-aware landing utilities.

Project description

lunadem

lunadem is a lunar analysis toolkit for shape-from-shading DEM reconstruction, Kaguya scene metadata parsing, packaged metadata prediction, rover-aware landing safety scoring, and interactive 3D visualization.

PyPI: https://pypi.org/project/lunadem/

Install

pip install lunadem

Optional extras:

pip install "lunadem[ml]"
pip install "lunadem[viz]"
pip install "lunadem[pds]"
pip install "lunadem[dev]"

Canonical Python import is now lunadem.

Backward compatibility:

  • import lunardem still works, but it is deprecated.
  • lunardem remains available as a compatibility CLI alias.

What It Includes

  • DEM generation from image input with sfs, multiscale_sfs, ml, and hybrid
  • STAC + camera.json loaders for the bundled Kaguya dataset
  • Deterministic metadata derivation helpers for geometry, timing, coverage, and coordinate conversion
  • Packaged SFS explainers via CLI and Python
  • Packaged metadata prediction APIs with ONNX-ready runtime hooks and baseline fallback metadata priors
  • Rover preset library for Sojourner, Spirit, Opportunity, Curiosity, Perseverance, Pragyan, and SORA-Q
  • Safe landing-site selection from an image or DEM
  • Interactive Plotly visualizations for surfaces, landing sites, and Moon/footprint/camera/sun geometry
  • download --test to fetch the official reference scene

Quick Start

from lunadem import (
    ReconstructionConfig,
    find_safe_landing_site,
    generate_dem,
    load_kaguya_scene,
    predict_scene_metadata,
    plot_scene_geometry_3d,
)

scene = load_kaguya_scene("TC1S2B0_01_07496N087E3020")

cfg = ReconstructionConfig(
    output={"output_dir": "output", "base_name": "moon_run"},
)
dem_result = generate_dem(scene.image_path, method="hybrid", config=cfg)

metadata_prediction = predict_scene_metadata(scene.image_path)
landing_site = find_safe_landing_site(scene.image_path, rover="pragyan", scene=scene)

figure = plot_scene_geometry_3d(scene, save_path="output/scene_geometry.html")

print(dem_result.exports)
print(metadata_prediction.targets)
print(landing_site.summary)

CLI Examples

lunadem generate dataset/TC1S2B0_01_07496N087E3020/image/image.tif --method hybrid --output output
lunadem scene-summary TC1S2B0_01_07496N087E3020
lunadem sfs --maths
lunadem predict dataset/TC1S2B0_01_07496N087E3020/image/image.tif --kind all
lunadem landing-site dataset/TC1S2B0_01_07496N087E3020/image/image.tif --rover pragyan --scene TC1S2B0_01_07496N087E3020
lunadem download --test --output downloads

Metadata Suite Accuracy

The bundled 18-scene Kaguya metadata suite currently ships baseline packaged statistics and ONNX-ready runtime hooks. The table below shows mean absolute error against the local dataset targets used by the packaged metrics file.

Target MAE
sun_azimuth_deg 1.5308
sun_elevation_deg 0.0022
off_nadir_deg 0.1052
view_azimuth_deg 0.0513
gsd_m 0.0808
centroid_lat_deg 3.0003
centroid_lon_deg 0.5092

Important note:

  • The current dataset is small and scene-level labels are limited.
  • These predictors estimate scene metadata, not ground-truth DEM quality or landing safety labels.
  • Running tools/train_metadata_cnns.py in a healthy Python environment will replace the packaged baseline with exported ONNX models and refreshed metrics.

Main Public APIs

  • generate_dem(...)
  • analyze_dem(...)
  • assess_landing(...)
  • load_stac_item(...)
  • load_camera_model(...)
  • load_kaguya_scene(...)
  • summarize_scene_metadata(...)
  • predict_illumination(...)
  • predict_view_geometry(...)
  • predict_scene_location(...)
  • predict_scene_metadata(...)
  • get_rover_spec(...)
  • find_safe_landing_site(...)
  • plot_3d_surface_interactive(...)
  • plot_landing_site_2d(...)
  • plot_landing_site_3d(...)
  • plot_scene_geometry_3d(...)

Reference Files

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 Distribution

lunadem-0.3.0.tar.gz (92.5 MB view details)

Uploaded Source

Built Distribution

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

lunadem-0.3.0-cp312-cp312-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file lunadem-0.3.0.tar.gz.

File metadata

  • Download URL: lunadem-0.3.0.tar.gz
  • Upload date:
  • Size: 92.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for lunadem-0.3.0.tar.gz
Algorithm Hash digest
SHA256 be2b40af43b3d7fe33feb546d08a1a36f09b67d8ff0d167142afdeb3119dc5cb
MD5 85f9c54316125658ff616806bab315ac
BLAKE2b-256 dc3238db6a8fbf35654ffc8c05aaeb94c393c893effb29b86ec336e726e5168a

See more details on using hashes here.

File details

Details for the file lunadem-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: lunadem-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for lunadem-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 496f8e4a438ec93c80b3ab6c5d036f2eaf08d6639a97480f8cd73fbcb9d0ff85
MD5 4b9ed8b083fcc3387d02d48c398d4b83
BLAKE2b-256 c367eebee2abfa4e4d06a4a4d230c177b2e0afaad650f702027e1c09cb7f2e48

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