Intermediate, Advanced. Human Exploration, Moon, Software, Space Exploration.
Make an easy tool for comparing lunar south pole landing sites and dates, showing where the Sun and Earth sit above the horizon so planners can judge solar power and direct-to-Earth communication windows.
Computes positions of the Sun, Earth, planets and spacecraft as seen from any place and time, including a point on the lunar surface. Returns azimuth and elevation directly, which is exactly what solar power and Earth-communication windows need.
Ready-made maps of how often the Sun is visible across the lunar poles, derived from LOLA topography, plus high-resolution topography of candidate south pole sites. Answers the solar power question without running your own horizon calculations.
South polar tile layers from LRO: WAC percentage-based illumination (WAC_POLE_ILL_PCT_SOUTH_100M) and LOLA average Earth visibility (AVGVISIB_85S_060M_201608_EARTH_SP). Together they show where a lander gets sunlight for power and line of sight to Earth for communication.
NASA PDS Geosciences Node (Washington University in St. Louis)
A REST API for finding PDS products by mission, instrument and product type; for example LOLA gridded elevation (GDRDEM) of the Moon. Returns product lists with download links to the PDS archive.
Images from inside the Moon's permanently shadowed craters, taken by a very sensitive NASA camera on Korea's Danuri orbiter using faint light reflected off nearby terrain. Unique views of the south pole terrain landers will face.
The toolkit and data files (kernels) NASA missions use for geometry: where bodies and spacecraft are, which way they point, and lighting angles. More setup than Horizons, but runs offline and at scale.
Sun elevation at a lunar south pole sitePythonOpen in Colab
import requests
# Sun azimuth/elevation seen from a lunar south pole site (lon 0, lat -89.5).
# Use COMMAND='399' for Earth instead of the Sun ('10').
params = {
"format": "json",
"COMMAND": "'10'",
"MAKE_EPHEM": "'YES'", "EPHEM_TYPE": "'OBSERVER'", "OBJ_DATA": "'NO'",
"CENTER": "'coord@301'", "COORD_TYPE": "'GEODETIC'",
"SITE_COORD": "'0,-89.5,0'", # east lon, lat, altitude km
"START_TIME": "'2026-12-01'", "STOP_TIME": "'2026-12-03'",
"STEP_SIZE": "'6h'", "QUANTITIES": "'4'", # 4 = azimuth and elevation
}
r = requests.get("https://ssd.jpl.nasa.gov/api/horizons.api", params=params, timeout=60)
result = r.json()["result"]
table = result.split("$$SOE")[1].split("$$EOE")[0]
for line in table.strip().splitlines():
print(line)
Fetch a south pole illumination tileJavaScript
// Read the WMTS capabilities for the lunar south pole illumination layer,
// then fetch one tile. Moon Trek tiles send CORS headers.
const base = "https://trek.nasa.gov/tiles/Moon/SP/WAC_POLE_ILL_PCT_SOUTH_100M/1.0.0";
const xml = await fetch(`${base}/WMTSCapabilities.xml`).then((r) => r.text());
const template = xml.match(/template="([^"]+)"/)[1];
const matrixSet = xml.match(/<TileMatrixSet>([^<]+)<\/TileMatrixSet>/)[1];
console.log("tile template:", template);
const tileUrl = template
.replace("{Style}", "default").replace("{TileMatrixSet}", matrixSet)
.replace("{TileMatrix}", "0").replace("{TileRow}", "0").replace("{TileCol}", "0");
const tile = await fetch(tileUrl);
console.log(tile.status, tile.headers.get("content-type"), tileUrl);
// Earth visibility layer: swap the path to AVGVISIB_85S_060M_201608_EARTH_SP
import requests
# Ask the Orbital Data Explorer for LOLA gridded elevation products
r = requests.get("https://oderest.rsl.wustl.edu/live2/", params={
"query": "product", "results": "fp", "output": "JSON", "limit": 5,
"target": "moon", "ihid": "LRO", "iid": "LOLA", "pt": "GDRDEM",
}, timeout=60)
r.raise_for_status()
for p in r.json()["ODEResults"]["Products"]["Product"]:
files = p["Product_files"]["Product_file"]
jpg = next((f["URL"] for f in files if f["URL"].endswith(".jpg")), None)
print(p["pdsid"], "| preview:", jpg)
Load a SPICE kernel and convert a datePythonOpen in Colab
import requests
import spiceypy # pip install spiceypy
# The leap-seconds kernel is the first thing almost every SPICE program loads
url = "https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls"
open("naif0012.tls", "wb").write(requests.get(url, timeout=60).content)
spiceypy.furnsh("naif0012.tls")
et = spiceypy.str2et("2026-11-15T12:00:00")
print("seconds past J2000 (TDB):", et)
# Next: load planet and spacecraft kernels (spk/, pck/) and call spiceypy.spkpos