{"action":"created","comment":{"url":"https://api.github.com/repos/astrofrog/reproject/pulls/comments/115737600","pull_request_review_id":37300802,"id":115737600,"diff_hunk":"@@ -43,3 +43,159 @@ def parse_output_projection(output_projection, shape_out=None):\n             raise ValueError(\"Need to specify shape when specifying output_projection as WCS object\")\n \n     return wcs_out, shape_out\n+\n+def flatten(f):\n+    \"\"\"Flatten a radio FITS continuum 'cube' so that it becomes a 2D\n+    image suitable for reprojection. Return new PrimaryHDU\"\"\"\n+\n+    naxis=f[0].header['NAXIS']\n+    if naxis<2:\n+        raise Exception('Can\\'t make map from this')\n+    if naxis==2:\n+        return f[0].header,f[0].data\n+\n+    w = WCS(f[0].header)\n+    wn=WCS(naxis=2)\n+    \n+    wn.wcs.crpix[0]=w.wcs.crpix[0]\n+    wn.wcs.crpix[1]=w.wcs.crpix[1]\n+    wn.wcs.cdelt=w.wcs.cdelt[0:2]\n+    wn.wcs.crval=w.wcs.crval[0:2]\n+    wn.wcs.ctype[0]=w.wcs.ctype[0]\n+    wn.wcs.ctype[1]=w.wcs.ctype[1]\n+    ","path":"reproject/utils.py","position":24,"original_position":24,"commit_id":"4746c7897240013b8805030c898b29f3a090349f","original_commit_id":"4746c7897240013b8805030c898b29f3a090349f","user":{"login":"mirca","id":13077051,"avatar_url":"https://avatars2.githubusercontent.com/u/13077051?v=3","gravatar_id":"","url":"https://api.github.com/users/mirca","html_url":"https://github.com/mirca","followers_url":"https://api.github.com/users/mirca/followers","following_url":"https://api.github.com/users/mirca/following{/other_user}","gists_url":"https://api.github.com/users/mirca/gists{/gist_id}","starred_url":"https://api.github.com/users/mirca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirca/subscriptions","organizations_url":"https://api.github.com/users/mirca/orgs","repos_url":"https://api.github.com/users/mirca/repos","events_url":"https://api.github.com/users/mirca/events{/privacy}","received_events_url":"https://api.github.com/users/mirca/received_events","type":"User","site_admin":false},"body":"@bsipocz awesome!","created_at":"2017-05-10T13:20:41Z","updated_at":"2017-05-10T13:20:42Z","html_url":"https://github.com/astrofrog/reproject/pull/125#discussion_r115737600","pull_request_url":"https://api.github.com/repos/astrofrog/reproject/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/astrofrog/reproject/pulls/comments/115737600"},"html":{"href":"https://github.com/astrofrog/reproject/pull/125#discussion_r115737600"},"pull_request":{"href":"https://api.github.com/repos/astrofrog/reproject/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/astrofrog/reproject/pulls/125","id":119858214,"html_url":"https://github.com/astrofrog/reproject/pull/125","diff_url":"https://github.com/astrofrog/reproject/pull/125.diff","patch_url":"https://github.com/astrofrog/reproject/pull/125.patch","issue_url":"https://api.github.com/repos/astrofrog/reproject/issues/125","number":125,"state":"open","locked":false,"title":"Initial mosaic code","user":{"login":"mhardcastle","id":5337708,"avatar_url":"https://avatars2.githubusercontent.com/u/5337708?v=3","gravatar_id":"","url":"https://api.github.com/users/mhardcastle","html_url":"https://github.com/mhardcastle","followers_url":"https://api.github.com/users/mhardcastle/followers","following_url":"https://api.github.com/users/mhardcastle/following{/other_user}","gists_url":"https://api.github.com/users/mhardcastle/gists{/gist_id}","starred_url":"https://api.github.com/users/mhardcastle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhardcastle/subscriptions","organizations_url":"https://api.github.com/users/mhardcastle/orgs","repos_url":"https://api.github.com/users/mhardcastle/repos","events_url":"https://api.github.com/users/mhardcastle/events{/privacy}","received_events_url":"https://api.github.com/users/mhardcastle/received_events","type":"User","site_admin":false},"body":"For review","created_at":"2017-05-10T11:14:49Z","updated_at":"2017-05-10T13:20:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ba5505979d06537e0cd7a33c1668c6264d0ceee","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/astrofrog/reproject/pulls/125/commits","review_comments_url":"https://api.github.com/repos/astrofrog/reproject/pulls/125/comments","review_comment_url":"https://api.github.com/repos/astrofrog/reproject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astrofrog/reproject/issues/125/comments","statuses_url":"https://api.github.com/repos/astrofrog/reproject/statuses/4746c7897240013b8805030c898b29f3a090349f","head":{"label":"mhardcastle:master","ref":"master","sha":"4746c7897240013b8805030c898b29f3a090349f","user":{"login":"mhardcastle","id":5337708,"avatar_url":"https://avatars2.githubusercontent.com/u/5337708?v=3","gravatar_id":"","url":"https://api.github.com/users/mhardcastle","html_url":"https://github.com/mhardcastle","followers_url":"https://api.github.com/users/mhardcastle/followers","following_url":"https://api.github.com/users/mhardcastle/following{/other_user}","gists_url":"https://api.github.com/users/mhardcastle/gists{/gist_id}","starred_url":"https://api.github.com/users/mhardcastle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhardcastle/subscriptions","organizations_url":"https://api.github.com/users/mhardcastle/orgs","repos_url":"https://api.github.com/users/mhardcastle/repos","events_url":"https://api.github.com/users/mhardcastle/events{/privacy}","received_events_url":"https://api.github.com/users/mhardcastle/received_events","type":"User","site_admin":false},"repo":{"id":83119370,"name":"reproject","full_name":"mhardcastle/reproject","owner":{"login":"mhardcastle","id":5337708,"avatar_url":"https://avatars2.githubusercontent.com/u/5337708?v=3","gravatar_id":"","url":"https://api.github.com/users/mhardcastle","html_url":"https://github.com/mhardcastle","followers_url":"https://api.github.com/users/mhardcastle/followers","following_url":"https://api.github.com/users/mhardcastle/following{/other_user}","gists_url":"https://api.github.com/users/mhardcastle/gists{/gist_id}","starred_url":"https://api.github.com/users/mhardcastle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhardcastle/subscriptions","organizations_url":"https://api.github.com/users/mhardcastle/orgs","repos_url":"https://api.github.com/users/mhardcastle/repos","events_url":"https://api.github.com/users/mhardcastle/events{/privacy}","received_events_url":"https://api.github.com/users/mhardcastle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mhardcastle/reproject","description":"Python-based Astronomical image reprojection.","fork":true,"url":"https://api.github.com/repos/mhardcastle/reproject","forks_url":"https://api.github.com/repos/mhardcastle/reproject/forks","keys_url":"https://api.github.com/repos/mhardcastle/reproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mhardcastle/reproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mhardcastle/reproject/teams","hooks_url":"https://api.github.com/repos/mhardcastle/reproject/hooks","issue_events_url":"https://api.github.com/repos/mhardcastle/reproject/issues/events{/number}","events_url":"https://api.github.com/repos/mhardcastle/reproject/events","assignees_url":"https://api.github.com/repos/mhardcastle/reproject/assignees{/user}","branches_url":"https://api.github.com/repos/mhardcastle/reproject/branches{/branch}","tags_url":"https://api.github.com/repos/mhardcastle/reproject/tags","blobs_url":"https://api.github.com/repos/mhardcastle/reproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mhardcastle/reproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mhardcastle/reproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/mhardcastle/reproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mhardcastle/reproject/statuses/{sha}","languages_url":"https://api.github.com/repos/mhardcastle/reproject/languages","stargazers_url":"https://api.github.com/repos/mhardcastle/reproject/stargazers","contributors_url":"https://api.github.com/repos/mhardcastle/reproject/contributors","subscribers_url":"https://api.github.com/repos/mhardcastle/reproject/subscribers","subscription_url":"https://api.github.com/repos/mhardcastle/reproject/subscription","commits_url":"https://api.github.com/repos/mhardcastle/reproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/mhardcastle/reproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/mhardcastle/reproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/mhardcastle/reproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/mhardcastle/reproject/contents/{+path}","compare_url":"https://api.github.com/repos/mhardcastle/reproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mhardcastle/reproject/merges","archive_url":"https://api.github.com/repos/mhardcastle/reproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mhardcastle/reproject/downloads","issues_url":"https://api.github.com/repos/mhardcastle/reproject/issues{/number}","pulls_url":"https://api.github.com/repos/mhardcastle/reproject/pulls{/number}","milestones_url":"https://api.github.com/repos/mhardcastle/reproject/milestones{/number}","notifications_url":"https://api.github.com/repos/mhardcastle/reproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mhardcastle/reproject/labels{/name}","releases_url":"https://api.github.com/repos/mhardcastle/reproject/releases{/id}","deployments_url":"https://api.github.com/repos/mhardcastle/reproject/deployments","created_at":"2017-02-25T08:51:50Z","updated_at":"2017-02-25T08:51:52Z","pushed_at":"2017-02-25T12:21:35Z","git_url":"git://github.com/mhardcastle/reproject.git","ssh_url":"git@github.com:mhardcastle/reproject.git","clone_url":"https://github.com/mhardcastle/reproject.git","svn_url":"https://github.com/mhardcastle/reproject","homepage":"https://reproject.readthedocs.io","size":963,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"astrofrog:master","ref":"master","sha":"fa4c70b29d27d68fa41fe17e496822143bf7328e","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars1.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"repo":{"id":10012207,"name":"reproject","full_name":"astrofrog/reproject","owner":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars1.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/astrofrog/reproject","description":"Python-based Astronomical image reprojection.","fork":false,"url":"https://api.github.com/repos/astrofrog/reproject","forks_url":"https://api.github.com/repos/astrofrog/reproject/forks","keys_url":"https://api.github.com/repos/astrofrog/reproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astrofrog/reproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astrofrog/reproject/teams","hooks_url":"https://api.github.com/repos/astrofrog/reproject/hooks","issue_events_url":"https://api.github.com/repos/astrofrog/reproject/issues/events{/number}","events_url":"https://api.github.com/repos/astrofrog/reproject/events","assignees_url":"https://api.github.com/repos/astrofrog/reproject/assignees{/user}","branches_url":"https://api.github.com/repos/astrofrog/reproject/branches{/branch}","tags_url":"https://api.github.com/repos/astrofrog/reproject/tags","blobs_url":"https://api.github.com/repos/astrofrog/reproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astrofrog/reproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astrofrog/reproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/astrofrog/reproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astrofrog/reproject/statuses/{sha}","languages_url":"https://api.github.com/repos/astrofrog/reproject/languages","stargazers_url":"https://api.github.com/repos/astrofrog/reproject/stargazers","contributors_url":"https://api.github.com/repos/astrofrog/reproject/contributors","subscribers_url":"https://api.github.com/repos/astrofrog/reproject/subscribers","subscription_url":"https://api.github.com/repos/astrofrog/reproject/subscription","commits_url":"https://api.github.com/repos/astrofrog/reproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/astrofrog/reproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/astrofrog/reproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/astrofrog/reproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/astrofrog/reproject/contents/{+path}","compare_url":"https://api.github.com/repos/astrofrog/reproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astrofrog/reproject/merges","archive_url":"https://api.github.com/repos/astrofrog/reproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astrofrog/reproject/downloads","issues_url":"https://api.github.com/repos/astrofrog/reproject/issues{/number}","pulls_url":"https://api.github.com/repos/astrofrog/reproject/pulls{/number}","milestones_url":"https://api.github.com/repos/astrofrog/reproject/milestones{/number}","notifications_url":"https://api.github.com/repos/astrofrog/reproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astrofrog/reproject/labels{/name}","releases_url":"https://api.github.com/repos/astrofrog/reproject/releases{/id}","deployments_url":"https://api.github.com/repos/astrofrog/reproject/deployments","created_at":"2013-05-12T10:32:54Z","updated_at":"2016-12-10T15:21:41Z","pushed_at":"2017-05-10T12:26:43Z","git_url":"git://github.com/astrofrog/reproject.git","ssh_url":"git@github.com:astrofrog/reproject.git","clone_url":"https://github.com/astrofrog/reproject.git","svn_url":"https://github.com/astrofrog/reproject","homepage":"https://reproject.readthedocs.io","size":967,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":35,"forks":22,"open_issues":35,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astrofrog/reproject/pulls/125"},"html":{"href":"https://github.com/astrofrog/reproject/pull/125"},"issue":{"href":"https://api.github.com/repos/astrofrog/reproject/issues/125"},"comments":{"href":"https://api.github.com/repos/astrofrog/reproject/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/astrofrog/reproject/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/astrofrog/reproject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astrofrog/reproject/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/astrofrog/reproject/statuses/4746c7897240013b8805030c898b29f3a090349f"}}}}
{"actor":{"display_login":"mirca"}}