This repo now contains a Python backend plus a TypeScript frontend for a Mars habitability website.
The backend does three jobs:
- Downloads official Mars datasets from NASA/PDS and ASU TES product pages.
- Normalizes them onto a shared 1 degree by 1 degree global grid.
- Computes a heuristic habitability score and writes the result to JSON for the frontend.
The pipeline is wired to fetch these official sources:
- NASA PDS MOLA MEGDR topography (
megt90n000cb.img+ label) via the Mars Orbital Data Explorer product page - NASA PDS TES special products for global albedo and thermal inertia
- ASU TES mineral maps in ENVI format for hydrated-mineral and surface-dust signals
The score is intentionally framed as a heuristic rather than a scientific claim. It uses topography, albedo, thermal inertia, hydrated-mineral abundance, and dust cover as broad proxy layers.
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"Build the processed dataset:
python3 -m backend.app.pipeline buildThat command writes:
backend/data/processed/mars_habitability.jsonfrontend/public/data/mars_habitability.json
Run the API:
uvicorn backend.app.api:app --reloadUseful endpoints:
GET /api/healthGET /api/mars-habitabilityPOST /api/pipeline/rebuild
cd frontend
npm install
npm run devThe Vite dev server proxies /api/* to http://127.0.0.1:8000.
backend/app/ Python API, downloaders, parsers, and scoring logic
backend/data/raw/ Download cache for source files
backend/data/processed/
frontend/ React + TypeScript client
tests/ Lightweight unit tests for scoring and grid transforms
- The TES thermal inertia layer has partial latitude coverage, so the score includes a per-cell confidence field.
- The pipeline downloads tens of megabytes of source data the first time it runs.
- Generated data files are ignored by Git by default.