A small Python package aimed at extracting cutouts of lunar craters from a larger dataset of lunar elevation. The dataset is an 8 GB digital elevation model based on the Lunar Orbiter Laser Altimeter (LOLA) data from NASA's Lunar Reconnaissance Orbiter spacecraft.
It provides a few convenience scripts for processing the LOLA dataset. For example, it can make a cutout around the Tycho crater and warp it to get rid of projection errors (i.e. craters are generally circles, not ellipses), saving it into a .tif file:
from moon import io as mio
mio.crater_cutout('tycho', destNameOrDestDS="tycho.tif", format="GTIFF")
A (rudimentary) simple flask
API is provided, serving the .tif
cutouts:
- On server side:
export FLASK_APP=lunar_api.py; python -m flask run
- On client side:
curl http://127.0.0.1:5000/craters\?name=tycho --output tycho.tif
Example #1: inject them in interactive visualizations (click here for a demo).
Example #2: open and plot the elevation with rasterio
:
import rasterio
import rasterio.plot as rioplot
import matplotlib.pyplot as plt
dem = rasterio.open('tycho.tif')
ax = rioplot.show(dem, title='Tycho crater')
ax.set_xlabel('meters')
ax.set_ylabel('meters')