Spaces:
Running
Running
|
Download README.md from AK51/LunarVideoMap: direct link, hf CLI and curl.
- Browser
- Download file 6.11 kB
-
https://huggingface.co/spaces/AK51/LunarVideoMap/resolve/main/README.md
- Command line
-
hf download hf://spaces/AK51/LunarVideoMap/README.md
-
curl -L -o README.md https://huggingface.co/spaces/AK51/LunarVideoMap/resolve/main/README.md
6.11 kB
| title: Moon Mapper | |
| emoji: 🌕 | |
| colorFrom: indigo | |
| colorTo: gray | |
| sdk: static | |
| app_file: index.html | |
| pinned: false | |
| short_description: Map a telescope Moon video with coordinates and flashes | |
| # Moon Mapper | |
| A browser app (three.js) for Moon videos recorded with a telescope (tested with Seestar S50 Pro footage). It finds the Moon in the video, | |
| works out which way the Moon is turned, and then draws these on top of the live video: | |
| - a selenographic latitude/longitude grid (equator and prime meridian in orange) | |
| - an optional LROC WAC colour layer | |
| - named features (landing sites, maria, craters, poles); search one or click the Moon to identify a spot | |
| - lunar impact-flash candidates, each placed at its lunar latitude/longitude | |
| Three views can be shown alone or side by side, each with a title bar: | |
| - **Video overlay**: the telescope video with the aligned grid, labels and an optional LROC/geologic layer | |
| - **LROC globe**: an interactive 3D Moon built from the LROC WAC colour map (8k, or 16k if the GPU supports it) | |
| - **Geologic globe**: the same 3D Moon with the USGS unified geologic map | |
| The two globes share one camera, start from the same viewpoint as the video, and rotate together. | |
| The Moon is drawn at the same size in all three views. The mouse wheel zooms around the cursor in any view, and all | |
| three views zoom and pan together. "Fit Moon" resets the zoom. | |
| Ctrl/Shift-click a view button to combine views. After a flash scan, "Show flash markers on the Moon" hides or shows | |
| the flash markers; detected flashes also appear as red dots on the timeline. | |
| Clicking a flash (in the list or on the timeline) opens a **flash replay** panel. It loops the 2 s around the flash at | |
| 1?, ??, ?? (default) or ?? speed and shows a 2?/4?/8? magnified, optionally brightened, view centred on the flash spot, | |
| which follows the Moon's drift. A red ring and a FLASH badge mark the frames where the flash is on screen. "Freeze on flash" | |
| stops on the peak frame. Drag the panel by its header; Esc closes it. "Drape video on globes" projects the video onto the globes. It is off by default, | |
| because the video has far less resolution than the maps. | |
| ## Run | |
| The app has to be served over HTTP, and the server must support **Range requests**, otherwise browsers cannot seek in the MP4. | |
| Python's built-in `http.server` does not support them, so use the included server: | |
| ``` | |
| python serve.py # http://localhost:8000/ | |
| ``` | |
| Open the URL in Chrome or Edge. `short_flash.mp4` (79 frames, from AK51/MoonFlash) loads at start and is scanned for flashes | |
| straight away. Its flash is found at 2.03 s (frame 61). **Long sample** loads `2026-10-20-234910-Lunar.mp4`. Use **Upload MP4** | |
| or drag and drop to load your own file. Uploaded files stay in the browser and are never sent anywhere. | |
| ## Languages | |
| The interface is available in English, Simplified Chinese and Traditional Chinese (switch at the top of the panel; the choice is | |
| remembered, and the first visit follows the browser language). Feature names and descriptions are translated too, and the search | |
| accepts names in any of the three languages. | |
| Strings live in `tools/i18n_src.py`. Traditional Chinese is generated from Simplified with OpenCC (Taiwan phrasing) plus a small | |
| fix-up list. After editing, rebuild `js/i18n.js`: | |
| ``` | |
| pip install opencc-python-reimplemented | |
| python tools/build_i18n.py | |
| ``` | |
| ## How it works | |
| | Step | Method | | |
| |---|---| | |
| | Moon detection | Brightness threshold → largest blob → RANSAC circle fit on its edge. The sunlit limb is a true circle and the terminator is not, so the fit locks onto the limb at any phase brighter than a thin crescent. | | |
| | Orientation | The LROC albedo map is projected onto the disc for many candidate rotations θ (and libration b₀, l₀). Each is scored by normalized cross-correlation against the video frame. Both images are high-pass filtered first (divided by their local mean), so the maria/highland pattern is compared and illumination is ignored. The search does a coarse 3° sweep, then refines θ and libration. | | |
| | Prior | The recording time is read from the file name when it contains `YYYY-MM-DD-HHMMSS` (as smart telescopes such as the Seestar write it). `astronomy-engine` turns it into the libration and phase angle for that time. Set the UTC offset to the time zone the video was recorded in. | | |
| | Sun shading | Direction from the centroid of the lit area; elevation from the ephemeris phase angle (or from the lit fraction when no time is known). | | |
| | Drift | Each frame is tracked by the centroid of the lit area. A flash scan stores an exact per-frame track. | | |
| | Impact flashes | The `detector.js` engine from [AK51/MoonFlash](https://huggingface.co/spaces/AK51/MoonFlash): rolling background, top-hat filter, compact/round transient tests. Each candidate is mapped to lat/lon through the fitted orientation. | | |
| On the sample video the fit gives north rotated 73.3° clockwise from image-up and libration (1.0°, −5.9°). The ephemeris gives (1.03°, −4.89°). | |
| If the score is "weak", use **Fine-tune orientation**. Tick **Allow mirrored image** for optics that flip the image | |
| (star diagonal, erecting prism). Cameras at the prime focus, as in most smart telescopes, are not mirrored. | |
| ## Files | |
| ``` | |
| index.html, css/style.css | |
| js/main.js UI, three.js scenes/shaders, labels, picking, flash scan | |
| js/moonfit.js disc detection, orientation matching, coordinate math | |
| js/mp4info.js reads the exact frame count / fps from the MP4 header | |
| js/locations.js feature database (from AK51/LunarMap) | |
| js/i18n.js generated UI strings + feature names in en / zh-CN / zh-TW | |
| tools/ i18n source strings and build script | |
| js/vendor/ three.js r160, OrbitControls, astronomy-engine 2.1.19, MoonFlash detector.js | |
| assets/ LROC colour and USGS geologic maps, 2k / 8k / 16k, from AK51/LunarMap | |
| (2k LROC is used for matching; 8k or 16k for display) | |
| serve.py static server with HTTP Range support | |
| ``` | |
| Flash detection is a screening tool. Confirming a real impact needs a second, simultaneous recording. | |