Repository: sunpy/sunpy

Issue:
Slight discrepancies with the calculated position angle of the Sun
The values from `sunpy.coordinates.sun` agree with published values in the *Astronomical Almanac* to published precision, **except for** the occasional discrepancies with position angle of the Sun (at the sub-arcmin level).  I believe this is because I'm using `PrecessedGeocentric` for a frame with the Z axis aligned with the Earth's axis of rotation, but `PrecessedGeocentric` accounts for precession but not nutation.  Look into this.

(We technically also don't quite agree with on the angular radius of the Sun, but I can't find a statement of what physical radius the *Astronomical Almanac* is using, so I'm going to give that a pass since we agree on the Sun-Earth distance.)


Discussion:
For 2013-03-18 0h TT:

*Astronomical Almanac*: -24.88 deg

`PrecessedGeocentric`:
```python
>>> sun.P(Time('2013-03-18', scale='tt'))
<Angle -24.88654531 deg>
```

`PrecessedGeocentric` hacked to include nutation:
```python
>>> sun.P(Time('2013-03-18', scale='tt'))
<Angle -24.88509249 deg>
```

Closer, but not quite there.  Maybe something else is wrong too.
My dream would be to also include the uncertainty on all these calculations. Is the value given by the Astronomical Almanac -24.880 deg, with a +/-0.001 deg precission? o -24.88 with a 0.005 precission?
"-24.88" is the published value, so +/-0.005 deg precision.  That means that the above calculation, with the hacked fix, is a very slight miss, possibly by as little as a third of an arcsecond.

I can certainly add notes to various docstrings to make it clear exactly what level of precision has been verified.  I'd be hesitant to call it "uncertainty" because our values – position angle aside – may be accurate beyond the significant figures that the *Astronomical Almanac* chooses to publish.
This write-up by the *Astronomical Almanac* folks (http://asa.usno.navy.mil/static/files/sun_rotation_change.pdf) may give some hints.  I believe that, through Astropy, we are taking aberration into account, but that can be further investigated.  Note that the *Astronomical Almanac* folks appear to feel that agreement to within one unit of the least significant figure is good enough, so, it's more like +/-0.01 deg (or even 0.015 deg) is the tolerance.

Resolving patch:
diff --git a/sunpy/coordinates/ephemeris.py b/sunpy/coordinates/ephemeris.py
--- a/sunpy/coordinates/ephemeris.py
+++ b/sunpy/coordinates/ephemeris.py
@@ -12,7 +12,7 @@
 import astropy.units as u
 from astropy.time import Time
 from astropy.coordinates import (SkyCoord, Angle, Longitude,
-                                 ICRS, PrecessedGeocentric, AltAz,
+                                 ICRS, ITRS, AltAz,
                                  get_body_barycentric)
 from astropy.coordinates.representation import CartesianRepresentation, SphericalRepresentation
 from astropy._erfa.core import ErfaWarning
@@ -336,7 +336,7 @@ def _P(time='now'):
     obstime = parse_time(time)
 
     # Define the frame where its Z axis is aligned with geocentric north
-    geocentric = PrecessedGeocentric(equinox=obstime, obstime=obstime)
+    geocentric = ITRS(obstime=obstime)
 
     return _sun_north_angle_to_z(geocentric)
 


Test patch:
diff --git a/sunpy/coordinates/tests/test_sun.py b/sunpy/coordinates/tests/test_sun.py
--- a/sunpy/coordinates/tests/test_sun.py
+++ b/sunpy/coordinates/tests/test_sun.py
@@ -227,9 +227,30 @@ def test_P():
 
 def test_P_array_time():
     # Validate against published values from the Astronomical Almanac (2013)
-    sun_P = sun.P(Time(['2013-04-01', '2013-12-01'], scale='tt'))
-    assert_quantity_allclose(sun_P[0], -26.15*u.deg, atol=1e-2*u.deg)
-    assert_quantity_allclose(sun_P[1], 16.05*u.deg, atol=1e-2*u.deg)
+    sun_P = sun.P(Time(['2013-01-01',
+                        '2013-02-01',
+                        '2013-03-01',
+                        '2013-04-01',
+                        '2013-05-01',
+                        '2013-06-01',
+                        '2013-07-01',
+                        '2013-08-01',
+                        '2013-09-01',
+                        '2013-10-01',
+                        '2013-11-01',
+                        '2013-12-01'], scale='tt'))
+    assert_quantity_allclose(sun_P, [  1.98,
+                                     -12.23,
+                                     -21.55,
+                                     -26.15,
+                                     -24.11,
+                                     -15.39,
+                                      -2.64,
+                                      10.85,
+                                      21.08,
+                                      25.97,
+                                      24.47,
+                                      16.05]*u.deg, atol=5e-3*u.deg)
 
 
 def test_earth_distance():