{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/152321782","pull_request_review_id":78165895,"id":152321782,"diff_hunk":"@@ -1359,11 +1360,29 @@ def radial_velocity_correction(self, kind='barycentric', obstime=None,\n                              \"'{}'\".format(kind))\n \n         gcrs_p, gcrs_v = location.get_gcrs_posvel(obstime)\n-        gtarg = self.transform_to(GCRS(obstime=obstime,\n-                                       obsgeoloc=gcrs_p,\n-                                       obsgeovel=gcrs_v))\n-        targcart = gtarg.represent_as(UnitSphericalRepresentation).to_cartesian()\n-        return targcart.dot(v_origin_to_earth + gcrs_v)\n+        # transforming to GCRS is not the correct thing to do here, since we don't want to\n+        # include aberration (or light deflection)? Instead, only apply parallax if necessary\n+        if self.data.__class__ is UnitSphericalRepresentation:\n+            targcart = self.represent_as(UnitSphericalRepresentation).to_cartesian()\n+        else:\n+            # skycoord has distances so apply parallax\n+            obs_icrs_cart = get_body_barycentric('earth', obstime) + gcrs_p\n+            icrs_cart = self.cartesian\n+            targcart = (icrs_cart - obs_icrs_cart).represent_as(UnitSphericalRepresentation).to_cartesian()","path":"astropy/coordinates/sky_coordinate.py","position":43,"original_position":43,"commit_id":"075ad724486f17280f4ee6ee82d3bb584f505520","original_commit_id":"075ad724486f17280f4ee6ee82d3bb584f505520","user":{"login":"StuartLittlefair","id":4570807,"avatar_url":"https://avatars3.githubusercontent.com/u/4570807?v=4","gravatar_id":"","url":"https://api.github.com/users/StuartLittlefair","html_url":"https://github.com/StuartLittlefair","followers_url":"https://api.github.com/users/StuartLittlefair/followers","following_url":"https://api.github.com/users/StuartLittlefair/following{/other_user}","gists_url":"https://api.github.com/users/StuartLittlefair/gists{/gist_id}","starred_url":"https://api.github.com/users/StuartLittlefair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuartLittlefair/subscriptions","organizations_url":"https://api.github.com/users/StuartLittlefair/orgs","repos_url":"https://api.github.com/users/StuartLittlefair/repos","events_url":"https://api.github.com/users/StuartLittlefair/events{/privacy}","received_events_url":"https://api.github.com/users/StuartLittlefair/received_events","type":"User","site_admin":false},"body":"Much better.","created_at":"2017-11-21T16:06:56Z","updated_at":"2017-11-21T16:06:56Z","html_url":"https://github.com/astropy/astropy/pull/6861#discussion_r152321782","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/6861","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/152321782"},"html":{"href":"https://github.com/astropy/astropy/pull/6861#discussion_r152321782"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6861"}},"in_reply_to_id":151983888},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/6861","id":153003186,"html_url":"https://github.com/astropy/astropy/pull/6861","diff_url":"https://github.com/astropy/astropy/pull/6861.diff","patch_url":"https://github.com/astropy/astropy/pull/6861.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/6861","number":6861,"state":"open","locked":false,"title":"Precise barycentric radial velocity corrections.","user":{"login":"StuartLittlefair","id":4570807,"avatar_url":"https://avatars3.githubusercontent.com/u/4570807?v=4","gravatar_id":"","url":"https://api.github.com/users/StuartLittlefair","html_url":"https://github.com/StuartLittlefair","followers_url":"https://api.github.com/users/StuartLittlefair/followers","following_url":"https://api.github.com/users/StuartLittlefair/following{/other_user}","gists_url":"https://api.github.com/users/StuartLittlefair/gists{/gist_id}","starred_url":"https://api.github.com/users/StuartLittlefair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuartLittlefair/subscriptions","organizations_url":"https://api.github.com/users/StuartLittlefair/orgs","repos_url":"https://api.github.com/users/StuartLittlefair/repos","events_url":"https://api.github.com/users/StuartLittlefair/events{/privacy}","received_events_url":"https://api.github.com/users/StuartLittlefair/received_events","type":"User","site_admin":false},"body":"\r\nThis PR builds on the improvements to ```EarthLocation.get_gcrs_posvel``` in #6699, to offer radial velocity corrections compatible with [Wright & Eastman (2014)](http://adsabs.harvard.edu/abs/2014PASP..126..838W) to 10 mm/s (for sources at infinite distance).\r\n\r\nPrior to this PR, radial velocity corrections between astropy and WE14 differed by several metres/second. This is due to ignoring the gravitational redshift at the observatory and a slight bug in ```SkyCoord.radial_velocity_correction```. This PR fixes both of these issues to give much more accurate radial velocity corrections. The plot before shows the situation before (top) and after (below). The yellow star marks the position of the Sun.\r\n![barycentric_deltas](https://user-images.githubusercontent.com/4570807/32886317-391b4798-cab8-11e7-8ff5-a628137acd29.png)\r\n\r\nAs discussed in [5752](https://github.com/astropy/astropy/pull/5752#issuecomment-309268570) improvements to the precision of these corrections should probably be thought of as bug fixes.\r\n\r\nThe only remaining physics to include is that caused by the proper motion and parallax of the source, but I propose only including those terms once velocity support is added to ```SkyCoord```.","created_at":"2017-11-16T10:29:31Z","updated_at":"2017-11-21T16:06:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fceba4d2275773650ed39afb200443259883f37","assignee":null,"assignees":[],"requested_reviewers":[{"login":"eteq","id":346587,"avatar_url":"https://avatars1.githubusercontent.com/u/346587?v=4","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/51","html_url":"https://github.com/astropy/astropy/milestone/51","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/51/labels","id":2751532,"number":51,"title":"v2.0.3","description":"","creator":{"login":"bsipocz","id":6788290,"avatar_url":"https://avatars1.githubusercontent.com/u/6788290?v=4","gravatar_id":"","url":"https://api.github.com/users/bsipocz","html_url":"https://github.com/bsipocz","followers_url":"https://api.github.com/users/bsipocz/followers","following_url":"https://api.github.com/users/bsipocz/following{/other_user}","gists_url":"https://api.github.com/users/bsipocz/gists{/gist_id}","starred_url":"https://api.github.com/users/bsipocz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsipocz/subscriptions","organizations_url":"https://api.github.com/users/bsipocz/orgs","repos_url":"https://api.github.com/users/bsipocz/repos","events_url":"https://api.github.com/users/bsipocz/events{/privacy}","received_events_url":"https://api.github.com/users/bsipocz/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":92,"state":"open","created_at":"2017-09-07T20:16:28Z","updated_at":"2017-11-21T14:20:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/6861/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/6861/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/6861/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/075ad724486f17280f4ee6ee82d3bb584f505520","head":{"label":"StuartLittlefair:precise_vcorrs","ref":"precise_vcorrs","sha":"075ad724486f17280f4ee6ee82d3bb584f505520","user":{"login":"StuartLittlefair","id":4570807,"avatar_url":"https://avatars3.githubusercontent.com/u/4570807?v=4","gravatar_id":"","url":"https://api.github.com/users/StuartLittlefair","html_url":"https://github.com/StuartLittlefair","followers_url":"https://api.github.com/users/StuartLittlefair/followers","following_url":"https://api.github.com/users/StuartLittlefair/following{/other_user}","gists_url":"https://api.github.com/users/StuartLittlefair/gists{/gist_id}","starred_url":"https://api.github.com/users/StuartLittlefair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuartLittlefair/subscriptions","organizations_url":"https://api.github.com/users/StuartLittlefair/orgs","repos_url":"https://api.github.com/users/StuartLittlefair/repos","events_url":"https://api.github.com/users/StuartLittlefair/events{/privacy}","received_events_url":"https://api.github.com/users/StuartLittlefair/received_events","type":"User","site_admin":false},"repo":{"id":34852236,"name":"astropy","full_name":"StuartLittlefair/astropy","owner":{"login":"StuartLittlefair","id":4570807,"avatar_url":"https://avatars3.githubusercontent.com/u/4570807?v=4","gravatar_id":"","url":"https://api.github.com/users/StuartLittlefair","html_url":"https://github.com/StuartLittlefair","followers_url":"https://api.github.com/users/StuartLittlefair/followers","following_url":"https://api.github.com/users/StuartLittlefair/following{/other_user}","gists_url":"https://api.github.com/users/StuartLittlefair/gists{/gist_id}","starred_url":"https://api.github.com/users/StuartLittlefair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuartLittlefair/subscriptions","organizations_url":"https://api.github.com/users/StuartLittlefair/orgs","repos_url":"https://api.github.com/users/StuartLittlefair/repos","events_url":"https://api.github.com/users/StuartLittlefair/events{/privacy}","received_events_url":"https://api.github.com/users/StuartLittlefair/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StuartLittlefair/astropy","description":"Repository for the Astropy core package","fork":true,"url":"https://api.github.com/repos/StuartLittlefair/astropy","forks_url":"https://api.github.com/repos/StuartLittlefair/astropy/forks","keys_url":"https://api.github.com/repos/StuartLittlefair/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StuartLittlefair/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StuartLittlefair/astropy/teams","hooks_url":"https://api.github.com/repos/StuartLittlefair/astropy/hooks","issue_events_url":"https://api.github.com/repos/StuartLittlefair/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/StuartLittlefair/astropy/events","assignees_url":"https://api.github.com/repos/StuartLittlefair/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/StuartLittlefair/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/StuartLittlefair/astropy/tags","blobs_url":"https://api.github.com/repos/StuartLittlefair/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StuartLittlefair/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StuartLittlefair/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/StuartLittlefair/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StuartLittlefair/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/StuartLittlefair/astropy/languages","stargazers_url":"https://api.github.com/repos/StuartLittlefair/astropy/stargazers","contributors_url":"https://api.github.com/repos/StuartLittlefair/astropy/contributors","subscribers_url":"https://api.github.com/repos/StuartLittlefair/astropy/subscribers","subscription_url":"https://api.github.com/repos/StuartLittlefair/astropy/subscription","commits_url":"https://api.github.com/repos/StuartLittlefair/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/StuartLittlefair/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/StuartLittlefair/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/StuartLittlefair/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/StuartLittlefair/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/StuartLittlefair/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StuartLittlefair/astropy/merges","archive_url":"https://api.github.com/repos/StuartLittlefair/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StuartLittlefair/astropy/downloads","issues_url":"https://api.github.com/repos/StuartLittlefair/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/StuartLittlefair/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/StuartLittlefair/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/StuartLittlefair/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StuartLittlefair/astropy/labels{/name}","releases_url":"https://api.github.com/repos/StuartLittlefair/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/StuartLittlefair/astropy/deployments","created_at":"2015-04-30T12:02:25Z","updated_at":"2016-04-25T08:51:05Z","pushed_at":"2017-11-20T10:04:08Z","git_url":"git://github.com/StuartLittlefair/astropy.git","ssh_url":"git@github.com:StuartLittlefair/astropy.git","clone_url":"https://github.com/StuartLittlefair/astropy.git","svn_url":"https://github.com/StuartLittlefair/astropy","homepage":"www.astropy.org","size":58581,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"db2c0eb6d6ee9099cbeafadee05fa29914c3a6da","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars0.githubusercontent.com/u/847984?v=4","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"name":"astropy","full_name":"astropy/astropy","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars0.githubusercontent.com/u/847984?v=4","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","deployments_url":"https://api.github.com/repos/astropy/astropy/deployments","created_at":"2011-07-21T01:33:49Z","updated_at":"2017-11-20T23:55:42Z","pushed_at":"2017-11-21T14:46:49Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":62542,"stargazers_count":1461,"watchers_count":1461,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":779,"mirror_url":null,"archived":false,"open_issues_count":806,"forks":779,"open_issues":806,"watchers":1461,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6861"},"html":{"href":"https://github.com/astropy/astropy/pull/6861"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/6861"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/6861/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6861/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/6861/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/075ad724486f17280f4ee6ee82d3bb584f505520"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"StuartLittlefair"}}