
.. 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.5-Kepler_crater_datasurface.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.5-Kepler_crater_datasurface.py>`
        to download the full example code.

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

.. _sphx_glr_auto_examples_01-simulation_and_visualization_1.5-Kepler_crater_datasurface.py:


Create a DataSurface centered on Kepler crater
==============================================

.. rubric:: By David Minton

This example demonstrates how to use the DataSurface to fetch real DEM data for a local region on the Moon. In this case, we center the surface on Kepler crater (321.9913E, 8.121N) with a radius of 50 km and a resolution of 200 m/pix. We then visualize the surface using PyVista both with and without the superdomain.

.. GENERATED FROM PYTHON SOURCE LINES 10-30







.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /auto_examples/01-simulation_and_visualization/images/sphx_glr_1.5-Kepler_crater_datasurface_001.png
        :alt: 1.5 Kepler crater datasurface
        :srcset: /auto_examples/01-simulation_and_visualization/images/sphx_glr_1.5-Kepler_crater_datasurface_001.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/cratermaker/checkouts/v2026.4.1-alpha/docs/auto_examples/01-simulation_and_visualization/images/sphx_glr_1.5-Kepler_crater_datasurface_001.vtksz






.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /auto_examples/01-simulation_and_visualization/images/sphx_glr_1.5-Kepler_crater_datasurface_002.png
        :alt: 1.5 Kepler crater datasurface
        :srcset: /auto_examples/01-simulation_and_visualization/images/sphx_glr_1.5-Kepler_crater_datasurface_002.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/cratermaker/checkouts/v2026.4.1-alpha/docs/auto_examples/01-simulation_and_visualization/images/sphx_glr_1.5-Kepler_crater_datasurface_002.vtksz



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

 .. code-block:: none

    Generating a new grid.
    Creating a new grid
    Center of local region: (-38.008699999999976, 8.121)
    Radius of local region: 50.00 km
    Local region pixel size: 236.9 m
    Reading DEM files:
      https://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/sldem2015/global/float_img/sldem2015_128_60s_60n_000_360_float.xml
    Generated 140271 points in the local region.
    Generated 33667 points in the superdomain region.
    Reading global DEM file:
      https://pds-geosciences.wustl.edu/lro/lro-l-lola-3-rdr-v1/lrolol_1xxx/data/lola_gdr/cylindrical/float_img/ldem_4_float.xml






|

.. code-block:: Python


    import os

    simdir = "simdata-1_5"
    from cratermaker import Surface

    # 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 cm.cleanup(simdir) will remove all pre-existing output files.
    surface = Surface.maker(
        "datasurface",
        local_location=(321.9913, 8.121),
        local_radius=50.0e3,
        pix=200.0,
        simdir=simdir,
        ask_overwrite=False,
        reset=True,
    )
    surface.show3d(superdomain=False)
    surface.show3d(superdomain=True)


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

   **Total running time of the script:** (1 minutes 6.564 seconds)


.. _sphx_glr_download_auto_examples_01-simulation_and_visualization_1.5-Kepler_crater_datasurface.py:

.. only:: html

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

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

      :download:`Download Jupyter notebook: 1.5-Kepler_crater_datasurface.ipynb <1.5-Kepler_crater_datasurface.ipynb>`

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

      :download:`Download Python source code: 1.5-Kepler_crater_datasurface.py <1.5-Kepler_crater_datasurface.py>`

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

      :download:`Download zipped: 1.5-Kepler_crater_datasurface.zip <1.5-Kepler_crater_datasurface.zip>`


.. only:: html

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

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