Commit 264e93eb authored by Leo Pound Singer's avatar Leo Pound Singer

Add rotate option to globe projections

parent 7788d219
......@@ -22,6 +22,9 @@ Changelog
because it is normal for invalid values to occur when transforming pixels
that lie outside of the projection.
- Add ``rotate`` option to ``astro globe`` and ``geo globe`` to rotate the plot
in the plane of the screen about the center of the projection.
0.1.7 (2019-04-24)
==================
......
......@@ -27,7 +27,7 @@ Matplotlib projection registry. The projections are:
* ``geo hours aitoff``
* ``geo degrees mollweide``
* ``geo hours mollweide``
* ``astro globe`` with option `center`
* ``astro globe`` with options `center` and `rotate`
* ``astro zoom`` with options `center` and `radius`
Example
......@@ -393,7 +393,7 @@ class GlobeAxes(AutoScaledWCSAxes):
name = 'astro globe'
def __init__(self, *args, center='0d 0d', **kwargs):
def __init__(self, *args, center='0d 0d', rotate=None, **kwargs):
center = SkyCoord(center).icrs
header = {
'NAXIS': 2,
......@@ -408,6 +408,8 @@ class GlobeAxes(AutoScaledWCSAxes):
'CTYPE1': 'RA---SIN',
'CTYPE2': 'DEC--SIN',
'RADESYS': 'ICRS'}
if rotate is not None:
header['LONPOLE'] = u.Quantity(rotate).to_value(u.deg)
super(GlobeAxes, self).__init__(
*args, frame_class=EllipticalFrame, header=header, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment