:orphan:



.. _sphx_glr_generated_examples:

.. _example-gallery:

Example gallery
===============

This gallery of examples shows a variety of relatively small snippets or
examples of tasks that can be done with the Astropy core package.
Contributions from the community are encouraged!

Longer-form tutorials (or tutorials for
`affiliated packages <http://affiliated.astropy.org>`_) belong at
https://learn.astropy.org (and can be submitted at
`the associated github repository <https://github.com/astropy/astropy-tutorials>`_).



.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_generated_examples_coordinates:

.. _example-gallery-coordinates:

astropy.coordinates
-------------------

General examples of the `astropy.coordinates` subpackage.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Radial or line-of-sight velocities of sources are often reported in a Heliocentric or Solar-sys...">

.. only:: html

 .. figure:: /generated/examples/coordinates/images/thumb/sphx_glr_rv-to-gsr_thumb.png
     :alt: Convert a radial velocity to the Galactic Standard of Rest (GSR)

     :ref:`sphx_glr_generated_examples_coordinates_rv-to-gsr.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/coordinates/rv-to-gsr

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates coordinate transformations and the creation of visibility curves to a...">

.. only:: html

 .. figure:: /generated/examples/coordinates/images/thumb/sphx_glr_plot_obs-planning_thumb.png
     :alt: Determining and plotting the altitude/azimuth of a celestial object

     :ref:`sphx_glr_generated_examples_coordinates_plot_obs-planning.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/coordinates/plot_obs-planning

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This document shows a few examples of how to use and customize the ~astropy.coordinates.Galacto...">

.. only:: html

 .. figure:: /generated/examples/coordinates/images/thumb/sphx_glr_plot_galactocentric-frame_thumb.png
     :alt: Transforming positions and velocities to and from a Galactocentric frame

     :ref:`sphx_glr_generated_examples_coordinates_plot_galactocentric-frame.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/coordinates/plot_galactocentric-frame

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This document describes in detail how to subclass and define a custom spherical coordinate fram...">

.. only:: html

 .. figure:: /generated/examples/coordinates/images/thumb/sphx_glr_plot_sgr-coordinate-frame_thumb.png
     :alt: Create a new coordinate class (for the Sagittarius stream)

     :ref:`sphx_glr_generated_examples_coordinates_plot_sgr-coordinate-frame.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/coordinates/plot_sgr-coordinate-frame
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_generated_examples_io:

.. _example-gallery-io:

astropy.io
----------

General examples of the ``astropy.io`` subpackages.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to create a multi-extension FITS (MEF) file from scratch using as...">

.. only:: html

 .. figure:: /generated/examples/io/images/thumb/sphx_glr_create-mef_thumb.png
     :alt: Create a multi-extension FITS (MEF) file from scratch

     :ref:`sphx_glr_generated_examples_io_create-mef.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/io/create-mef

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to create a large file (larger than will fit in memory) from scra...">

.. only:: html

 .. figure:: /generated/examples/io/images/thumb/sphx_glr_skip_create-large-fits_thumb.png
     :alt: Create a very large FITS file from scratch

     :ref:`sphx_glr_generated_examples_io_skip_create-large-fits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/io/skip_create-large-fits

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example opens an RGB JPEG image and writes out each channel as a separate FITS (image) fil...">

.. only:: html

 .. figure:: /generated/examples/io/images/thumb/sphx_glr_split-jpeg-to-fits_thumb.png
     :alt: Convert a 3-color image (JPG) to separate FITS images

     :ref:`sphx_glr_generated_examples_io_split-jpeg-to-fits.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /generated/examples/io/split-jpeg-to-fits
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-gallery


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

    :download:`Download all examples in Python source code: examples_python.zip </generated/examples/examples_python.zip>`



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

    :download:`Download all examples in Jupyter notebooks: examples_jupyter.zip </generated/examples/examples_jupyter.zip>`


.. only:: html

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

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