
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/01-simulation_and_visualization/1.7-load_phobos_dem.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_auto_examples_01-simulation_and_visualization_1.7-load_phobos_dem.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_01-simulation_and_visualization_1.7-load_phobos_dem.py:


Load a DEM of phobos
====================

.. rubric:: By Leo Minton

This example shows how to load arbitrary DEM data using the data composer.

.. GENERATED FROM PYTHON SOURCE LINES 10-31







.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /auto_examples/01-simulation_and_visualization/images/sphx_glr_1.7-load_phobos_dem_001.png
        :alt: 1.7 load phobos dem
        :srcset: /auto_examples/01-simulation_and_visualization/images/sphx_glr_1.7-load_phobos_dem_001.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/cratermaker/checkouts/latest/docs/auto_examples/01-simulation_and_visualization/images/sphx_glr_1.7-load_phobos_dem_001.vtksz



.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    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)
      0%|          | 0/70 [00:00<?, ?it/s]      1%|▏         | 1/70 [00:00<00:21,  3.25it/s]      4%|▍         | 3/70 [00:00<00:09,  7.07it/s]     10%|█         | 7/70 [00:00<00:05, 12.34it/s]     24%|██▍       | 17/70 [00:00<00:02, 26.42it/s]     50%|█████     | 35/70 [00:01<00:00, 47.76it/s]    100%|██████████| 70/70 [00:01<00:00, 63.80it/s]
            Calculating pixel distances
        Setting elevation data
        Done






|

.. code-block:: Python


    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.add_data("https://planetarymaps.usgs.gov/mosaic/Phobos_ME_HRSC_DEM_Global_2ppd.tif")

    sim.show3d()


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 10.788 seconds)


.. _sphx_glr_download_auto_examples_01-simulation_and_visualization_1.7-load_phobos_dem.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: 1.7-load_phobos_dem.ipynb <1.7-load_phobos_dem.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: 1.7-load_phobos_dem.py <1.7-load_phobos_dem.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: 1.7-load_phobos_dem.zip <1.7-load_phobos_dem.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
