GitHub PullRequestReviewCommentEvent at 2014-07-17 20:59:31
Repository: NSLS2
Actor: tacaswell
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/comments/15083658","id":15083658,"diff_hunk":"@@ -12,47 +12,63 @@\n \n import six\n import numpy as np\n+import exceptions\n+import time\n+import gc\n+import operator\n \n-def project_to_sphere(img, dist_sample, detector_center, pixel_size, wavelength, \n-                      ROI = None, **kwargs):\n+try:\n+    import ctrans as ctrans\n+except:\n+    try:\n+        import ctrans\n+    except:\n+        pass\n+\n+gc.enable()\n+\n+\n+def project_to_sphere(img, dist_sample, detector_center, pixel_size,\n+                      wavelength, ROI=None, **kwargs):\n     \"\"\"\n     Project the pixels on the 2D detector to the surface of a sphere.\n     \n-    Parameters\n+    Parameters :\n     ----------\n-    img: ndarray\n+    img : ndarray\n          2D detector image\n-    dist_sample: float\n+    dist_sample : float\n                  see keys_core\n                  (mm)\n-    detector_center: 2 element float array\n+    detector_center : 2 element float array\n                      see keys_core\n                      (pixels)\n-    pixel_size: 2 element float array\n+    pixel_size : 2 element float array\n                 see keys_core\n                 (mm)\n-    wavelength: float\n+    wavelength : float\n                 see keys_core\n                 (Angstroms)\n-    ROI: 4 element int array\n+    ROI : 4 element int array\n            ROI defines a rectangular ROI for img\n            ROI[0] == x_min\n            ROI[1] == x_max\n            ROI[2] == y_min\n            ROI[3] == y_max\n-    **kwargs: dict\n+    **kwargs : dict\n               Bucket for extra parameters from an unpacked dictionary\n     \n-    Returns\n+    Returns :\n     -------\n-    qi: 4 x N array of the coordinates in Q space (A^-1)\n+    qi : 4 x N array of the coordinates in Q space (A^-1)\n         Rows correspond to individual pixels\n         Columns are (Qx, Qy, Qz, I)\n+        \n     \"\"\"\n     \n     if ROI is not None and len(ROI) == 4:","path":"nsls2/recip.py","position":70,"original_position":70,"commit_id":"723597892041faeb9b8807705860c01b710bafd8","original_commit_id":"723597892041faeb9b8807705860c01b710bafd8","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?","gravatar_id":"8744048060e5931c500d3c9d1ecb997e","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"body":"This should raise a `ValueError` if `ROI` is not `None` and it isn't length 4.  This means the user has passed in bad parameters and we should not silently ignore that.","created_at":"2014-07-17T20:59:31Z","updated_at":"2014-07-17T20:59:31Z","html_url":"https://github.com/NSLS-II/NSLS2/pull/5#discussion_r15083658","pull_request_url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/comments/15083658"},"html":{"href":"https://github.com/NSLS-II/NSLS2/pull/5#discussion_r15083658"},"pull_request":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5","id":18546887,"html_url":"https://github.com/NSLS-II/NSLS2/pull/5","diff_url":"https://github.com/NSLS-II/NSLS2/pull/5.diff","patch_url":"https://github.com/NSLS-II/NSLS2/pull/5.patch","issue_url":"https://api.github.com/repos/NSLS-II/NSLS2/issues/5","number":5,"state":"open","title":"Reciprocal space","user":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?","gravatar_id":"edffcac17868f4589f5e1f9b723fd7bb","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":"Added function to nsls2/recip.py taken parts from the pyspec \r\n\r\ndef process_to_q - This will procees the given images (certain scan) of\r\n    the full set into receiprocal(Q) space, (Qx, Qy, Qz, I)\r\ndef process_grid  -This function will process the set of\r\n    (Qx, Qy, Qz, I) values and grid the data\r\ndef get-grid_mesh - This function returns the X,Y, Z co-ordinates of the grid as 3d arrays","created_at":"2014-07-17T18:51:45Z","updated_at":"2014-07-17T20:59:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfb3eddd966a1685a71205cdc3f8dba0399dd000","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5/commits","review_comments_url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5/comments","review_comment_url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/comments/{number}","comments_url":"https://api.github.com/repos/NSLS-II/NSLS2/issues/5/comments","statuses_url":"https://api.github.com/repos/NSLS-II/NSLS2/statuses/723597892041faeb9b8807705860c01b710bafd8","head":{"label":"sameera2004:Reciprocal_Space","ref":"Reciprocal_Space","sha":"723597892041faeb9b8807705860c01b710bafd8","user":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?","gravatar_id":"edffcac17868f4589f5e1f9b723fd7bb","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":"NSLS2","full_name":"sameera2004/NSLS2","owner":{"login":"sameera2004","id":5701652,"avatar_url":"https://avatars.githubusercontent.com/u/5701652?","gravatar_id":"edffcac17868f4589f5e1f9b723fd7bb","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/NSLS2","description":"Core repository for tools at NSLS-II","fork":true,"url":"https://api.github.com/repos/sameera2004/NSLS2","forks_url":"https://api.github.com/repos/sameera2004/NSLS2/forks","keys_url":"https://api.github.com/repos/sameera2004/NSLS2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sameera2004/NSLS2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sameera2004/NSLS2/teams","hooks_url":"https://api.github.com/repos/sameera2004/NSLS2/hooks","issue_events_url":"https://api.github.com/repos/sameera2004/NSLS2/issues/events{/number}","events_url":"https://api.github.com/repos/sameera2004/NSLS2/events","assignees_url":"https://api.github.com/repos/sameera2004/NSLS2/assignees{/user}","branches_url":"https://api.github.com/repos/sameera2004/NSLS2/branches{/branch}","tags_url":"https://api.github.com/repos/sameera2004/NSLS2/tags","blobs_url":"https://api.github.com/repos/sameera2004/NSLS2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sameera2004/NSLS2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sameera2004/NSLS2/git/refs{/sha}","trees_url":"https://api.github.com/repos/sameera2004/NSLS2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sameera2004/NSLS2/statuses/{sha}","languages_url":"https://api.github.com/repos/sameera2004/NSLS2/languages","stargazers_url":"https://api.github.com/repos/sameera2004/NSLS2/stargazers","contributors_url":"https://api.github.com/repos/sameera2004/NSLS2/contributors","subscribers_url":"https://api.github.com/repos/sameera2004/NSLS2/subscribers","subscription_url":"https://api.github.com/repos/sameera2004/NSLS2/subscription","commits_url":"https://api.github.com/repos/sameera2004/NSLS2/commits{/sha}","git_commits_url":"https://api.github.com/repos/sameera2004/NSLS2/git/commits{/sha}","comments_url":"https://api.github.com/repos/sameera2004/NSLS2/comments{/number}","issue_comment_url":"https://api.github.com/repos/sameera2004/NSLS2/issues/comments/{number}","contents_url":"https://api.github.com/repos/sameera2004/NSLS2/contents/{+path}","compare_url":"https://api.github.com/repos/sameera2004/NSLS2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sameera2004/NSLS2/merges","archive_url":"https://api.github.com/repos/sameera2004/NSLS2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sameera2004/NSLS2/downloads","issues_url":"https://api.github.com/repos/sameera2004/NSLS2/issues{/number}","pulls_url":"https://api.github.com/repos/sameera2004/NSLS2/pulls{/number}","milestones_url":"https://api.github.com/repos/sameera2004/NSLS2/milestones{/number}","notifications_url":"https://api.github.com/repos/sameera2004/NSLS2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sameera2004/NSLS2/labels{/name}","releases_url":"https://api.github.com/repos/sameera2004/NSLS2/releases{/id}","created_at":"2014-07-10T16:10:03Z","updated_at":"2014-07-15T21:15:41Z","pushed_at":"2014-07-17T18:46:15Z","git_url":"git://github.com/sameera2004/NSLS2.git","ssh_url":"git@github.com:sameera2004/NSLS2.git","clone_url":"https://github.com/sameera2004/NSLS2.git","svn_url":"https://github.com/sameera2004/NSLS2","homepage":"","size":570,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NSLS-II:master","ref":"master","sha":"74f63971b4404043849b75e3b885c973fd3a873c","user":{"login":"NSLS-II","id":7108465,"avatar_url":"https://avatars.githubusercontent.com/u/7108465?","gravatar_id":null,"url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"repo":{"id":21679569,"name":"NSLS2","full_name":"NSLS-II/NSLS2","owner":{"login":"NSLS-II","id":7108465,"avatar_url":"https://avatars.githubusercontent.com/u/7108465?","gravatar_id":null,"url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NSLS-II/NSLS2","description":"Core repository for tools at NSLS-II","fork":false,"url":"https://api.github.com/repos/NSLS-II/NSLS2","forks_url":"https://api.github.com/repos/NSLS-II/NSLS2/forks","keys_url":"https://api.github.com/repos/NSLS-II/NSLS2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NSLS-II/NSLS2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NSLS-II/NSLS2/teams","hooks_url":"https://api.github.com/repos/NSLS-II/NSLS2/hooks","issue_events_url":"https://api.github.com/repos/NSLS-II/NSLS2/issues/events{/number}","events_url":"https://api.github.com/repos/NSLS-II/NSLS2/events","assignees_url":"https://api.github.com/repos/NSLS-II/NSLS2/assignees{/user}","branches_url":"https://api.github.com/repos/NSLS-II/NSLS2/branches{/branch}","tags_url":"https://api.github.com/repos/NSLS-II/NSLS2/tags","blobs_url":"https://api.github.com/repos/NSLS-II/NSLS2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NSLS-II/NSLS2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NSLS-II/NSLS2/git/refs{/sha}","trees_url":"https://api.github.com/repos/NSLS-II/NSLS2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NSLS-II/NSLS2/statuses/{sha}","languages_url":"https://api.github.com/repos/NSLS-II/NSLS2/languages","stargazers_url":"https://api.github.com/repos/NSLS-II/NSLS2/stargazers","contributors_url":"https://api.github.com/repos/NSLS-II/NSLS2/contributors","subscribers_url":"https://api.github.com/repos/NSLS-II/NSLS2/subscribers","subscription_url":"https://api.github.com/repos/NSLS-II/NSLS2/subscription","commits_url":"https://api.github.com/repos/NSLS-II/NSLS2/commits{/sha}","git_commits_url":"https://api.github.com/repos/NSLS-II/NSLS2/git/commits{/sha}","comments_url":"https://api.github.com/repos/NSLS-II/NSLS2/comments{/number}","issue_comment_url":"https://api.github.com/repos/NSLS-II/NSLS2/issues/comments/{number}","contents_url":"https://api.github.com/repos/NSLS-II/NSLS2/contents/{+path}","compare_url":"https://api.github.com/repos/NSLS-II/NSLS2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NSLS-II/NSLS2/merges","archive_url":"https://api.github.com/repos/NSLS-II/NSLS2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NSLS-II/NSLS2/downloads","issues_url":"https://api.github.com/repos/NSLS-II/NSLS2/issues{/number}","pulls_url":"https://api.github.com/repos/NSLS-II/NSLS2/pulls{/number}","milestones_url":"https://api.github.com/repos/NSLS-II/NSLS2/milestones{/number}","notifications_url":"https://api.github.com/repos/NSLS-II/NSLS2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NSLS-II/NSLS2/labels{/name}","releases_url":"https://api.github.com/repos/NSLS-II/NSLS2/releases{/id}","created_at":"2014-07-10T04:44:35Z","updated_at":"2014-07-16T18:11:17Z","pushed_at":"2014-07-10T04:58:15Z","git_url":"git://github.com/NSLS-II/NSLS2.git","ssh_url":"git@github.com:NSLS-II/NSLS2.git","clone_url":"https://github.com/NSLS-II/NSLS2.git","svn_url":"https://github.com/NSLS-II/NSLS2","homepage":"","size":701,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5"},"html":{"href":"https://github.com/NSLS-II/NSLS2/pull/5"},"issue":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/issues/5"},"comments":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/NSLS-II/NSLS2/statuses/723597892041faeb9b8807705860c01b710bafd8"}}}}