
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "generated/gallery/point_cloud/from_points__orca_cloud.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

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

        :ref:`Go to the end <sphx_glr_download_generated_gallery_point_cloud_from_points__orca_cloud.py>`
        to download the full example code.

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

.. _sphx_glr_generated_gallery_point_cloud_from_points__orca_cloud.py:


ORCA2 Point Cloud
-----------------

This example demonstrates how to render a spherical point cloud.

📋 Summary
^^^^^^^^^^

Creates a point cloud from 1-D latitude, longitude and z-levels.

The resulting mesh contains only points.

Based on a curvilinear ORCA2 global ocean with tri-polar model grid of
sea water potential temperature data, which has been reduced to a limited
area and pre-filtered for temperature gradients.

Note that, Natural Earth coastlines are also rendered along with a Natural
Earth base layer with opacity.

.. tags:: Coastlines, Globe, Opacity, Point Cloud, Texture

----

.. GENERATED FROM PYTHON SOURCE LINES 32-89







.. tab-set::



   .. tab-item:: Static Scene



            
     .. image-sg:: /generated/gallery/point_cloud/images/sphx_glr_from_points__orca_cloud_001.png
        :alt: from points  orca cloud
        :srcset: /generated/gallery/point_cloud/images/sphx_glr_from_points__orca_cloud_001.png
        :class: sphx-glr-single-img
     


   .. tab-item:: Interactive Scene



       .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/geovista/checkouts/v0.5.3/docs/src/generated/gallery/point_cloud/images/sphx_glr_from_points__orca_cloud_001.vtksz






.. code-block:: Python


    from __future__ import annotations

    import geovista as gv
    from geovista.pantry.data import nemo_orca2_gradient
    from geovista.pantry.meshes import ZLEVEL_SCALE_CLOUD
    import geovista.theme


    def main() -> None:
        """Plot a spherical point cloud.

        Notes
        -----
        .. versionadded:: 0.2.0

        """
        # Load the sample data.
        sample = nemo_orca2_gradient()

        # Create the point cloud from the sample data.
        cloud = gv.Transform.from_points(
            sample.lons,
            sample.lats,
            data=sample.zlevel,
            name=sample.name,
            zlevel=-sample.zlevel,
            zscale=ZLEVEL_SCALE_CLOUD,
        )

        # Plot the point cloud.
        plotter = gv.GeoPlotter()
        sargs = {"title": f"{sample.name} / {sample.units}", "shadow": True}
        plotter.add_mesh(
            cloud,
            cmap="deep",
            point_size=5,
            scalar_bar_args=sargs,
            render_points_as_spheres=True,
        )
        plotter.add_coastlines(color="black")
        # Force zlevel alignment of coastlines and base layer.
        plotter.add_base_layer(texture=gv.natural_earth_1(), opacity=0.5, zlevel=0)
        plotter.add_axes()
        plotter.view_yz()
        plotter.add_text(
            "ORCA Point-Cloud (10m Coastlines)",
            position="upper_left",
            font_size=10,
            shadow=True,
        )
        plotter.camera.zoom(1.3)
        plotter.show()


    if __name__ == "__main__":
        main()


.. _sphx_glr_download_generated_gallery_point_cloud_from_points__orca_cloud.py:

.. only:: html

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

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

      :download:`Download Jupyter notebook: from_points__orca_cloud.ipynb <from_points__orca_cloud.ipynb>`

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

      :download:`Download Python source code: from_points__orca_cloud.py <from_points__orca_cloud.py>`

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

      :download:`Download zipped: from_points__orca_cloud.zip <from_points__orca_cloud.zip>`


.. only:: html

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

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