|
5 | 5 |
|
6 | 6 | import numpy as np |
7 | 7 |
|
| 8 | +import pytest |
| 9 | + |
8 | 10 | from astropy.units import allclose as quantity_allclose |
9 | 11 | from astropy import units as u |
10 | 12 | from astropy.coordinates import SkyCoord |
11 | | -from astropy.coordinates.builtin_frames import FK5, ICRS, GCRS, GeocentricMeanEcliptic, BarycentricMeanEcliptic, HeliocentricMeanEcliptic |
| 13 | +from astropy.coordinates.builtin_frames import FK5, ICRS, GCRS, GeocentricMeanEcliptic, BarycentricMeanEcliptic, HeliocentricMeanEcliptic, GeocentricTrueEcliptic, BarycentricTrueEcliptic, HeliocentricTrueEcliptic, HeliocentricEclipticIAU76 |
12 | 14 | from astropy.constants import R_sun, R_earth |
13 | 15 |
|
14 | 16 |
|
@@ -47,6 +49,25 @@ def test_ecliptic_heliobary(): |
47 | 49 | assert bary.separation(helio_in_bary_frame) > 1*u.arcmin |
48 | 50 |
|
49 | 51 |
|
| 52 | +@pytest.mark.parametrize(('trueframe', 'meanframe'), |
| 53 | + [(BarycentricTrueEcliptic, BarycentricMeanEcliptic), |
| 54 | + (HeliocentricTrueEcliptic, HeliocentricMeanEcliptic), |
| 55 | + (GeocentricTrueEcliptic, GeocentricMeanEcliptic), |
| 56 | + (HeliocentricEclipticIAU76, HeliocentricMeanEcliptic)]) |
| 57 | +def test_ecliptic_true_mean(trueframe, meanframe): |
| 58 | + """ |
| 59 | + Check that the ecliptic true/mean transformations at least roundtrip |
| 60 | + """ |
| 61 | + icrs = ICRS(1*u.deg, 2*u.deg, distance=1.5*R_sun) |
| 62 | + |
| 63 | + truecoo = icrs.transform_to(trueframe) |
| 64 | + meancoo = icrs.transform_to(meanframe) |
| 65 | + truecoo2 = icrs.transform_to(trueframe) |
| 66 | + |
| 67 | + assert not quantity_allclose(truecoo.cartesian.xyz, meancoo.cartesian.xyz) |
| 68 | + assert quantity_allclose(truecoo.cartesian.xyz, truecoo2.cartesian.xyz) |
| 69 | + |
| 70 | + |
50 | 71 | def test_ecl_geo(): |
51 | 72 | """ |
52 | 73 | Check that the geocentric version at least gets well away from GCRS. For a |
|
0 commit comments