{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/7760","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/7760/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/7760/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/7760/events","html_url":"https://github.com/astropy/astropy/issues/7760","id":353366744,"node_id":"MDU6SXNzdWUzNTMzNjY3NDQ=","number":7760,"title":"Selecting an ephemeris other than \"builtin\" produces inconsistent GCRS frames","user":{"login":"mcbeth","id":683809,"node_id":"MDQ6VXNlcjY4MzgwOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/683809?v=4","gravatar_id":"","url":"https://api.github.com/users/mcbeth","html_url":"https://github.com/mcbeth","followers_url":"https://api.github.com/users/mcbeth/followers","following_url":"https://api.github.com/users/mcbeth/following{/other_user}","gists_url":"https://api.github.com/users/mcbeth/gists{/gist_id}","starred_url":"https://api.github.com/users/mcbeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcbeth/subscriptions","organizations_url":"https://api.github.com/users/mcbeth/orgs","repos_url":"https://api.github.com/users/mcbeth/repos","events_url":"https://api.github.com/users/mcbeth/events{/privacy}","received_events_url":"https://api.github.com/users/mcbeth/received_events","type":"User","site_admin":false},"labels":[{"id":21499868,"node_id":"MDU6TGFiZWwyMTQ5OTg2OA==","url":"https://api.github.com/repos/astropy/astropy/labels/coordinates","name":"coordinates","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-23T12:52:50Z","updated_at":"2018-08-24T11:14:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When selecting a different ephemeris for the solar system (which provides ICRS locations of the different bodies, including earth), the default GCRS coordinate system stops being geocentric.\r\n\r\nFor example:\r\n```python\r\nIn [1]: from astropy.coordinates import get_body_barycentric, ICRS, GCRS\r\n\r\nIn [2]: from astropy.time import Time\r\n\r\nIn [3]: time = Time(\"2005-01-01\")\r\n\r\nIn [4]: ICRS(get_body_barycentric('earth', Time(\"2005-01-01\"), ephemeris='jpl')).transform_to(GCRS(obstime=time)).cartesian\r\nOut[4]: \r\nCartesianRepresentation (x, y, z) in km\r\n    (4.86300568, 1.52534008, 1.54617195)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/415729126","html_url":"https://github.com/astropy/astropy/issues/7760#issuecomment-415729126","issue_url":"https://api.github.com/repos/astropy/astropy/issues/7760","id":415729126,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTcyOTEyNg==","user":{"login":"Juanlu001","id":316517,"node_id":"MDQ6VXNlcjMxNjUxNw==","avatar_url":"https://avatars2.githubusercontent.com/u/316517?v=4","gravatar_id":"","url":"https://api.github.com/users/Juanlu001","html_url":"https://github.com/Juanlu001","followers_url":"https://api.github.com/users/Juanlu001/followers","following_url":"https://api.github.com/users/Juanlu001/following{/other_user}","gists_url":"https://api.github.com/users/Juanlu001/gists{/gist_id}","starred_url":"https://api.github.com/users/Juanlu001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Juanlu001/subscriptions","organizations_url":"https://api.github.com/users/Juanlu001/orgs","repos_url":"https://api.github.com/users/Juanlu001/repos","events_url":"https://api.github.com/users/Juanlu001/events{/privacy}","received_events_url":"https://api.github.com/users/Juanlu001/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T11:14:33Z","updated_at":"2018-08-24T11:14:33Z","author_association":"MEMBER","body":"Thanks for reporting @mcbeth, I was writing the same issue right now and decided to gave a look first :sweat_smile: \r\n\r\nOne thing to add is that the default builtin ephemeris produces the expected result:\r\n\r\n```\r\nIn [8]: ICRS(get_body_barycentric('earth', t, ephemeris='jpl')).transform_to(GCRS(obstime=t)).cartesian\r\nOut[8]: \r\n<CartesianRepresentation (x, y, z) in km\r\n    (6.79952462, 5.24546869, 3.41473439)>\r\n\r\nIn [9]: ICRS(get_body_barycentric('earth', t)).transform_to(GCRS(obstime=t)).cartesian\r\nOut[9]: \r\n<CartesianRepresentation (x, y, z) in AU\r\n    (0., 0., 0.)>\r\n```\r\n\r\nIt was hypothesized that this could be because of the known errors of epv00 from ERFA:\r\n\r\nhttps://github.com/liberfa/erfa/blob/27c2153cfb28d2e373b145c1188b46d84487fead/src/epv00.c#L76-L86\r\n\r\nHowever, as far as I see it, this function is only being called for the builtin ephemerides:\r\n\r\nhttps://github.com/astropy/astropy/blob/7fe49707f980519a500fd1aba9cde0152d593b7f/astropy/coordinates/solar_system.py#L216-L218\r\n\r\nand it's not being called in the `ICRS -> GCRS` transformation:\r\n\r\nhttps://github.com/astropy/astropy/blob/e9dee2e9589adfe4f0c803246add11164da03b83/astropy/coordinates/builtin_frames/icrs_cirs_transforms.py#L118-L133\r\n\r\nhttps://github.com/liberfa/erfa/blob/27c2153cfb28d2e373b145c1188b46d84487fead/src/apcs.c#L84-L87"}}
{"actor":{"display_login":"Juanlu001"}}