{"action":"created","comment":{"url":"https://api.github.com/repos/gammapy/gammapy/pulls/comments/140478368","pull_request_review_id":64559374,"id":140478368,"diff_hunk":"@@ -116,47 +116,37 @@ def pdf_in_safe_range(self, lo_threshold, hi_threshold):\n         return data\n \n     @classmethod\n-    def from_gauss(cls, e_true, e_reco, sigma=0.2, pdf_threshold=1e-6):\n+    def from_gauss(cls, e_true, e_reco, sigma, bias, pdf_threshold=1e-6):\n         \"\"\"Create Gaussian `EnergyDispersion` matrix.\n \n-        The output matrix will be Gaussian in log(e_true / e_reco)\n-\n-        TODO: extend to have a vector of bias various true energies.\n-        TODO: extend to have vector of  resolution for various true energies.\n-        TODO: give formula: Gaussian in log(e_reco)\n-        TODO: add option to add poisson noise\n+        Calls :func:`~gammapy.irf.EnergyDispersion2D.from_gauss`\n \n         Parameters\n         ----------\n         e_true : `~astropy.units.Quantity`, `~gammapy.utils.nddata.BinnedDataAxis`\n             Bin edges of true energy axis\n         e_reco : `~astropy.units.Quantity`, `~gammapy.utils.nddata.BinnedDataAxis`\n             Bin edges of reconstructed energy axis\n-        sigma : float, optional\n+        bias : float or `~numpy.ndarray`\n+            Center of Gaussian energy dispersion, bias\n+        sigma : float or `~numpy.ndarray`\n             RMS width of Gaussian energy dispersion, resolution\n         pdf_threshold : float, optional\n             Zero suppression threshold\n         \"\"\"\n-        from scipy.special import erf\n-\n-        e_reco = EnergyBounds(e_reco)\n-        e_true = EnergyBounds(e_true)\n-\n-        # erf does not work with Quantities\n-        reco = e_reco.to('TeV').value\n-        true = e_true.log_centers.to('TeV').value\n-        migra_min = np.log10(reco[:-1] / true[:, np.newaxis])\n-        migra_max = np.log10(reco[1:] / true[:, np.newaxis])\n-\n-        pdf = .5 * (erf(migra_max / (np.sqrt(2.) * sigma))\n-                    - erf(migra_min / (np.sqrt(2.) * sigma)))\n-\n-        pdf[np.where(pdf < pdf_threshold)] = 0\n-\n-        e_lo, e_hi = (e_true[:-1], e_true[1:])\n-        ereco_lo, ereco_hi = (e_reco[:-1], e_reco[1:])\n-        return cls(e_true_lo=e_lo, e_true_hi=e_hi,\n-                   e_reco_lo=ereco_lo, e_reco_hi=ereco_hi, data=pdf)\n+        # migra axis\n+        migra = np.linspace(1./3, 3, 200)","path":"gammapy/irf/energy_dispersion.py","position":51,"original_position":51,"commit_id":"68a383afe670bf3d5b70116abce8b2616269dfbd","original_commit_id":"e7be50e5c9feca9cdd16be06347a866294c9f595","user":{"login":"joleroi","id":11678435,"avatar_url":"https://avatars1.githubusercontent.com/u/11678435?v=4","gravatar_id":"","url":"https://api.github.com/users/joleroi","html_url":"https://github.com/joleroi","followers_url":"https://api.github.com/users/joleroi/followers","following_url":"https://api.github.com/users/joleroi/following{/other_user}","gists_url":"https://api.github.com/users/joleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/joleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joleroi/subscriptions","organizations_url":"https://api.github.com/users/joleroi/orgs","repos_url":"https://api.github.com/users/joleroi/repos","events_url":"https://api.github.com/users/joleroi/events{/privacy}","received_events_url":"https://api.github.com/users/joleroi/received_events","type":"User","site_admin":false},"body":"This is not possible since a given ``e_reco`` and ``e_true`` axis do not translate into a unique ``migra`` binning (but a 2D array of migra values)","created_at":"2017-09-22T12:14:33Z","updated_at":"2017-09-22T12:14:33Z","html_url":"https://github.com/gammapy/gammapy/pull/1138#discussion_r140478368","pull_request_url":"https://api.github.com/repos/gammapy/gammapy/pulls/1138","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/comments/140478368"},"html":{"href":"https://github.com/gammapy/gammapy/pull/1138#discussion_r140478368"},"pull_request":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/1138"}},"in_reply_to_id":139235586},"pull_request":{"url":"https://api.github.com/repos/gammapy/gammapy/pulls/1138","id":141365775,"html_url":"https://github.com/gammapy/gammapy/pull/1138","diff_url":"https://github.com/gammapy/gammapy/pull/1138.diff","patch_url":"https://github.com/gammapy/gammapy/pull/1138.patch","issue_url":"https://api.github.com/repos/gammapy/gammapy/issues/1138","number":1138,"state":"open","locked":false,"title":"Improve EnergyDispersion","user":{"login":"joleroi","id":11678435,"avatar_url":"https://avatars1.githubusercontent.com/u/11678435?v=4","gravatar_id":"","url":"https://api.github.com/users/joleroi","html_url":"https://github.com/joleroi","followers_url":"https://api.github.com/users/joleroi/followers","following_url":"https://api.github.com/users/joleroi/following{/other_user}","gists_url":"https://api.github.com/users/joleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/joleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joleroi/subscriptions","organizations_url":"https://api.github.com/users/joleroi/orgs","repos_url":"https://api.github.com/users/joleroi/repos","events_url":"https://api.github.com/users/joleroi/events{/privacy}","received_events_url":"https://api.github.com/users/joleroi/received_events","type":"User","site_admin":false},"body":"Implements the changes suggested in https://github.com/gammapy/gammapy/issues/1132#issuecomment-329840625\r\n\r\ncc @cdeil @cosimoNigro @registerrier","created_at":"2017-09-15T17:48:17Z","updated_at":"2017-09-22T12:14:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ea6ca46427aa051840ff04947ab444f26813176","assignee":{"login":"joleroi","id":11678435,"avatar_url":"https://avatars1.githubusercontent.com/u/11678435?v=4","gravatar_id":"","url":"https://api.github.com/users/joleroi","html_url":"https://github.com/joleroi","followers_url":"https://api.github.com/users/joleroi/followers","following_url":"https://api.github.com/users/joleroi/following{/other_user}","gists_url":"https://api.github.com/users/joleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/joleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joleroi/subscriptions","organizations_url":"https://api.github.com/users/joleroi/orgs","repos_url":"https://api.github.com/users/joleroi/repos","events_url":"https://api.github.com/users/joleroi/events{/privacy}","received_events_url":"https://api.github.com/users/joleroi/received_events","type":"User","site_admin":false},"assignees":[{"login":"joleroi","id":11678435,"avatar_url":"https://avatars1.githubusercontent.com/u/11678435?v=4","gravatar_id":"","url":"https://api.github.com/users/joleroi","html_url":"https://github.com/joleroi","followers_url":"https://api.github.com/users/joleroi/followers","following_url":"https://api.github.com/users/joleroi/following{/other_user}","gists_url":"https://api.github.com/users/joleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/joleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joleroi/subscriptions","organizations_url":"https://api.github.com/users/joleroi/orgs","repos_url":"https://api.github.com/users/joleroi/repos","events_url":"https://api.github.com/users/joleroi/events{/privacy}","received_events_url":"https://api.github.com/users/joleroi/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"lmohrmann","id":15608734,"avatar_url":"https://avatars3.githubusercontent.com/u/15608734?v=4","gravatar_id":"","url":"https://api.github.com/users/lmohrmann","html_url":"https://github.com/lmohrmann","followers_url":"https://api.github.com/users/lmohrmann/followers","following_url":"https://api.github.com/users/lmohrmann/following{/other_user}","gists_url":"https://api.github.com/users/lmohrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lmohrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmohrmann/subscriptions","organizations_url":"https://api.github.com/users/lmohrmann/orgs","repos_url":"https://api.github.com/users/lmohrmann/repos","events_url":"https://api.github.com/users/lmohrmann/events{/privacy}","received_events_url":"https://api.github.com/users/lmohrmann/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/gammapy/gammapy/milestones/10","html_url":"https://github.com/gammapy/gammapy/milestone/10","labels_url":"https://api.github.com/repos/gammapy/gammapy/milestones/10/labels","id":2282173,"number":10,"title":"0.7","description":"","creator":{"login":"cdeil","id":852409,"avatar_url":"https://avatars3.githubusercontent.com/u/852409?v=4","gravatar_id":"","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"open_issues":77,"closed_issues":118,"state":"open","created_at":"2017-01-27T12:50:29Z","updated_at":"2017-09-22T10:59:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/gammapy/gammapy/pulls/1138/commits","review_comments_url":"https://api.github.com/repos/gammapy/gammapy/pulls/1138/comments","review_comment_url":"https://api.github.com/repos/gammapy/gammapy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gammapy/gammapy/issues/1138/comments","statuses_url":"https://api.github.com/repos/gammapy/gammapy/statuses/68a383afe670bf3d5b70116abce8b2616269dfbd","head":{"label":"joleroi:improve_edisp","ref":"improve_edisp","sha":"68a383afe670bf3d5b70116abce8b2616269dfbd","user":{"login":"joleroi","id":11678435,"avatar_url":"https://avatars1.githubusercontent.com/u/11678435?v=4","gravatar_id":"","url":"https://api.github.com/users/joleroi","html_url":"https://github.com/joleroi","followers_url":"https://api.github.com/users/joleroi/followers","following_url":"https://api.github.com/users/joleroi/following{/other_user}","gists_url":"https://api.github.com/users/joleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/joleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joleroi/subscriptions","organizations_url":"https://api.github.com/users/joleroi/orgs","repos_url":"https://api.github.com/users/joleroi/repos","events_url":"https://api.github.com/users/joleroi/events{/privacy}","received_events_url":"https://api.github.com/users/joleroi/received_events","type":"User","site_admin":false},"repo":{"id":34865384,"name":"gammapy","full_name":"joleroi/gammapy","owner":{"login":"joleroi","id":11678435,"avatar_url":"https://avatars1.githubusercontent.com/u/11678435?v=4","gravatar_id":"","url":"https://api.github.com/users/joleroi","html_url":"https://github.com/joleroi","followers_url":"https://api.github.com/users/joleroi/followers","following_url":"https://api.github.com/users/joleroi/following{/other_user}","gists_url":"https://api.github.com/users/joleroi/gists{/gist_id}","starred_url":"https://api.github.com/users/joleroi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joleroi/subscriptions","organizations_url":"https://api.github.com/users/joleroi/orgs","repos_url":"https://api.github.com/users/joleroi/repos","events_url":"https://api.github.com/users/joleroi/events{/privacy}","received_events_url":"https://api.github.com/users/joleroi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joleroi/gammapy","description":"A Python package for gamma-ray astronomy","fork":true,"url":"https://api.github.com/repos/joleroi/gammapy","forks_url":"https://api.github.com/repos/joleroi/gammapy/forks","keys_url":"https://api.github.com/repos/joleroi/gammapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joleroi/gammapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joleroi/gammapy/teams","hooks_url":"https://api.github.com/repos/joleroi/gammapy/hooks","issue_events_url":"https://api.github.com/repos/joleroi/gammapy/issues/events{/number}","events_url":"https://api.github.com/repos/joleroi/gammapy/events","assignees_url":"https://api.github.com/repos/joleroi/gammapy/assignees{/user}","branches_url":"https://api.github.com/repos/joleroi/gammapy/branches{/branch}","tags_url":"https://api.github.com/repos/joleroi/gammapy/tags","blobs_url":"https://api.github.com/repos/joleroi/gammapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joleroi/gammapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joleroi/gammapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/joleroi/gammapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joleroi/gammapy/statuses/{sha}","languages_url":"https://api.github.com/repos/joleroi/gammapy/languages","stargazers_url":"https://api.github.com/repos/joleroi/gammapy/stargazers","contributors_url":"https://api.github.com/repos/joleroi/gammapy/contributors","subscribers_url":"https://api.github.com/repos/joleroi/gammapy/subscribers","subscription_url":"https://api.github.com/repos/joleroi/gammapy/subscription","commits_url":"https://api.github.com/repos/joleroi/gammapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/joleroi/gammapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/joleroi/gammapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/joleroi/gammapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/joleroi/gammapy/contents/{+path}","compare_url":"https://api.github.com/repos/joleroi/gammapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joleroi/gammapy/merges","archive_url":"https://api.github.com/repos/joleroi/gammapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joleroi/gammapy/downloads","issues_url":"https://api.github.com/repos/joleroi/gammapy/issues{/number}","pulls_url":"https://api.github.com/repos/joleroi/gammapy/pulls{/number}","milestones_url":"https://api.github.com/repos/joleroi/gammapy/milestones{/number}","notifications_url":"https://api.github.com/repos/joleroi/gammapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joleroi/gammapy/labels{/name}","releases_url":"https://api.github.com/repos/joleroi/gammapy/releases{/id}","deployments_url":"https://api.github.com/repos/joleroi/gammapy/deployments","created_at":"2015-04-30T16:42:10Z","updated_at":"2015-04-30T16:42:10Z","pushed_at":"2017-09-22T12:13:33Z","git_url":"git://github.com/joleroi/gammapy.git","ssh_url":"git@github.com:joleroi/gammapy.git","clone_url":"https://github.com/joleroi/gammapy.git","svn_url":"https://github.com/joleroi/gammapy","homepage":"https://gammapy.readthedocs.org/","size":9489,"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":"gammapy:master","ref":"master","sha":"7df332fe5a2591946d5e111799bcb296cea9cda7","user":{"login":"gammapy","id":852764,"avatar_url":"https://avatars2.githubusercontent.com/u/852764?v=4","gravatar_id":"","url":"https://api.github.com/users/gammapy","html_url":"https://github.com/gammapy","followers_url":"https://api.github.com/users/gammapy/followers","following_url":"https://api.github.com/users/gammapy/following{/other_user}","gists_url":"https://api.github.com/users/gammapy/gists{/gist_id}","starred_url":"https://api.github.com/users/gammapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gammapy/subscriptions","organizations_url":"https://api.github.com/users/gammapy/orgs","repos_url":"https://api.github.com/users/gammapy/repos","events_url":"https://api.github.com/users/gammapy/events{/privacy}","received_events_url":"https://api.github.com/users/gammapy/received_events","type":"Organization","site_admin":false},"repo":{"id":10073640,"name":"gammapy","full_name":"gammapy/gammapy","owner":{"login":"gammapy","id":852764,"avatar_url":"https://avatars2.githubusercontent.com/u/852764?v=4","gravatar_id":"","url":"https://api.github.com/users/gammapy","html_url":"https://github.com/gammapy","followers_url":"https://api.github.com/users/gammapy/followers","following_url":"https://api.github.com/users/gammapy/following{/other_user}","gists_url":"https://api.github.com/users/gammapy/gists{/gist_id}","starred_url":"https://api.github.com/users/gammapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gammapy/subscriptions","organizations_url":"https://api.github.com/users/gammapy/orgs","repos_url":"https://api.github.com/users/gammapy/repos","events_url":"https://api.github.com/users/gammapy/events{/privacy}","received_events_url":"https://api.github.com/users/gammapy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gammapy/gammapy","description":"A Python package for gamma-ray astronomy","fork":false,"url":"https://api.github.com/repos/gammapy/gammapy","forks_url":"https://api.github.com/repos/gammapy/gammapy/forks","keys_url":"https://api.github.com/repos/gammapy/gammapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gammapy/gammapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gammapy/gammapy/teams","hooks_url":"https://api.github.com/repos/gammapy/gammapy/hooks","issue_events_url":"https://api.github.com/repos/gammapy/gammapy/issues/events{/number}","events_url":"https://api.github.com/repos/gammapy/gammapy/events","assignees_url":"https://api.github.com/repos/gammapy/gammapy/assignees{/user}","branches_url":"https://api.github.com/repos/gammapy/gammapy/branches{/branch}","tags_url":"https://api.github.com/repos/gammapy/gammapy/tags","blobs_url":"https://api.github.com/repos/gammapy/gammapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gammapy/gammapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gammapy/gammapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/gammapy/gammapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gammapy/gammapy/statuses/{sha}","languages_url":"https://api.github.com/repos/gammapy/gammapy/languages","stargazers_url":"https://api.github.com/repos/gammapy/gammapy/stargazers","contributors_url":"https://api.github.com/repos/gammapy/gammapy/contributors","subscribers_url":"https://api.github.com/repos/gammapy/gammapy/subscribers","subscription_url":"https://api.github.com/repos/gammapy/gammapy/subscription","commits_url":"https://api.github.com/repos/gammapy/gammapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/gammapy/gammapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/gammapy/gammapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/gammapy/gammapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/gammapy/gammapy/contents/{+path}","compare_url":"https://api.github.com/repos/gammapy/gammapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gammapy/gammapy/merges","archive_url":"https://api.github.com/repos/gammapy/gammapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gammapy/gammapy/downloads","issues_url":"https://api.github.com/repos/gammapy/gammapy/issues{/number}","pulls_url":"https://api.github.com/repos/gammapy/gammapy/pulls{/number}","milestones_url":"https://api.github.com/repos/gammapy/gammapy/milestones{/number}","notifications_url":"https://api.github.com/repos/gammapy/gammapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gammapy/gammapy/labels{/name}","releases_url":"https://api.github.com/repos/gammapy/gammapy/releases{/id}","deployments_url":"https://api.github.com/repos/gammapy/gammapy/deployments","created_at":"2013-05-15T07:50:40Z","updated_at":"2017-09-07T14:31:26Z","pushed_at":"2017-09-22T12:13:34Z","git_url":"git://github.com/gammapy/gammapy.git","ssh_url":"git@github.com:gammapy/gammapy.git","clone_url":"https://github.com/gammapy/gammapy.git","svn_url":"https://github.com/gammapy/gammapy","homepage":"http://docs.gammapy.org","size":9541,"stargazers_count":32,"watchers_count":32,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":200,"forks":61,"open_issues":200,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/1138"},"html":{"href":"https://github.com/gammapy/gammapy/pull/1138"},"issue":{"href":"https://api.github.com/repos/gammapy/gammapy/issues/1138"},"comments":{"href":"https://api.github.com/repos/gammapy/gammapy/issues/1138/comments"},"review_comments":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/1138/comments"},"review_comment":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gammapy/gammapy/pulls/1138/commits"},"statuses":{"href":"https://api.github.com/repos/gammapy/gammapy/statuses/68a383afe670bf3d5b70116abce8b2616269dfbd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"joleroi"}}