diff --git a/.gitignore b/.gitignore index 123d8d7..f5c5a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target /examples/models/nasa/ /data/ +__pycache__/ diff --git a/scripts/fetch-moon.py b/scripts/fetch-moon.py index 91b4153..65b3d25 100644 --- a/scripts/fetch-moon.py +++ b/scripts/fetch-moon.py @@ -22,7 +22,8 @@ bands relative to 643 nm over the whole mosaic, weighted by area: it downloads e tile of every band in turn (56 files, 8 GB) and keeps none of them. That is how the spectrum in crates/resolved/src/moon.rs was found. -Needs numpy and Pillow. +Needs numpy and Pillow. Building the image takes about 20 s and 2.6 GB of memory once +the tiles are downloaded (about a minute at 50 MB/s, with a pause between files). """ import hashlib @@ -67,6 +68,7 @@ LINES = {"N": 5321, "S": 5320} ROWS = 70 * PPD # 5320 lines from the equator to 70 degrees OUT_W, OUT_H = 16384, 8192 SCALE = 100_000 # stored value per unit I/F +STRIP = 512 # rows or columns resampled at a time def url(band, tile): @@ -106,18 +108,24 @@ def fetch(band, tile, sha, directory): return path -def read_tile(path, hemisphere): - """The tile's 5320 lines from the equator outward, as rows from north to south.""" - data = np.fromfile(path, dtype="