{"action":"created","comment":{"url":"https://api.github.com/repos/Nikea/scikit-xray/pulls/comments/25633260","id":25633260,"diff_hunk":"@@ -185,3 +187,60 @@ def _helper_check(pixel_list, inds, num_pix, q_ring_val, calib_center,\n                                                        - 0.000001)]]))[0][0]))\n     assert_array_equal(zero_grid, data)\n     assert_array_equal(num_pix, num_pixels)\n+\n+\n+def test_roi_divide_circle():\n+    num_rois = 3\n+    detector_size = (20, 26)\n+    radius = 8.\n+    calibrated_center = (15., 12.)\n+    num_angles = 8\n+\n+    (roi_inds, num_pixels,\n+     pixel_list) = diff_roi.roi_divide_circle(detector_size,\n+                                              radius, calibrated_center,\n+                                              num_angles)\n+    ty = np.zeros(detector_size).ravel()\n+    ty[pixel_list] = roi_inds\n+\n+    yy, xx = np.mgrid[:detector_size[0], :detector_size[1]]\n+    y_ = (np.flipud(yy) - calibrated_center[1])\n+    x_ = (xx - calibrated_center[0])\n+    grid_values = np.float_(np.hypot(x_, y_))\n+    angle_grid = np.arctan2(y_, x_)*180/(np.pi)\n+\n+    angle_grid = angle_grid[grid_values <= radius]\n+    num_pixels_m = (np.bincount(ty.astype(int)))[1:]\n+\n+    # get the indices into a grid\n+    zero_grid = np.zeros((detector_size[0], detector_size[1]))\n+\n+    zero_grid[grid_values <= radius] = 1\n+\n+    assert_array_equal(np.nonzero(zero_grid),\n+                       np.nonzero((ty.reshape(*detector_size))))\n+\n+    roi_inds_m = np.array([3, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2,\n+                           2, 2, 2, 2, 1, 3, 3, 3, 3, 3, 2, 2, 2,\n+                           2, 2, 1, 1, 1, 3, 3, 3, 3, 3, 3, 2, 2,\n+                           2, 2, 1, 1, 1, 4, 3, 3, 3, 3, 3, 3, 2,\n+                           2, 2, 1, 1, 1, 1, 1, 4, 4, 4, 3, 3, 3,\n+                           3, 2, 2, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4,\n+                           4, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 4, 4,\n+                           4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7,\n+                           7, 7, 4, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7,\n+                           7, 7, 7, 7, 4, 4, 4, 5, 5, 5, 5, 6, 6,\n+                           7, 7, 7, 7, 7, 7, 4, 5, 5, 5, 5, 5, 5,\n+                           6, 6, 6, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5,\n+                           5, 6, 6, 6, 6, 7, 7, 7, 5, 5, 5, 5, 5,\n+                           6, 6, 6, 6, 6, 7, 7, 7, 5, 5, 5, 5, 6,\n+                           6, 6, 6, 6, 6, 7, 5, 5, 6, 6, 6, 6, 6,\n+                           6])\n+\n+    assert_array_equal(num_pixels_m, num_pixels)\n+    assert_array_equal(roi_inds, roi_inds_m)","path":"skxray/tests/test_diff_roi_choice.py","position":73,"original_position":73,"commit_id":"0aac871e3961e5857cd3b3e1543d0e6aa86dbf2d","original_commit_id":"0aac871e3961e5857cd3b3e1543d0e6aa86dbf2d","user":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?v=3","gravatar_id":"","url":"https://api.github.com/users/sameera2004","html_url":"https://github.com/sameera2004","followers_url":"https://api.github.com/users/sameera2004/followers","following_url":"https://api.github.com/users/sameera2004/following{/other_user}","gists_url":"https://api.github.com/users/sameera2004/gists{/gist_id}","starred_url":"https://api.github.com/users/sameera2004/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameera2004/subscriptions","organizations_url":"https://api.github.com/users/sameera2004/orgs","repos_url":"https://api.github.com/users/sameera2004/repos","events_url":"https://api.github.com/users/sameera2004/events{/privacy}","received_events_url":"https://api.github.com/users/sameera2004/received_events","type":"User","site_admin":false},"body":"@tacaswell  now this PR is ready for review","created_at":"2015-03-02T20:08:54Z","updated_at":"2015-03-02T20:08:54Z","html_url":"https://github.com/Nikea/scikit-xray/pull/248#discussion_r25633260","pull_request_url":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248","_links":{"self":{"href":"https://api.github.com/repos/Nikea/scikit-xray/pulls/comments/25633260"},"html":{"href":"https://github.com/Nikea/scikit-xray/pull/248#discussion_r25633260"},"pull_request":{"href":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248"}}},"pull_request":{"url":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248","id":30179735,"html_url":"https://github.com/Nikea/scikit-xray/pull/248","diff_url":"https://github.com/Nikea/scikit-xray/pull/248.diff","patch_url":"https://github.com/Nikea/scikit-xray/pull/248.patch","issue_url":"https://api.github.com/repos/Nikea/scikit-xray/issues/248","number":248,"state":"open","locked":false,"title":"Divide the circle : find the indices, number of pixels, pixel indices ","user":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?v=3","gravatar_id":"","url":"https://api.github.com/users/sameera2004","html_url":"https://github.com/sameera2004","followers_url":"https://api.github.com/users/sameera2004/followers","following_url":"https://api.github.com/users/sameera2004/following{/other_user}","gists_url":"https://api.github.com/users/sameera2004/gists{/gist_id}","starred_url":"https://api.github.com/users/sameera2004/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameera2004/subscriptions","organizations_url":"https://api.github.com/users/sameera2004/orgs","repos_url":"https://api.github.com/users/sameera2004/repos","events_url":"https://api.github.com/users/sameera2004/events{/privacy}","received_events_url":"https://api.github.com/users/sameera2004/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-27T16:32:56Z","updated_at":"2015-03-02T20:08:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c5190a5359e0f587cc3e112585e92a4b3a8f297","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248/commits","review_comments_url":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248/comments","review_comment_url":"https://api.github.com/repos/Nikea/scikit-xray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nikea/scikit-xray/issues/248/comments","statuses_url":"https://api.github.com/repos/Nikea/scikit-xray/statuses/0aac871e3961e5857cd3b3e1543d0e6aa86dbf2d","head":{"label":"sameera2004:new_ring_divide","ref":"new_ring_divide","sha":"0aac871e3961e5857cd3b3e1543d0e6aa86dbf2d","user":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?v=3","gravatar_id":"","url":"https://api.github.com/users/sameera2004","html_url":"https://github.com/sameera2004","followers_url":"https://api.github.com/users/sameera2004/followers","following_url":"https://api.github.com/users/sameera2004/following{/other_user}","gists_url":"https://api.github.com/users/sameera2004/gists{/gist_id}","starred_url":"https://api.github.com/users/sameera2004/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameera2004/subscriptions","organizations_url":"https://api.github.com/users/sameera2004/orgs","repos_url":"https://api.github.com/users/sameera2004/repos","events_url":"https://api.github.com/users/sameera2004/events{/privacy}","received_events_url":"https://api.github.com/users/sameera2004/received_events","type":"User","site_admin":false},"repo":{"id":21700905,"name":"scikit-xray","full_name":"sameera2004/scikit-xray","owner":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?v=3","gravatar_id":"","url":"https://api.github.com/users/sameera2004","html_url":"https://github.com/sameera2004","followers_url":"https://api.github.com/users/sameera2004/followers","following_url":"https://api.github.com/users/sameera2004/following{/other_user}","gists_url":"https://api.github.com/users/sameera2004/gists{/gist_id}","starred_url":"https://api.github.com/users/sameera2004/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameera2004/subscriptions","organizations_url":"https://api.github.com/users/sameera2004/orgs","repos_url":"https://api.github.com/users/sameera2004/repos","events_url":"https://api.github.com/users/sameera2004/events{/privacy}","received_events_url":"https://api.github.com/users/sameera2004/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sameera2004/scikit-xray","description":"Core repository for tools at NSLS-II","fork":true,"url":"https://api.github.com/repos/sameera2004/scikit-xray","forks_url":"https://api.github.com/repos/sameera2004/scikit-xray/forks","keys_url":"https://api.github.com/repos/sameera2004/scikit-xray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sameera2004/scikit-xray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sameera2004/scikit-xray/teams","hooks_url":"https://api.github.com/repos/sameera2004/scikit-xray/hooks","issue_events_url":"https://api.github.com/repos/sameera2004/scikit-xray/issues/events{/number}","events_url":"https://api.github.com/repos/sameera2004/scikit-xray/events","assignees_url":"https://api.github.com/repos/sameera2004/scikit-xray/assignees{/user}","branches_url":"https://api.github.com/repos/sameera2004/scikit-xray/branches{/branch}","tags_url":"https://api.github.com/repos/sameera2004/scikit-xray/tags","blobs_url":"https://api.github.com/repos/sameera2004/scikit-xray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sameera2004/scikit-xray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sameera2004/scikit-xray/git/refs{/sha}","trees_url":"https://api.github.com/repos/sameera2004/scikit-xray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sameera2004/scikit-xray/statuses/{sha}","languages_url":"https://api.github.com/repos/sameera2004/scikit-xray/languages","stargazers_url":"https://api.github.com/repos/sameera2004/scikit-xray/stargazers","contributors_url":"https://api.github.com/repos/sameera2004/scikit-xray/contributors","subscribers_url":"https://api.github.com/repos/sameera2004/scikit-xray/subscribers","subscription_url":"https://api.github.com/repos/sameera2004/scikit-xray/subscription","commits_url":"https://api.github.com/repos/sameera2004/scikit-xray/commits{/sha}","git_commits_url":"https://api.github.com/repos/sameera2004/scikit-xray/git/commits{/sha}","comments_url":"https://api.github.com/repos/sameera2004/scikit-xray/comments{/number}","issue_comment_url":"https://api.github.com/repos/sameera2004/scikit-xray/issues/comments{/number}","contents_url":"https://api.github.com/repos/sameera2004/scikit-xray/contents/{+path}","compare_url":"https://api.github.com/repos/sameera2004/scikit-xray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sameera2004/scikit-xray/merges","archive_url":"https://api.github.com/repos/sameera2004/scikit-xray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sameera2004/scikit-xray/downloads","issues_url":"https://api.github.com/repos/sameera2004/scikit-xray/issues{/number}","pulls_url":"https://api.github.com/repos/sameera2004/scikit-xray/pulls{/number}","milestones_url":"https://api.github.com/repos/sameera2004/scikit-xray/milestones{/number}","notifications_url":"https://api.github.com/repos/sameera2004/scikit-xray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sameera2004/scikit-xray/labels{/name}","releases_url":"https://api.github.com/repos/sameera2004/scikit-xray/releases{/id}","created_at":"2014-07-10T16:10:03Z","updated_at":"2015-02-21T01:08:31Z","pushed_at":"2015-03-02T19:49:25Z","git_url":"git://github.com/sameera2004/scikit-xray.git","ssh_url":"git@github.com:sameera2004/scikit-xray.git","clone_url":"https://github.com/sameera2004/scikit-xray.git","svn_url":"https://github.com/sameera2004/scikit-xray","homepage":"","size":2821,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"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":1,"default_branch":"master"}},"base":{"label":"Nikea:master","ref":"master","sha":"483620d95f005c23d96fa6133c22f39b1de26974","user":{"login":"Nikea","id":7108465,"avatar_url":"https://avatars.githubusercontent.com/u/7108465?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikea","html_url":"https://github.com/Nikea","followers_url":"https://api.github.com/users/Nikea/followers","following_url":"https://api.github.com/users/Nikea/following{/other_user}","gists_url":"https://api.github.com/users/Nikea/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikea/subscriptions","organizations_url":"https://api.github.com/users/Nikea/orgs","repos_url":"https://api.github.com/users/Nikea/repos","events_url":"https://api.github.com/users/Nikea/events{/privacy}","received_events_url":"https://api.github.com/users/Nikea/received_events","type":"Organization","site_admin":false},"repo":{"id":21679569,"name":"scikit-xray","full_name":"Nikea/scikit-xray","owner":{"login":"Nikea","id":7108465,"avatar_url":"https://avatars.githubusercontent.com/u/7108465?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikea","html_url":"https://github.com/Nikea","followers_url":"https://api.github.com/users/Nikea/followers","following_url":"https://api.github.com/users/Nikea/following{/other_user}","gists_url":"https://api.github.com/users/Nikea/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikea/subscriptions","organizations_url":"https://api.github.com/users/Nikea/orgs","repos_url":"https://api.github.com/users/Nikea/repos","events_url":"https://api.github.com/users/Nikea/events{/privacy}","received_events_url":"https://api.github.com/users/Nikea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nikea/scikit-xray","description":"Data analysis tools for X-ray science","fork":false,"url":"https://api.github.com/repos/Nikea/scikit-xray","forks_url":"https://api.github.com/repos/Nikea/scikit-xray/forks","keys_url":"https://api.github.com/repos/Nikea/scikit-xray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nikea/scikit-xray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nikea/scikit-xray/teams","hooks_url":"https://api.github.com/repos/Nikea/scikit-xray/hooks","issue_events_url":"https://api.github.com/repos/Nikea/scikit-xray/issues/events{/number}","events_url":"https://api.github.com/repos/Nikea/scikit-xray/events","assignees_url":"https://api.github.com/repos/Nikea/scikit-xray/assignees{/user}","branches_url":"https://api.github.com/repos/Nikea/scikit-xray/branches{/branch}","tags_url":"https://api.github.com/repos/Nikea/scikit-xray/tags","blobs_url":"https://api.github.com/repos/Nikea/scikit-xray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nikea/scikit-xray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nikea/scikit-xray/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nikea/scikit-xray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nikea/scikit-xray/statuses/{sha}","languages_url":"https://api.github.com/repos/Nikea/scikit-xray/languages","stargazers_url":"https://api.github.com/repos/Nikea/scikit-xray/stargazers","contributors_url":"https://api.github.com/repos/Nikea/scikit-xray/contributors","subscribers_url":"https://api.github.com/repos/Nikea/scikit-xray/subscribers","subscription_url":"https://api.github.com/repos/Nikea/scikit-xray/subscription","commits_url":"https://api.github.com/repos/Nikea/scikit-xray/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nikea/scikit-xray/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nikea/scikit-xray/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nikea/scikit-xray/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nikea/scikit-xray/contents/{+path}","compare_url":"https://api.github.com/repos/Nikea/scikit-xray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nikea/scikit-xray/merges","archive_url":"https://api.github.com/repos/Nikea/scikit-xray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nikea/scikit-xray/downloads","issues_url":"https://api.github.com/repos/Nikea/scikit-xray/issues{/number}","pulls_url":"https://api.github.com/repos/Nikea/scikit-xray/pulls{/number}","milestones_url":"https://api.github.com/repos/Nikea/scikit-xray/milestones{/number}","notifications_url":"https://api.github.com/repos/Nikea/scikit-xray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nikea/scikit-xray/labels{/name}","releases_url":"https://api.github.com/repos/Nikea/scikit-xray/releases{/id}","created_at":"2014-07-10T04:44:35Z","updated_at":"2015-02-20T17:33:08Z","pushed_at":"2015-02-20T17:33:07Z","git_url":"git://github.com/Nikea/scikit-xray.git","ssh_url":"git@github.com:Nikea/scikit-xray.git","clone_url":"https://github.com/Nikea/scikit-xray.git","svn_url":"https://github.com/Nikea/scikit-xray","homepage":"","size":20696,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":101,"forks":13,"open_issues":101,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248"},"html":{"href":"https://github.com/Nikea/scikit-xray/pull/248"},"issue":{"href":"https://api.github.com/repos/Nikea/scikit-xray/issues/248"},"comments":{"href":"https://api.github.com/repos/Nikea/scikit-xray/issues/248/comments"},"review_comments":{"href":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248/comments"},"review_comment":{"href":"https://api.github.com/repos/Nikea/scikit-xray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nikea/scikit-xray/pulls/248/commits"},"statuses":{"href":"https://api.github.com/repos/Nikea/scikit-xray/statuses/0aac871e3961e5857cd3b3e1543d0e6aa86dbf2d"}}}}