Follow the strip offsets, and add the other three Apollo DTMs - #18
Merged
Merged
Conversation
read_window assumed the rows of an image are stored in file order, so a window could be fetched as one byte range from the first row's offset to the last. That is true of Apollo 15 and false of Apollo 12, which keeps ROW 0 at the very end of the file, after every other row, with a two-row gap in the middle for good measure. Read as one run it came back as real floating point numbers taken from the wrong rows: elevations of 3e38, a landscape of noise, and nothing that looked like an error. It now groups the wanted rows into runs that are genuinely contiguous and issues one request per run -- a file that is in order still costs exactly one request -- and caps the size of a run, which also fixes the truncated read that a single 13.5 MB range was quietly returning short. With that, three more LROC NAC stereo DTMs work, all 2 m per pixel and all checked by inverting their corner pixels against their published extents: apollo11 Tranquility Base 4.22 x 27.96 km apollo12 Surveyor Crater 4.94 x 2.73 km apollo14 Fra Mauro and Cone Crater 4.31 x 28.80 km Apollo 12 is the interesting one. None of the six missions landed inside a crater -- a crater floor is the last place you want to set down -- but Conrad put Intrepid on the rim of Surveyor Crater, close enough to walk down to Surveyor 3 on its inner slope. Searching the DTM for depressions rather than trusting the catalogue finds it at 208 m across and 21 m rim to floor, 139 m from the published landing site; the catalogued diameter is about 200 m. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kq1Cjkh3bVT1WLzh5FRVQG
2.20 x 1.60 km of Fra Mauro at 2 m per block, holding both Antares and Cone Crater 1,481 m away -- the crater Shepard and Mitchell climbed towards and turned back short of. Measured off the data rather than taken from the catalogue: 351 m across against a published figure of about 340 m. Depth depends entirely on which rim you stand on, because Cone sits on the flank of a ridge: 44 m from the west rim down to the floor, while the ground east of it simply keeps climbing and never really has a rim at all. Quoting the eastern side gives 88 m, which is the ridge and not the crater. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kq1Cjkh3bVT1WLzh5FRVQG
They run to megabytes each and there is no end to how many there could be -- every landing site, every crater, at whatever window and stride somebody fancies. Six of them had already reached 5 MB, and git keeps every version of everything for ever. They are also perfectly reproducible: the source is a fixed published DEM and the reader is deterministic, so the command IS the file. examples/data/README.md now records the command for each, which is smaller than the data and rather more use -- it says what the window is and why it is drawn where it is, which the bytes do not. Every command in it was checked by re-fetching and comparing arrays; all six come back identical. The small 118 m and 463 m windows stay committed on purpose, so the examples still run with no network at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kq1Cjkh3bVT1WLzh5FRVQG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
read_windowassumed the rows of an image are stored in file order, so a window could be fetched as one byte range from the first row's offset to the last. True of Apollo 15; false of Apollo 12, which keeps row 0 at the very end of the file, after every other row, with a two-row gap in the middle.Read as one run it came back as real floating-point numbers taken from the wrong rows — elevations of 3×10³⁸, a landscape of noise, and nothing that looked like an error. It now groups the wanted rows into genuinely contiguous runs and issues one request per run (a file that is in order still costs exactly one request), and caps run size, which also fixes the truncated read a single 13.5 MB range was quietly returning short.
With that, three more LROC NAC stereo DTMs work, all 2 m/px, each checked by inverting its corner pixels against its published extent:
apollo11apollo12apollo14Apollo 12 is the interesting one. None of the six landed inside a crater — a crater floor is the last place you want to set down — but Conrad put Intrepid on the rim of Surveyor Crater, close enough to walk down to Surveyor 3 on its inner slope. Searching the DTM for depressions rather than trusting the catalogue finds it at 208 m across, 21 m rim to floor, 139 m from the published landing site; the catalogued diameter is ~200 m.
The DEM test now carries every DEM's own header and asserts the two sets match, so adding a DEM without one fails rather than silently checking it against the wrong file.
236 tests.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kq1Cjkh3bVT1WLzh5FRVQG