
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "generated/examples/coordinates/plot_sgr-coordinate-frame.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

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

        Click :ref:`here <sphx_glr_download_generated_examples_coordinates_plot_sgr-coordinate-frame.py>`
        to download the full example code

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

.. _sphx_glr_generated_examples_coordinates_plot_sgr-coordinate-frame.py:


==========================================================
Create a new coordinate class (for the Sagittarius stream)
==========================================================

This document describes in detail how to subclass and define a custom spherical
coordinate frame, as discussed in :ref:`astropy-coordinates-design` and the
docstring for `~astropy.coordinates.BaseCoordinateFrame`. In this example, we
will define a coordinate system defined by the plane of orbit of the Sagittarius
Dwarf Galaxy (hereafter Sgr; as defined in Majewski et al. 2003).  The Sgr
coordinate system is often referred to in terms of two angular coordinates,
:math:`\Lambda,B`.

To do this, we need to define a subclass of
`~astropy.coordinates.BaseCoordinateFrame` that knows the names and units of the
coordinate system angles in each of the supported representations.  In this case
we support `~astropy.coordinates.SphericalRepresentation` with "Lambda" and
"Beta". Then we have to define the transformation from this coordinate system to
some other built-in system. Here we will use Galactic coordinates, represented
by the `~astropy.coordinates.Galactic` class.

See Also
--------

* The `gala package <http://gala.adrian.pw/>`_, which defines a number of
  Astropy coordinate frames for stellar stream coordinate systems.
* Majewski et al. 2003, "A Two Micron All Sky Survey View of the Sagittarius
  Dwarf Galaxy. I. Morphology of the Sagittarius Core and Tidal Arms",
  https://arxiv.org/abs/astro-ph/0304198
* Law & Majewski 2010, "The Sagittarius Dwarf Galaxy: A Model for Evolution in a
  Triaxial Milky Way Halo", https://arxiv.org/abs/1003.1132
* David Law's Sgr info page https://www.stsci.edu/~dlaw/Sgr/


*By: Adrian Price-Whelan, Erik Tollerud*

*License: BSD*

.. GENERATED FROM PYTHON SOURCE LINES 44-46

Make `print` work the same in all versions of Python, set up numpy,
matplotlib, and use a nicer set of plot parameters:

.. GENERATED FROM PYTHON SOURCE LINES 46-53

.. code-block:: default


    import numpy as np
    import matplotlib.pyplot as plt
    from astropy.visualization import astropy_mpl_style
    plt.style.use(astropy_mpl_style)









.. GENERATED FROM PYTHON SOURCE LINES 54-55

Import the packages necessary for coordinates

.. GENERATED FROM PYTHON SOURCE LINES 55-61

.. code-block:: default


    from astropy.coordinates import frame_transform_graph
    from astropy.coordinates.matrix_utilities import rotation_matrix, matrix_product, matrix_transpose
    import astropy.coordinates as coord
    import astropy.units as u








.. GENERATED FROM PYTHON SOURCE LINES 62-65

The first step is to create a new class, which we'll call
``Sagittarius`` and make it a subclass of
`~astropy.coordinates.BaseCoordinateFrame`:

.. GENERATED FROM PYTHON SOURCE LINES 65-105

.. code-block:: default


    class Sagittarius(coord.BaseCoordinateFrame):
        """
        A Heliocentric spherical coordinate system defined by the orbit
        of the Sagittarius dwarf galaxy, as described in
            https://ui.adsabs.harvard.edu/abs/2003ApJ...599.1082M
        and further explained in
            https://www.stsci.edu/~dlaw/Sgr/.

        Parameters
        ----------
        representation : `~astropy.coordinates.BaseRepresentation` or None
            A representation object or None to have no data (or use the other keywords)
        Lambda : `~astropy.coordinates.Angle`, optional, must be keyword
            The longitude-like angle corresponding to Sagittarius' orbit.
        Beta : `~astropy.coordinates.Angle`, optional, must be keyword
            The latitude-like angle corresponding to Sagittarius' orbit.
        distance : `Quantity`, optional, must be keyword
            The Distance for this object along the line-of-sight.
        pm_Lambda_cosBeta : :class:`~astropy.units.Quantity`, optional, must be keyword
            The proper motion along the stream in ``Lambda`` (including the
            ``cos(Beta)`` factor) for this object (``pm_Beta`` must also be given).
        pm_Beta : :class:`~astropy.units.Quantity`, optional, must be keyword
            The proper motion in Declination for this object (``pm_ra_cosdec`` must
            also be given).
        radial_velocity : :class:`~astropy.units.Quantity`, optional, must be keyword
            The radial velocity of this object.

        """

        default_representation = coord.SphericalRepresentation
        default_differential = coord.SphericalCosLatDifferential

        frame_specific_representation_info = {
            coord.SphericalRepresentation: [
                coord.RepresentationMapping('lon', 'Lambda'),
                coord.RepresentationMapping('lat', 'Beta'),
                coord.RepresentationMapping('distance', 'distance')]
        }








.. GENERATED FROM PYTHON SOURCE LINES 106-124

Breaking this down line-by-line, we define the class as a subclass of
`~astropy.coordinates.BaseCoordinateFrame`. Then we include a descriptive
docstring.  The final lines are class-level attributes that specify the
default representation for the data, default differential for the velocity
information, and mappings from the attribute names used by representation
objects to the names that are to be used by the ``Sagittarius`` frame. In this
case we override the names in the spherical representations but don't do
anything with other representations like cartesian or cylindrical.

Next we have to define the transformation from this coordinate system to some
other built-in coordinate system; we will use Galactic coordinates. We can do
this by defining functions that return transformation matrices, or by simply
defining a function that accepts a coordinate and returns a new coordinate in
the new system. Because the transformation to the Sagittarius coordinate
system is just a spherical rotation from Galactic coordinates, we'll just
define a function that returns this matrix. We'll start by constructing the
transformation matrix using pre-determined Euler angles and the
``rotation_matrix`` helper function:

.. GENERATED FROM PYTHON SOURCE LINES 124-136

.. code-block:: default


    SGR_PHI = (180 + 3.75) * u.degree # Euler angles (from Law & Majewski 2010)
    SGR_THETA = (90 - 13.46) * u.degree
    SGR_PSI = (180 + 14.111534) * u.degree

    # Generate the rotation matrix using the x-convention (see Goldstein)
    D = rotation_matrix(SGR_PHI, "z")
    C = rotation_matrix(SGR_THETA, "x")
    B = rotation_matrix(SGR_PSI, "z")
    A = np.diag([1.,1.,-1.])
    SGR_MATRIX = matrix_product(A, B, C, D)








.. GENERATED FROM PYTHON SOURCE LINES 137-140

Since we already constructed the transformation (rotation) matrix above, and
the inverse of a rotation matrix is just its transpose, the required
transformation functions are very simple:

.. GENERATED FROM PYTHON SOURCE LINES 140-148

.. code-block:: default


    @frame_transform_graph.transform(coord.StaticMatrixTransform, coord.Galactic, Sagittarius)
    def galactic_to_sgr():
        """ Compute the transformation matrix from Galactic spherical to
            heliocentric Sgr coordinates.
        """
        return SGR_MATRIX








.. GENERATED FROM PYTHON SOURCE LINES 149-156

The decorator ``@frame_transform_graph.transform(coord.StaticMatrixTransform,
coord.Galactic, Sagittarius)``  registers this function on the
``frame_transform_graph`` as a coordinate transformation. Inside the function,
we simply return the previously defined rotation matrix.

We then register the inverse transformation by using the transpose of the
rotation matrix (which is faster to compute than the inverse):

.. GENERATED FROM PYTHON SOURCE LINES 156-164

.. code-block:: default


    @frame_transform_graph.transform(coord.StaticMatrixTransform, Sagittarius, coord.Galactic)
    def sgr_to_galactic():
        """ Compute the transformation matrix from heliocentric Sgr coordinates to
            spherical Galactic.
        """
        return matrix_transpose(SGR_MATRIX)








.. GENERATED FROM PYTHON SOURCE LINES 165-170

Now that we've registered these transformations between ``Sagittarius`` and
`~astropy.coordinates.Galactic`, we can transform between *any* coordinate
system and ``Sagittarius`` (as long as the other system has a path to
transform to `~astropy.coordinates.Galactic`). For example, to transform from
ICRS coordinates to ``Sagittarius``, we would do:

.. GENERATED FROM PYTHON SOURCE LINES 170-175

.. code-block:: default


    icrs = coord.SkyCoord(280.161732*u.degree, 11.91934*u.degree, frame='icrs')
    sgr = icrs.transform_to(Sagittarius)
    print(sgr)





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

 Out:

 .. code-block:: none

    <SkyCoord (Sagittarius): (Lambda, Beta) in deg
        (346.81830652, -39.28360407)>




.. GENERATED FROM PYTHON SOURCE LINES 176-178

Or, to transform from the ``Sagittarius`` frame to ICRS coordinates (in this
case, a line along the ``Sagittarius`` x-y plane):

.. GENERATED FROM PYTHON SOURCE LINES 178-184

.. code-block:: default


    sgr = coord.SkyCoord(Lambda=np.linspace(0, 2*np.pi, 128)*u.radian,
                         Beta=np.zeros(128)*u.radian, frame='sagittarius')
    icrs = sgr.transform_to(coord.ICRS)
    print(icrs)





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

 Out:

 .. code-block:: none

    <SkyCoord (ICRS): (ra, dec) in deg
        [(284.03876751, -29.00408353), (287.24685769, -29.44848352),
         (290.48068369, -29.81535572), (293.7357366 , -30.1029631 ),
         (297.00711066, -30.30991693), (300.28958688, -30.43520293),
         (303.57772919, -30.47820084), (306.86598944, -30.43869669),
         (310.14881715, -30.31688708), (313.42076929, -30.11337526),
         (316.67661568, -29.82915917), (319.91143548, -29.46561215),
         (323.12070147, -29.02445708), (326.30034928, -28.50773532),
         (329.44683007, -27.9177717 ), (332.55714589, -27.257137  ),
         (335.62886847, -26.52860943), (338.66014233, -25.73513624),
         (341.64967439, -24.87979679), (344.59671212, -23.96576781),
         (347.50101283, -22.99629167), (350.36280652, -21.97464811),
         (353.18275454, -20.90412969), (355.96190618, -19.78802107),
         (358.70165491, -18.62958199), (  1.40369557, -17.43203397),
         (  4.06998374, -16.19855028), (  6.70269788, -14.93224899),
         (  9.30420479, -13.63618882), ( 11.87702861, -12.31336727),
         ( 14.42382347, -10.96672102), ( 16.94734952,  -9.59912794),
         ( 19.45045241,  -8.21341071), ( 21.93604568,  -6.81234162),
         ( 24.40709589,  -5.39864845), ( 26.86661004,  -3.97502106),
         ( 29.31762493,  -2.54411871), ( 31.76319801,  -1.10857781),
         ( 34.20639942,   0.32898001), ( 36.65030466,   1.76593955),
         ( 39.09798768,   3.19968374), ( 41.55251374,   4.6275852 ),
         ( 44.01693189,   6.04699804), ( 46.49426651,   7.45524993),
         ( 48.98750752,   8.84963453), ( 51.4995989 ,  10.22740448),
         ( 54.03342512,  11.58576509), ( 56.59179508,  12.92186896),
         ( 59.17742314,  14.23281165), ( 61.79290712,  15.51562883),
         ( 64.44070278,  16.76729487), ( 67.12309478,  17.98472356),
         ( 69.84216409,  19.16477088), ( 72.59975183,  20.30424045),
         ( 75.39742013,  21.3998918 ), ( 78.23641033,  22.44845192),
         ( 81.11759966,  23.44663022), ( 84.04145735,  24.39113719),
         ( 87.00800203,  25.27870692), ( 90.01676196,  26.10612335),
         ( 93.06674057,  26.87025019), ( 96.15638947,  27.56806406),
         ( 99.28359159,  28.19669038), (102.44565666,  28.75344107),
         (105.63933131,  29.23585315), (108.86082534,  29.64172698),
         (112.105855  ,  29.96916281), (115.36970341,  30.21659414),
         (118.64729687,  30.38281659), (121.93329519,  30.46701088),
         (125.22219273,  30.46875885), (128.50842634,  30.38805179),
         (131.78648572,  30.22529063), (135.05102157,  29.98127794),
         (138.29694697,  29.6572022 ), (141.51952827,  29.2546151 ),
         (144.71446203,  28.77540295), (147.87793614,  28.22175338),
         (151.00667382,  27.59611901), (154.09796066,  26.90117914),
         (157.14965528,  26.13980125), (160.16018547,  25.31500315),
         (163.12853176,  24.42991703), (166.05420084,  23.48775622),
         (168.93719133,  22.49178507), (171.77795423,  21.44529257),
         (174.57735037,  20.35156967), (177.33660656,  19.21389046),
         (180.05727218,  18.03549704), (182.74117737,  16.81958784),
         (185.39039367,  15.56930924), (188.00719783,  14.28774998),
         (190.59403895,  12.97793826), (193.15350938,  11.64284103),
         (195.68831902,  10.28536518), (198.20127316,   8.90836046),
         (200.69525342,   7.51462369), (203.17320154,   6.10690412),
         (205.63810576,   4.6879097 ), (208.09298919,   3.26031403),
         (210.54090002,   1.82676397), (212.984903  ,   0.38988751),
         (215.42807182,  -1.04769799), (217.87348209,  -2.48337744),
         (220.32420429,  -3.91452965), (222.7832966 ,  -5.338519  ),
         (225.25379684,  -6.75268736), (227.73871349,  -8.15434631),
         (230.24101506,  -9.54076983), (232.76361762, -10.90918763),
         (235.30937003, -12.25677927), (237.88103647, -13.58066929),
         (240.48127601, -14.87792359), (243.11261883, -16.14554723),
         (245.777439  , -17.38048408), (248.47792364, -18.57961852),
         (251.2160385 , -19.7397795 ), (253.9934903 , -20.85774736),
         (256.81168612, -21.93026371), (259.67169071, -22.95404466),
         (262.57418275, -23.92579758), (265.51941137, -24.84224172),
         (268.50715471, -25.70013256), (271.53668252, -26.49628998),
         (274.6067251 , -27.22762983), (277.71545113, -27.89119849),
         (280.86045662, -28.48420985), (284.03876751, -29.00408353)]>




.. GENERATED FROM PYTHON SOURCE LINES 185-186

As an example, we'll now plot the points in both coordinate systems:

.. GENERATED FROM PYTHON SOURCE LINES 186-200

.. code-block:: default


    fig, axes = plt.subplots(2, 1, figsize=(8, 10),
                             subplot_kw={'projection': 'aitoff'})

    axes[0].set_title("Sagittarius")
    axes[0].plot(sgr.Lambda.wrap_at(180*u.deg).radian, sgr.Beta.radian,
                 linestyle='none', marker='.')

    axes[1].set_title("ICRS")
    axes[1].plot(icrs.ra.wrap_at(180*u.deg).radian, icrs.dec.radian,
                 linestyle='none', marker='.')

    plt.show()




.. image:: /generated/examples/coordinates/images/sphx_glr_plot_sgr-coordinate-frame_001.png
    :alt: Sagittarius, ICRS
    :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 201-205

This particular transformation is just a spherical rotation, which is a
special case of an Affine transformation with no vector offset. The
transformation of velocity components is therefore natively supported as
well:

.. GENERATED FROM PYTHON SOURCE LINES 205-238

.. code-block:: default


    sgr = coord.SkyCoord(Lambda=np.linspace(0, 2*np.pi, 128)*u.radian,
                         Beta=np.zeros(128)*u.radian,
                         pm_Lambda_cosBeta=np.random.uniform(-5, 5, 128)*u.mas/u.yr,
                         pm_Beta=np.zeros(128)*u.mas/u.yr,
                         frame='sagittarius')
    icrs = sgr.transform_to(coord.ICRS)
    print(icrs)

    fig, axes = plt.subplots(3, 1, figsize=(8, 10), sharex=True)

    axes[0].set_title("Sagittarius")
    axes[0].plot(sgr.Lambda.degree,
                 sgr.pm_Lambda_cosBeta.value,
                 linestyle='none', marker='.')
    axes[0].set_xlabel(r"$\Lambda$ [deg]")
    axes[0].set_ylabel(r"$\mu_\Lambda \, \cos B$ [{0}]"
                       .format(sgr.pm_Lambda_cosBeta.unit.to_string('latex_inline')))

    axes[1].set_title("ICRS")
    axes[1].plot(icrs.ra.degree, icrs.pm_ra_cosdec.value,
                 linestyle='none', marker='.')
    axes[1].set_ylabel(r"$\mu_\alpha \, \cos\delta$ [{0}]"
                       .format(icrs.pm_ra_cosdec.unit.to_string('latex_inline')))

    axes[2].set_title("ICRS")
    axes[2].plot(icrs.ra.degree, icrs.pm_dec.value,
                 linestyle='none', marker='.')
    axes[2].set_xlabel("RA [deg]")
    axes[2].set_ylabel(r"$\mu_\delta$ [{0}]"
                       .format(icrs.pm_dec.unit.to_string('latex_inline')))

    plt.show()



.. image:: /generated/examples/coordinates/images/sphx_glr_plot_sgr-coordinate-frame_002.png
    :alt: Sagittarius, ICRS, ICRS
    :class: sphx-glr-single-img


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

 Out:

 .. code-block:: none

    <SkyCoord (ICRS): (ra, dec) in deg
        [(284.03876751, -29.00408353), (287.24685769, -29.44848352),
         (290.48068369, -29.81535572), (293.7357366 , -30.1029631 ),
         (297.00711066, -30.30991693), (300.28958688, -30.43520293),
         (303.57772919, -30.47820084), (306.86598944, -30.43869669),
         (310.14881715, -30.31688708), (313.42076929, -30.11337526),
         (316.67661568, -29.82915917), (319.91143548, -29.46561215),
         (323.12070147, -29.02445708), (326.30034928, -28.50773532),
         (329.44683007, -27.9177717 ), (332.55714589, -27.257137  ),
         (335.62886847, -26.52860943), (338.66014233, -25.73513624),
         (341.64967439, -24.87979679), (344.59671212, -23.96576781),
         (347.50101283, -22.99629167), (350.36280652, -21.97464811),
         (353.18275454, -20.90412969), (355.96190618, -19.78802107),
         (358.70165491, -18.62958199), (  1.40369557, -17.43203397),
         (  4.06998374, -16.19855028), (  6.70269788, -14.93224899),
         (  9.30420479, -13.63618882), ( 11.87702861, -12.31336727),
         ( 14.42382347, -10.96672102), ( 16.94734952,  -9.59912794),
         ( 19.45045241,  -8.21341071), ( 21.93604568,  -6.81234162),
         ( 24.40709589,  -5.39864845), ( 26.86661004,  -3.97502106),
         ( 29.31762493,  -2.54411871), ( 31.76319801,  -1.10857781),
         ( 34.20639942,   0.32898001), ( 36.65030466,   1.76593955),
         ( 39.09798768,   3.19968374), ( 41.55251374,   4.6275852 ),
         ( 44.01693189,   6.04699804), ( 46.49426651,   7.45524993),
         ( 48.98750752,   8.84963453), ( 51.4995989 ,  10.22740448),
         ( 54.03342512,  11.58576509), ( 56.59179508,  12.92186896),
         ( 59.17742314,  14.23281165), ( 61.79290712,  15.51562883),
         ( 64.44070278,  16.76729487), ( 67.12309478,  17.98472356),
         ( 69.84216409,  19.16477088), ( 72.59975183,  20.30424045),
         ( 75.39742013,  21.3998918 ), ( 78.23641033,  22.44845192),
         ( 81.11759966,  23.44663022), ( 84.04145735,  24.39113719),
         ( 87.00800203,  25.27870692), ( 90.01676196,  26.10612335),
         ( 93.06674057,  26.87025019), ( 96.15638947,  27.56806406),
         ( 99.28359159,  28.19669038), (102.44565666,  28.75344107),
         (105.63933131,  29.23585315), (108.86082534,  29.64172698),
         (112.105855  ,  29.96916281), (115.36970341,  30.21659414),
         (118.64729687,  30.38281659), (121.93329519,  30.46701088),
         (125.22219273,  30.46875885), (128.50842634,  30.38805179),
         (131.78648572,  30.22529063), (135.05102157,  29.98127794),
         (138.29694697,  29.6572022 ), (141.51952827,  29.2546151 ),
         (144.71446203,  28.77540295), (147.87793614,  28.22175338),
         (151.00667382,  27.59611901), (154.09796066,  26.90117914),
         (157.14965528,  26.13980125), (160.16018547,  25.31500315),
         (163.12853176,  24.42991703), (166.05420084,  23.48775622),
         (168.93719133,  22.49178507), (171.77795423,  21.44529257),
         (174.57735037,  20.35156967), (177.33660656,  19.21389046),
         (180.05727218,  18.03549704), (182.74117737,  16.81958784),
         (185.39039367,  15.56930924), (188.00719783,  14.28774998),
         (190.59403895,  12.97793826), (193.15350938,  11.64284103),
         (195.68831902,  10.28536518), (198.20127316,   8.90836046),
         (200.69525342,   7.51462369), (203.17320154,   6.10690412),
         (205.63810576,   4.6879097 ), (208.09298919,   3.26031403),
         (210.54090002,   1.82676397), (212.984903  ,   0.38988751),
         (215.42807182,  -1.04769799), (217.87348209,  -2.48337744),
         (220.32420429,  -3.91452965), (222.7832966 ,  -5.338519  ),
         (225.25379684,  -6.75268736), (227.73871349,  -8.15434631),
         (230.24101506,  -9.54076983), (232.76361762, -10.90918763),
         (235.30937003, -12.25677927), (237.88103647, -13.58066929),
         (240.48127601, -14.87792359), (243.11261883, -16.14554723),
         (245.777439  , -17.38048408), (248.47792364, -18.57961852),
         (251.2160385 , -19.7397795 ), (253.9934903 , -20.85774736),
         (256.81168612, -21.93026371), (259.67169071, -22.95404466),
         (262.57418275, -23.92579758), (265.51941137, -24.84224172),
         (268.50715471, -25.70013256), (271.53668252, -26.49628998),
         (274.6067251 , -27.22762983), (277.71545113, -27.89119849),
         (280.86045662, -28.48420985), (284.03876751, -29.00408353)]
     (pm_ra_cosdec, pm_dec) in mas / yr
        [(-1.61860616e+00,  2.79593933e-01),
         ( 3.91871083e+00, -5.67048525e-01),
         ( 4.40290826e+00, -5.12120165e-01),
         (-1.91772392e-02,  1.68070607e-03),
         ( 4.45558909e+00, -2.61778334e-01),
         ( 4.85574581e+00, -1.44318362e-01),
         (-4.73958561e-01,  2.92324777e-04),
         (-4.48348701e+00, -1.27730583e-01),
         ( 2.76177853e+00,  1.58872104e-01),
         (-5.88960148e-02, -5.08983396e-03),
         ( 7.22028651e-01,  8.31088168e-02),
         ( 1.65595284e+00,  2.37640540e-01),
         ( 4.25650864e+00,  7.30237574e-01),
         ( 4.83538001e+00,  9.63154942e-01),
         ( 4.04859990e+00,  9.16331177e-01),
         ( 4.71971177e+00,  1.19372247e+00),
         ( 1.20098447e+00,  3.34946996e-01),
         (-4.46859690e+00, -1.35926738e+00),
         (-2.01526431e+00, -6.62470189e-01),
         (-1.77814848e+00, -6.26736564e-01),
         (-2.84210401e+00, -1.06676354e+00),
         (-4.37847524e+00, -1.73957451e+00),
         ( 4.50401921e+00,  1.88397593e+00),
         (-2.97677041e-01, -1.30457077e-01),
         ( 3.21801893e-01,  1.47108701e-01),
         (-1.84865700e+00, -8.77949507e-01),
         (-7.67455944e-01, -3.77220991e-01),
         (-2.47281233e+00, -1.25353738e+00),
         ( 3.71133402e+00,  1.93395298e+00),
         ( 2.58906426e+00,  1.38252013e+00),
         ( 1.31082277e+00,  7.15143551e-01),
         (-3.65139335e+00, -2.02950771e+00),
         ( 2.48407180e+00,  1.40277033e+00),
         (-2.96941825e-01, -1.69913913e-01),
         (-2.13469522e+00, -1.23453538e+00),
         ( 3.69752493e-03,  2.15569583e-03),
         ( 3.64670646e+00,  2.13797281e+00),
         ( 3.57668769e+00,  2.10346713e+00),
         (-1.40008561e+00, -8.23943908e-01),
         ( 1.95189524e+00,  1.14663271e+00),
         ( 2.42300501e+00,  1.41735785e+00),
         ( 1.34681240e+00,  7.82551978e-01),
         (-4.31104425e+00, -2.48186624e+00),
         (-2.65263872e+00, -1.50921932e+00),
         ( 2.15760103e+00,  1.21000104e+00),
         (-8.50111692e-01, -4.68661861e-01),
         ( 2.22667850e+00,  1.20336671e+00),
         (-3.73610893e+00, -1.97358301e+00),
         (-2.18147344e+00, -1.12295091e+00),
         ( 2.79328170e+00,  1.39672197e+00),
         (-2.49539430e+00, -1.20793867e+00),
         (-4.06095467e+00, -1.89614453e+00),
         (-4.43846158e+00, -1.99123532e+00),
         (-5.47179459e-01, -2.34874037e-01),
         ( 1.69984355e+00,  6.94909064e-01),
         (-2.78156890e+00, -1.07749611e+00),
         (-4.23046095e+00, -1.54405146e+00),
         ( 4.49177425e+00,  1.53486321e+00),
         (-4.20773786e+00, -1.33633649e+00),
         ( 3.35138044e+00,  9.80942204e-01),
         (-3.88548185e-01, -1.03777097e-01),
         ( 3.11627683e+00,  7.50484247e-01),
         (-3.96811884e+00, -8.49080937e-01),
         ( 3.26230837e+00,  6.08748450e-01),
         ( 4.03970440e+00,  6.41378704e-01),
         (-4.75231437e+00, -6.20406971e-01),
         ( 4.76042035e+00,  4.85603705e-01),
         ( 1.25675380e+00,  9.20184265e-02),
         (-2.65418253e+00, -1.17448942e-01),
         ( 4.13385407e+00,  6.27254689e-02),
         ( 3.35402878e+00, -4.67566258e-02),
         ( 1.16153812e+00, -4.99697925e-02),
         ( 1.20557490e+00, -8.67953802e-02),
         (-3.51948411e-01,  3.54741044e-02),
         ( 1.22528320e+00, -1.58484605e-01),
         (-2.09658352e+00,  3.30380809e-01),
         ( 2.39402641e+00, -4.43924826e-01),
         (-1.99394519e+00,  4.24363550e-01),
         (-1.15748689e+00,  2.77450922e-01),
         ( 2.38007704e+00, -6.33075736e-01),
         ( 2.34675520e+00, -6.84377508e-01),
         (-2.74845555e+00,  8.70026410e-01),
         (-4.02328559e+00,  1.37073440e+00),
         ( 2.35964904e+00, -8.58949356e-01),
         ( 1.18393875e+00, -4.57521757e-01),
         (-3.46670361e+00,  1.41413558e+00),
         ( 2.74634165e+00, -1.17653308e+00),
         (-1.14674226e+00,  5.13548439e-01),
         ( 8.04795428e-01, -3.75170629e-01),
         (-8.20787264e-01,  3.96739502e-01),
         (-3.45737668e+00,  1.72653569e+00),
         ( 1.46385707e+00, -7.52668604e-01),
         ( 2.73487021e+00, -1.44319255e+00),
         (-7.02527413e-01,  3.79323817e-01),
         ( 2.07632705e+00, -1.14376848e+00),
         ( 9.88283041e-01, -5.53866570e-01),
         ( 2.88386855e+00, -1.63986394e+00),
         (-2.41752698e+00,  1.39114677e+00),
         ( 1.45221159e+00, -8.43506337e-01),
         (-2.52520359e+00,  1.47679377e+00),
         (-4.16590134e+00,  2.44692375e+00),
         ( 3.23565006e+00, -1.90411573e+00),
         ( 2.08087068e+00, -1.22386522e+00),
         (-8.95029679e-02,  5.24828989e-02),
         (-3.23440998e+00,  1.88623611e+00),
         (-4.35256749e-01,  2.51816406e-01),
         (-2.86498364e+00,  1.64020320e+00),
         (-2.17381735e+00,  1.22832034e+00),
         (-3.99291139e+00,  2.22094380e+00),
         ( 1.72047729e+00, -9.39432079e-01),
         ( 4.39575013e+00, -2.34953704e+00),
         (-1.50364972e+00,  7.84402893e-01),
         ( 3.29066968e+00, -1.67019055e+00),
         (-3.36146834e+00,  1.65451046e+00),
         (-3.74112510e+00,  1.77942720e+00),
         (-4.52710017e+00,  2.07303373e+00),
         (-1.28186764e+00,  5.62833157e-01),
         (-2.33074890e+00,  9.76944025e-01),
         (-9.46332098e-01,  3.76839488e-01),
         (-2.61016202e+00,  9.82183576e-01),
         ( 2.73909948e-01, -9.68142679e-02),
         ( 3.07154799e+00, -1.01283887e+00),
         ( 2.52597597e+00, -7.71022549e-01),
         (-2.74445737e+00,  7.68391333e-01),
         (-4.72754904e+00,  1.20096773e+00),
         ( 8.06575532e-02, -1.83472574e-02),
         ( 2.86647676e+00, -5.74296894e-01),
         (-2.93194586e+00,  5.06456912e-01)]>





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

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


.. _sphx_glr_download_generated_examples_coordinates_plot_sgr-coordinate-frame.py:


.. only :: html

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



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

     :download:`Download Python source code: plot_sgr-coordinate-frame.py <plot_sgr-coordinate-frame.py>`



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

     :download:`Download Jupyter notebook: plot_sgr-coordinate-frame.ipynb <plot_sgr-coordinate-frame.ipynb>`


.. only:: html

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

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