def test_hee_hee(): # Test HEE loopback transformation obstime = Time('2001-01-01') old = SkyCoord(90*u.deg, 10*u.deg, 1*u.AU, frame=HeliocentricEarthEcliptic(obstime=obstime)) new = old.transform_to(HeliocentricEarthEcliptic) assert_quantity_allclose(new.lon, old.lon) assert_quantity_allclose(new.lat, old.lat) assert_quantity_allclose(new.distance, old.distance) new = old.transform_to(HeliocentricEarthEcliptic(obstime=obstime + 1*u.day)) assert_quantity_allclose(new.lon, old.lon - 1*u.deg, atol=0.1*u.deg) # due to Earth motion assert_quantity_allclose(new.lat, old.lat, atol=0.5*u.arcsec) assert_quantity_allclose(new.distance, old.distance, rtol=1e-5)
def test_hee_gse_sunspice(): # Compare our HEE->GSE transformation against SunSPICE # # IDL> coord = [0.7d, -20.d, 10.d] # IDL> convert_sunspice_coord, '2019-06-01', coord, 'HEE', 'GSE', /au, /degrees # IDL> print, coord # 0.45215884 32.777377 15.594639 old = SkyCoord(-20*u.deg, 10*u.deg, 0.7*u.AU, frame=HeliocentricEarthEcliptic(obstime='2019-06-01')) new = old.geocentricsolarecliptic assert_quantity_allclose(new.lon, 32.777377*u.deg, atol=0.01*u.arcsec, rtol=0) assert_quantity_allclose(new.lat, 15.594639*u.deg, atol=0.01*u.arcsec, rtol=0) assert_quantity_allclose(new.distance, 0.45215884*u.AU)