# Apollo 17 liftoff: the Lunar Module from the rover, 2° too high; fixed with LROC NAC terrain > 2026-11-20. No new dependency. > > **Reproduce:** `uv run python scripts/data/download_nac_dtm.py` (442 MB, once; `--check` verifies only), > `uv run python scripts/data/build_fine_patch.py --site apollo17`, > `uv run python scripts/data/validate_a17_geometry.py` (numbers in [a17_geometry.json](a17_geometry.json), the > figures), `uv run python scripts/data/shoot_a17_rover_view.py --url ` (the app's screenshots, > [a17_rover_view.json](a17_rover_view.json)), `uv run pytest tests/test_a17_geometry.py tests/test_nac_dtm.py`. > Code: `src/moonat/terrain/nac.py` (the reader), `src/moonat/terrain/fine.py`, `src/moonat/a17_geometry.py` > (frames, units and conventions in the docstrings). ![The film with the predicted LM and skyline, before and after](../figures/a17_geometry/a17_geometry.png) ![The film and the app's Rover view, before and after](../figures/a17_geometry/a17_rover_view.png) ## Answer The launch video stitches NASA's TV film of the liftoff (ALSJ `a17v_1880127.mpg`, the camera on the parked rover) onto the app's Rover view. With the far hills matched, the app's Lunar Module stood 2° too high. The cause was the ground under the **rover**: the app's terrain (SLDEM2015, 59 m cells) put the rover's parking place 6.7 m below the LM's ground, and the real figure is 2.0 m. The app now takes the ground within ±1.5 km of the site from LROC's NAC stereo model (`NAC_DTM_APOLLO17`, 5 m), as a C4 fine patch, the mechanism StarHab already uses. | From the rover's eye, 1.6 m above its ground | Before (SLDEM2015) | After (NAC fine patch) | Film | |---|---|---|---| | Rover's ground minus the LM's ground | −6.67 m | **−2.01 m** | −1.2 m (−0.9 to −1.5; camera 1.6 ± 0.3 m up) | | LM base (footpads), elevation | +2.11° | **+0.18°** | +0.18° (pads +0.19, +0.22, +0.13) | | LM base minus the film | +1.93° | **0.00°** (−0.004°) | | | The same, in the app as drawn (its Track lander aim) | +1.81° | **−0.11°** | | | Highest ground between the rover and the LM | +2.28° (hides the pads) | +0.08° (pads in view) | pads in view | | Far ridge at azimuth 285° / 292.5° | 2.21° / 3.68° | 2.20° / 3.65° | 2.25° / 3.66° | | Film's sky edge minus the predicted far skyline (161 columns) | median +0.007°, rms 0.031° | median +0.029°, rms 0.045° | | | LM centre, azimuth (app minus film) | +0.81° | +0.81° (2.0 m at 139 m) | | - "As drawn" differs from the bare terrain by the app's decoration: its procedural bumps lift the ground under the rover's parking place by 0.25 m (the LM's footprint has none). In the app the LM's centre went from 3.44° to 1.53° up (−1.91°; predicted for the bare ground −1.93°). - The skyline: the film's camera (az 288.584°, el 3.204°, field 9.531°, roll 1.0°) was fitted earlier to the skyline from the old eye, 4.7 m lower. From the new eye the far hills sit 0.01 to 0.03° lower, so the same camera now leaves a median of +0.029°; a refit of the camera's elevation takes that out (0.034° rms about the median). **A video that stitches the film onto the app's view needs a new fit and a new recording.** - Left and right, 0.81° (2.0 m), is unchanged and is not a terrain matter: it is inside LROC's ±3.2 m (rover) and ±3.5 m (LM) and the 4-decimal rounding of the coordinates (3 m); the TV camera also stood at the rover's front, not at the driver's eye the app uses. **Update 2026-11-20:** the ground within ±500 m of the site now comes from the 2 m model `NAC_DTM_APOLLO17_1` (an inner patch inside the 5 m one; docs/validation/pins_hires.md 9.4). With it the LM base is 0.05° below the film's (was 0.00°), the rover's ground 1.88 m below the LM's (was 2.01 m), and the ground fits the control points to 0.21 m RMS (was 0.28 m). The numbers and the figure below are from before that change; `docs/validation/a17_geometry.json` and `docs/figures/a17_geometry/a17_geometry.png` are the re-run. ## The NAC model: what it is and how it is tied `NAC_DTM_APOLLO17.TIF` (LROC RDR, product version 1.9; Henriksen et al. 2017): 9985 × 11600 pixels of 5 m, 32-bit floats, uncompressed. From its PDS label and its own GeoTIFF tags (they agree; the reader refuses a file where they do not): - **Map projection:** equirectangular on the 1737.4 km sphere, planetocentric latitude, east longitude; standard parallel (CENTER_LATITUDE) 20°, central meridian (CENTER_LONGITUDE) 180°; x = R cos 20° (lon − 180°), y = R lat; the outer corner of the first pixel at x = −4 276 880 m, y = +645 990 m. Covers 19.39 to 21.30°N, 29.91 to 31.66°E. - **Vertical reference:** the label gives only the radii (all 1737.4 km) and does not say in words what the heights are relative to. They are metres above the 1737.4 km sphere, the datum of LOLA and SLDEM2015, by two checks: at LROC's coordinates the DTM gives LROC's elevations (below), and over ±1.5 km SLDEM2015 minus the DTM has a mean of −0.23 m. - **Read without a library:** the file is one flat array (11 600 strips, each following the last, from byte 93 471), so it is memory-mapped; the few TIFF tags needed are parsed with `struct`. Read only. | Check of the tie | Result | |---|---| | DTM at LROC's coordinates: LM / ALSEP / rover / SEP | −2626.15 / −2621.95 / −2628.10 / −2626.78 m; LROC's table: −2626 / −2622 / −2628 / −2627 m | | 12 control points of Haase et al. 2019 (an independent NAC stereo solution), placed by their offsets from the LM | DTM minus control: mean 0.00 m, 0.19 m standard deviation | | The same points at their own coordinates (Haase's LM is 17.6 m west and 5.8 m south of LROC's) | mean +0.18 m, 0.53 m standard deviation: the DTM is in LROC's frame, the app's | | Horizontal tie to SLDEM2015: 2700 cells within ±1.5 km, NAC averaged over each cell, shifts tried in 5 m steps | best at 5 m north, 0 m east (3.93 m against 3.95 m with no shift); a 30 m shift gives 4.4 to 4.8 m. No shift is measurable (under about 10 m) | | SLDEM2015 minus the DTM over those cells | mean −0.23 m, **3.9 m standard deviation**: SLDEM2015's own noise at this scale (3 to 4 m, Barker et al. 2016) | LROC's four elevations equal the DTM's to 0.2 m, so they most likely come from it: they confirm the reading of the file (datum, projection, row and column order), not the ground truth a second time. The independent checks of the ground are Haase's control points and the film. ## The patch - `web/data/terrain/apollo17.fine.bin`: ±1.5 km around the site point (20.1908°N, 30.7717°E; the LM is 19 m from it), 301 × 301 cells of 10 m, int16 of 0.02 m: **181 202 bytes** (142 726 gzipped). The DTM's 5 m pixels are sampled bilinearly at 10 m; 5 m would be 722 KB for no visible gain at these distances. No holes in the window; not despiked. - Values: ENU up of the surface relative to the C4 patch's ground point (−2627.35 m), curvature included, exactly as StarHab's, so the same code draws it. - **The edge:** the view blends the fine patch into the C4 patch over its outer 15 % (225 m; a smoothstep in max(|east|, |north|)). At the edge the drawn ground is the C4 patch exactly (no step, tested). The two surfaces differ there by 3.6 m rms (13 m at the worst place), so that difference is taken up as a gentle ramp over 225 m, 1.3 km or more from the LM. - Visual only, as for StarHab: the physics horizon (C3), the Sun and Earth numbers and the C4 patch are unchanged. A drive ("Historic drives", the moving view) does not use fine patches; the site's own view does. The ground against the control points (heights relative to the LM's ground), before and after: | Point | East, north of the LM (m) | Control (m) | Before − control (m) | After − control (m) | |---|---|---|---|---| | ALSEP central station | −192, +36 | +4.1 | +0.3 | +0.1 | | US flag | −6, +18 | +0.7 | −0.1 | −0.3 | | Geo-1 / Geo-2 / Geo-3 / Geo-4 | west of the LM | +1.3 / +5.4 / +3.7 / +3.0 | +2.2 / +0.3 / +1.0 / +1.2 | −0.1 / +0.3 / +0.2 / +0.4 | | EP-4 / EP-8 | −385, −57 / −275, −72 | +8.9 / +5.7 | −0.1 / −1.1 | +0.4 / +0.4 | | EP-3 | +94, +26 | −0.9 | −0.2 | 0.0 | | SEP transmitter | +128, +27 | −0.8 | −1.5 | +0.3 | | EP-2 | +185, +18 | −1.8 | **−3.5** | +0.2 | | rms of the 11 | | | **1.45** | **0.28** | The hollow SLDEM2015 showed under the rover is not there: the NAC ground falls gently from the LM to the east (the bottom-left panel); the map panel shows the craters the NAC model does hold, 150 m and more away. ## App checks (on a local server) | Check | Result | |---|---| | `check_ux_8130_follow.py --sites apollo17` (Follow rover, Rover view, Track lander, the liftoff) | 48 ok, 0 failures | | `check_apollo_3d.py --only apollo17` | 56 ok, 0 failures | | `check_ux_8130_moments.py` | 139 ok, 0 failures | | `check_third_person.py --only desktop-dark` | 34 ok, 0 failures | | `uv run pytest`, `node --test web/tests/`, `uv run ruff check .` | 495 passed; 1194 passed; clean | ## What was ruled out (first pass, unchanged) | Suspect | Finding | |---|---| | LM position | App 20.1911°N, 30.7723°E = LROC's descent stage. | | Rover parking place | App 20.1896°N, 30.7769°E = LROC's LRV, 138.7 m from the LM at azimuth 289.3° from the rover. | | Camera height | The app's eye is the driver's, 1.6 m. A TV camera 0.3 m higher or lower moves the LM base by 0.12°. | | Vertical datum or radius | Camera and models stand on the same ground (heights above 1737.4 km, curvature included). | | Model placement | The LM stands on the ground at its anchor, without decoration; the model is 7.04 m tall. | | Frame, longitude sign | A sign or frame error would move the skyline by degrees; it fits to 0.03°. | | Projection, field of view | The app's `hfov_deg` is horizontal; pinhole both sides. The field from the LM's own size (outer pads 110 px apart, pad centres 8.5 m across) is 10.1° against 9.53° from the skyline: 6 %, which changes the 2° by 0.1°. | | Film pixel shape | The LM's height-to-width ratio in the film matches the model's to 4 % (square pixels). | ## Tests - `tests/test_nac_dtm.py`: a synthetic GeoTIFF holding a plane (projection and pixel position against hand-computed values, bilinear sampling exact, no-data, a wrong layout and a wrong label refused); the real DTM against LROC's four elevations (skipped where the file is not on disk); the shipped patch (size, absolute heights at LROC's four places within 0.6 m, the blend without a step). - `tests/test_a17_geometry.py`: the former expected failure is now a normal test (the rover's ground within 0.3 m of LROC's −2 m; the C4 patch alone still says −6.67 m); the LM base from the rover within 0.1° of the film; the ground against the control points (0.28 m rms; the C4 patch alone 1.45 m); the conversions and the camera model against known values. ## Open - For a video stitch: refit the film's camera and record again; the far skyline moved by up to 0.03° and the LM by 1.9°. - The decoration's 0.25 m bump under the parked rover (0.1°) is the app's procedural detail, kept as it is. - The TV camera's exact height and place on the rover, and the rover's heading at the parking place, were not looked up (assumed 1.6 ± 0.3 m, at the driver's eye). - The LM's landed yaw: the film shows the near pad 10° off the line of sight, the app's model 19° (its heading is 270° ± 5°, "approximate" in the model's notes). Not changed. - The other Apollo sites still stand on SLDEM2015 alone (3 to 4 m noise at 100 m scales). LROC has NAC models of them too; not downloaded. - The film's ascent stage seems to climb faster than the model : not examined.