Note
Go to the end to download the full example code.
Load a DEM of phobos#
By Leo Minton
This example shows how to load arbitrary DEM data using the data composer.

Creating a new grid
Generating a mesh with icosphere level 7.
Applying 1 dataset to the mesh
Reading https://planetarymaps.usgs.gov/mosaic/Phobos_ME_HRSC_DEM_Global_2ppd.tif (699x349px of 699x349px)
Reading data...: 0%| | 0/1 [00:00<?, ?chunks/s]
Reading data...: 100%|██████████| 1/1 [00:00<00:00, 1.39chunks/s]
Reading data...: 100%|██████████| 1/1 [00:00<00:00, 1.39chunks/s]
from cratermaker import Simulation
simdir = "simdata-1_7"
# Note, that for these examples we pass ask_overwrite=False and reset=True to the Simulation constructor. This will suppress
# prompts that ask the user if they want to overwrite existing files, which would would prevent these examples from running on their
# own when building the documentation pages. Alternatively, calling cratermaker.cleanup(simdir) will remove all pre-existing output files.
sim = Simulation(
target="Phobos",
surface="icosphere",
simdir=simdir,
gridlevel=7,
ask_overwrite=False,
reset=True,
)
# with sim.surface.data_composer() as composer:
# composer.update_elevation("https://planetarymaps.usgs.gov/mosaic/Phobos_ME_HRSC_DEM_Global_2ppd.tif")
sim.surface.update_elevation("https://planetarymaps.usgs.gov/mosaic/Phobos_ME_HRSC_DEM_Global_2ppd.tif", overwrite=True)
sim.show3d()
Total running time of the script: (0 minutes 8.543 seconds)