{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/specutils/pulls/comments/217544007","pull_request_review_id":155281823,"id":217544007,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzU0NDAwNw==","diff_hunk":"@@ -0,0 +1,212 @@\n+import numpy as np\n+from astropy.stats.funcs import gaussian_fwhm_to_sigma\n+from ..spectra import SpectralRegion\n+\n+\n+__all__ = ['gaussian_sigma_width', 'gaussian_fwhm', 'fwhm']\n+\n+\n+def _computation_wrapper(func, spectrum, region):\n+\n+    # No region, therefore whole spectrum.\n+    if region is None:\n+        return func(spectrum)\n+\n+    # Single region\n+    elif isinstance(region, SpectralRegion):\n+        return func(spectrum, region=region)\n+\n+    # List of regions\n+    elif isinstance(region, list):\n+        return [func(spectrum, region=reg) for reg in region]\n+\n+\n+def gaussian_sigma_width(spectrum, region=None):\n+    \"\"\"\n+    Estimate the full width of the spectrum based on an approximate value of\n+    sigma.  This will be calculated over the regions, if they are specified.","path":"specutils/analysis/width.py","position":27,"original_position":27,"commit_id":"a9db3e6df185543c0569511830e649d56d884a21","original_commit_id":"a9db3e6df185543c0569511830e649d56d884a21","user":{"login":"eteq","id":346587,"node_id":"MDQ6VXNlcjM0NjU4Nw==","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},"body":"Might reword this a bit to something like \"Estimate the width of the spectrum using a second-moment analysis, scaled to match the sigma/standard deviation parameter of a standard Gaussian profile.\"? I'm not sure the grammar is sound in what I wrote there, but I think it at least hits on all the key mathematical points... 😉 ","created_at":"2018-09-13T21:44:59Z","updated_at":"2018-09-13T22:00:02Z","html_url":"https://github.com/astropy/specutils/pull/281#discussion_r217544007","pull_request_url":"https://api.github.com/repos/astropy/specutils/pulls/281","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/astropy/specutils/pulls/comments/217544007"},"html":{"href":"https://github.com/astropy/specutils/pull/281#discussion_r217544007"},"pull_request":{"href":"https://api.github.com/repos/astropy/specutils/pulls/281"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/specutils/pulls/281","id":209635856,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NjM1ODU2","html_url":"https://github.com/astropy/specutils/pull/281","diff_url":"https://github.com/astropy/specutils/pull/281.diff","patch_url":"https://github.com/astropy/specutils/pull/281.patch","issue_url":"https://api.github.com/repos/astropy/specutils/issues/281","number":281,"state":"open","locked":false,"title":"Add width statistics","user":{"login":"drdavella","id":2458487,"node_id":"MDQ6VXNlcjI0NTg0ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2458487?v=4","gravatar_id":"","url":"https://api.github.com/users/drdavella","html_url":"https://github.com/drdavella","followers_url":"https://api.github.com/users/drdavella/followers","following_url":"https://api.github.com/users/drdavella/following{/other_user}","gists_url":"https://api.github.com/users/drdavella/gists{/gist_id}","starred_url":"https://api.github.com/users/drdavella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdavella/subscriptions","organizations_url":"https://api.github.com/users/drdavella/orgs","repos_url":"https://api.github.com/users/drdavella/repos","events_url":"https://api.github.com/users/drdavella/events{/privacy}","received_events_url":"https://api.github.com/users/drdavella/received_events","type":"User","site_admin":false},"body":"This implements full width half max and full width based on gaussian sigma. It resolves #238 and resolves #241.\r\n\r\n~Currently it does not properly handle `Spectrum1D` objects with multiple spectra (see #280).~ This is no longer true thanks to #283.\r\n\r\n**Update**\r\n~This now resolves issue #268 as well.~ Issue #268 should be addressed in a separate PR since as @eteq pointed out below, `equivalent_width` doesn't really belong with the other \"width\" calculations.\r\n\r\nWhile this PR does not directly address #266, I believe it will provide a useful starting point for refactoring analysis operations.","created_at":"2018-08-20T20:34:55Z","updated_at":"2018-09-13T22:00:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c54a791281110f25234a4f8c30c41ba6537c1d7","assignee":{"login":"drdavella","id":2458487,"node_id":"MDQ6VXNlcjI0NTg0ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2458487?v=4","gravatar_id":"","url":"https://api.github.com/users/drdavella","html_url":"https://github.com/drdavella","followers_url":"https://api.github.com/users/drdavella/followers","following_url":"https://api.github.com/users/drdavella/following{/other_user}","gists_url":"https://api.github.com/users/drdavella/gists{/gist_id}","starred_url":"https://api.github.com/users/drdavella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdavella/subscriptions","organizations_url":"https://api.github.com/users/drdavella/orgs","repos_url":"https://api.github.com/users/drdavella/repos","events_url":"https://api.github.com/users/drdavella/events{/privacy}","received_events_url":"https://api.github.com/users/drdavella/received_events","type":"User","site_admin":false},"assignees":[{"login":"drdavella","id":2458487,"node_id":"MDQ6VXNlcjI0NTg0ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2458487?v=4","gravatar_id":"","url":"https://api.github.com/users/drdavella","html_url":"https://github.com/drdavella","followers_url":"https://api.github.com/users/drdavella/followers","following_url":"https://api.github.com/users/drdavella/following{/other_user}","gists_url":"https://api.github.com/users/drdavella/gists{/gist_id}","starred_url":"https://api.github.com/users/drdavella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdavella/subscriptions","organizations_url":"https://api.github.com/users/drdavella/orgs","repos_url":"https://api.github.com/users/drdavella/repos","events_url":"https://api.github.com/users/drdavella/events{/privacy}","received_events_url":"https://api.github.com/users/drdavella/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"hcferguson","id":2261329,"node_id":"MDQ6VXNlcjIyNjEzMjk=","avatar_url":"https://avatars0.githubusercontent.com/u/2261329?v=4","gravatar_id":"","url":"https://api.github.com/users/hcferguson","html_url":"https://github.com/hcferguson","followers_url":"https://api.github.com/users/hcferguson/followers","following_url":"https://api.github.com/users/hcferguson/following{/other_user}","gists_url":"https://api.github.com/users/hcferguson/gists{/gist_id}","starred_url":"https://api.github.com/users/hcferguson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcferguson/subscriptions","organizations_url":"https://api.github.com/users/hcferguson/orgs","repos_url":"https://api.github.com/users/hcferguson/repos","events_url":"https://api.github.com/users/hcferguson/events{/privacy}","received_events_url":"https://api.github.com/users/hcferguson/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/astropy/specutils/milestones/3","html_url":"https://github.com/astropy/specutils/milestone/3","labels_url":"https://api.github.com/repos/astropy/specutils/milestones/3/labels","id":3625193,"node_id":"MDk6TWlsZXN0b25lMzYyNTE5Mw==","number":3,"title":"v0.4.0","description":"","creator":{"login":"nmearl","id":4141126,"node_id":"MDQ6VXNlcjQxNDExMjY=","avatar_url":"https://avatars2.githubusercontent.com/u/4141126?v=4","gravatar_id":"","url":"https://api.github.com/users/nmearl","html_url":"https://github.com/nmearl","followers_url":"https://api.github.com/users/nmearl/followers","following_url":"https://api.github.com/users/nmearl/following{/other_user}","gists_url":"https://api.github.com/users/nmearl/gists{/gist_id}","starred_url":"https://api.github.com/users/nmearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmearl/subscriptions","organizations_url":"https://api.github.com/users/nmearl/orgs","repos_url":"https://api.github.com/users/nmearl/repos","events_url":"https://api.github.com/users/nmearl/events{/privacy}","received_events_url":"https://api.github.com/users/nmearl/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":22,"state":"open","created_at":"2018-09-05T15:04:58Z","updated_at":"2018-09-13T21:37:35Z","due_on":"2018-09-10T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/astropy/specutils/pulls/281/commits","review_comments_url":"https://api.github.com/repos/astropy/specutils/pulls/281/comments","review_comment_url":"https://api.github.com/repos/astropy/specutils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/specutils/issues/281/comments","statuses_url":"https://api.github.com/repos/astropy/specutils/statuses/a9db3e6df185543c0569511830e649d56d884a21","head":{"label":"drdavella:width-stats","ref":"width-stats","sha":"a9db3e6df185543c0569511830e649d56d884a21","user":{"login":"drdavella","id":2458487,"node_id":"MDQ6VXNlcjI0NTg0ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2458487?v=4","gravatar_id":"","url":"https://api.github.com/users/drdavella","html_url":"https://github.com/drdavella","followers_url":"https://api.github.com/users/drdavella/followers","following_url":"https://api.github.com/users/drdavella/following{/other_user}","gists_url":"https://api.github.com/users/drdavella/gists{/gist_id}","starred_url":"https://api.github.com/users/drdavella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdavella/subscriptions","organizations_url":"https://api.github.com/users/drdavella/orgs","repos_url":"https://api.github.com/users/drdavella/repos","events_url":"https://api.github.com/users/drdavella/events{/privacy}","received_events_url":"https://api.github.com/users/drdavella/received_events","type":"User","site_admin":false},"repo":{"id":145158818,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUxNTg4MTg=","name":"specutils","full_name":"drdavella/specutils","owner":{"login":"drdavella","id":2458487,"node_id":"MDQ6VXNlcjI0NTg0ODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2458487?v=4","gravatar_id":"","url":"https://api.github.com/users/drdavella","html_url":"https://github.com/drdavella","followers_url":"https://api.github.com/users/drdavella/followers","following_url":"https://api.github.com/users/drdavella/following{/other_user}","gists_url":"https://api.github.com/users/drdavella/gists{/gist_id}","starred_url":"https://api.github.com/users/drdavella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdavella/subscriptions","organizations_url":"https://api.github.com/users/drdavella/orgs","repos_url":"https://api.github.com/users/drdavella/repos","events_url":"https://api.github.com/users/drdavella/events{/privacy}","received_events_url":"https://api.github.com/users/drdavella/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drdavella/specutils","description":"Affiliated package for 1D spectral operations. Maintainers: @nmearl @crawfordsm @keflavich @eteq","fork":true,"url":"https://api.github.com/repos/drdavella/specutils","forks_url":"https://api.github.com/repos/drdavella/specutils/forks","keys_url":"https://api.github.com/repos/drdavella/specutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drdavella/specutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drdavella/specutils/teams","hooks_url":"https://api.github.com/repos/drdavella/specutils/hooks","issue_events_url":"https://api.github.com/repos/drdavella/specutils/issues/events{/number}","events_url":"https://api.github.com/repos/drdavella/specutils/events","assignees_url":"https://api.github.com/repos/drdavella/specutils/assignees{/user}","branches_url":"https://api.github.com/repos/drdavella/specutils/branches{/branch}","tags_url":"https://api.github.com/repos/drdavella/specutils/tags","blobs_url":"https://api.github.com/repos/drdavella/specutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drdavella/specutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drdavella/specutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/drdavella/specutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drdavella/specutils/statuses/{sha}","languages_url":"https://api.github.com/repos/drdavella/specutils/languages","stargazers_url":"https://api.github.com/repos/drdavella/specutils/stargazers","contributors_url":"https://api.github.com/repos/drdavella/specutils/contributors","subscribers_url":"https://api.github.com/repos/drdavella/specutils/subscribers","subscription_url":"https://api.github.com/repos/drdavella/specutils/subscription","commits_url":"https://api.github.com/repos/drdavella/specutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/drdavella/specutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/drdavella/specutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/drdavella/specutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/drdavella/specutils/contents/{+path}","compare_url":"https://api.github.com/repos/drdavella/specutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drdavella/specutils/merges","archive_url":"https://api.github.com/repos/drdavella/specutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drdavella/specutils/downloads","issues_url":"https://api.github.com/repos/drdavella/specutils/issues{/number}","pulls_url":"https://api.github.com/repos/drdavella/specutils/pulls{/number}","milestones_url":"https://api.github.com/repos/drdavella/specutils/milestones{/number}","notifications_url":"https://api.github.com/repos/drdavella/specutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drdavella/specutils/labels{/name}","releases_url":"https://api.github.com/repos/drdavella/specutils/releases{/id}","deployments_url":"https://api.github.com/repos/drdavella/specutils/deployments","created_at":"2018-08-17T19:27:20Z","updated_at":"2018-08-17T19:27:22Z","pushed_at":"2018-09-13T20:53:09Z","git_url":"git://github.com/drdavella/specutils.git","ssh_url":"git@github.com:drdavella/specutils.git","clone_url":"https://github.com/drdavella/specutils.git","svn_url":"https://github.com/drdavella/specutils","homepage":"http://specutils.readthedocs.io/en/latest/","size":4982,"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,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"1bb026e53dda3c56b562183741ae260f946a566b","user":{"login":"astropy","id":847984,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0Nzk4NA==","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":2577269,"node_id":"MDEwOlJlcG9zaXRvcnkyNTc3MjY5","name":"specutils","full_name":"astropy/specutils","owner":{"login":"astropy","id":847984,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0Nzk4NA==","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/specutils","description":"Affiliated package for 1D spectral operations. Maintainers: @nmearl @crawfordsm @keflavich @eteq","fork":false,"url":"https://api.github.com/repos/astropy/specutils","forks_url":"https://api.github.com/repos/astropy/specutils/forks","keys_url":"https://api.github.com/repos/astropy/specutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/specutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/specutils/teams","hooks_url":"https://api.github.com/repos/astropy/specutils/hooks","issue_events_url":"https://api.github.com/repos/astropy/specutils/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/specutils/events","assignees_url":"https://api.github.com/repos/astropy/specutils/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/specutils/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/specutils/tags","blobs_url":"https://api.github.com/repos/astropy/specutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/specutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/specutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/specutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/specutils/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/specutils/languages","stargazers_url":"https://api.github.com/repos/astropy/specutils/stargazers","contributors_url":"https://api.github.com/repos/astropy/specutils/contributors","subscribers_url":"https://api.github.com/repos/astropy/specutils/subscribers","subscription_url":"https://api.github.com/repos/astropy/specutils/subscription","commits_url":"https://api.github.com/repos/astropy/specutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/specutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/specutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/specutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/specutils/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/specutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/specutils/merges","archive_url":"https://api.github.com/repos/astropy/specutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/specutils/downloads","issues_url":"https://api.github.com/repos/astropy/specutils/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/specutils/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/specutils/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/specutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/specutils/labels{/name}","releases_url":"https://api.github.com/repos/astropy/specutils/releases{/id}","deployments_url":"https://api.github.com/repos/astropy/specutils/deployments","created_at":"2011-10-14T16:11:38Z","updated_at":"2018-09-13T18:51:15Z","pushed_at":"2018-09-13T21:37:36Z","git_url":"git://github.com/astropy/specutils.git","ssh_url":"git@github.com:astropy/specutils.git","clone_url":"https://github.com/astropy/specutils.git","svn_url":"https://github.com/astropy/specutils","homepage":"http://specutils.readthedocs.io/en/latest/","size":5010,"stargazers_count":54,"watchers_count":54,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"archived":false,"open_issues_count":83,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":63,"open_issues":83,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/specutils/pulls/281"},"html":{"href":"https://github.com/astropy/specutils/pull/281"},"issue":{"href":"https://api.github.com/repos/astropy/specutils/issues/281"},"comments":{"href":"https://api.github.com/repos/astropy/specutils/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/specutils/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/specutils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/specutils/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/specutils/statuses/a9db3e6df185543c0569511830e649d56d884a21"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"eteq"}}