{"action":"created","comment":{"url":"https://api.github.com/repos/obspy/obspy/pulls/comments/25483948","id":25483948,"diff_hunk":"@@ -86,48 +87,482 @@ def eigval(datax, datay, dataz, fk, normf=1):\n         leigenv3[i] = eigenv[2]\n         rect[i] = 1 - ((eigenv[1] + eigenv[0]) / (2 * eigenv[2]))\n         plan[i] = 1 - ((2 * eigenv[0]) / (eigenv[1] + eigenv[2]))\n-    leigenv1 = leigenv1 / normf\n-    leigenv2 = leigenv2 / normf\n-    leigenv3 = leigenv3 / normf\n+    leigenv1 = leigenv1 / norm_factor\n+    leigenv2 = leigenv2 / norm_factor\n+    leigenv3 = leigenv3 / norm_factor\n \n-    leigenv1_add = np.append(\n-        np.append([leigenv1[0]] * (np.size(fk) // 2), leigenv1),\n-        [leigenv1[np.size(leigenv1) - 1]] * (np.size(fk) // 2))\n+    leigenv1_add = np.append(np.append([leigenv1[0]] * (np.size(fk) // 2),\n+                                       leigenv1),\n+                             [leigenv1[np.size(leigenv1) - 1]] *\n+                             (np.size(fk) // 2))\n     dleigenv1 = signal.lfilter(fk, 1, leigenv1_add)\n     dleigenv[:, 0] = dleigenv1[len(fk) - 1:]\n-    # dleigenv1 = dleigenv1[np.size(fk) // 2:(np.size(dleigenv1) -\n-    #        np.size(fk) / 2)]\n \n-    leigenv2_add = np.append(\n-        np.append(\n-            [leigenv2[0]] * (np.size(fk) // 2),\n-            leigenv2), [leigenv2[np.size(leigenv2) - 1]] * (np.size(fk) // 2))\n+    leigenv2_add = np.append(np.append([leigenv2[0]] * (np.size(fk) // 2),\n+                                       leigenv2),\n+                             [leigenv2[np.size(leigenv2) - 1]] *\n+                             (np.size(fk) // 2))\n     dleigenv2 = signal.lfilter(fk, 1, leigenv2_add)\n     dleigenv[:, 1] = dleigenv2[len(fk) - 1:]\n-    # dleigenv2 = dleigenv2[np.size(fk) // 2:(np.size(dleigenv2) -\n-    #        np.size(fk) / 2)]\n \n-    leigenv3_add = np.append(\n-        np.append(\n-            [leigenv3[0]] * (np.size(fk) // 2), leigenv3),\n-        [leigenv3[np.size(leigenv3) - 1]] * (np.size(fk) // 2))\n+    leigenv3_add = np.append(np.append([leigenv3[0]] * (np.size(fk) // 2),\n+                                       leigenv3),\n+                             [leigenv3[np.size(leigenv3) - 1]] *\n+                             (np.size(fk) // 2))\n     dleigenv3 = signal.lfilter(fk, 1, leigenv3_add)\n     dleigenv[:, 2] = dleigenv3[len(fk) - 1:]\n-    # dleigenv3 = dleigenv3[np.size(fk) // 2:(np.size(dleigenv3) -\n-    #        np.size(fk) / 2)]\n \n-    rect_add = np.append(\n-        np.append([rect[0]] * (np.size(fk) // 2), rect),\n-        [rect[np.size(rect) - 1]] * (np.size(fk) // 2))\n+    rect_add = np.append(np.append([rect[0]] * (np.size(fk) // 2), rect),\n+                         [rect[np.size(rect) - 1]] * (np.size(fk) // 2))\n     drect = signal.lfilter(fk, 1, rect_add)\n     drect = drect[len(fk) - 1:]\n-    # drect = drect[np.size(fk) // 2:(np.size(drect3) - np.size(fk) // 2)]\n \n-    plan_add = np.append(\n-        np.append([plan[0]] * (np.size(fk) // 2), plan),\n-        [plan[np.size(plan) - 1]] * (np.size(fk) // 2))\n+    plan_add = np.append(np.append([plan[0]] * (np.size(fk) // 2), plan),\n+                         [plan[np.size(plan) - 1]] * (np.size(fk) // 2))\n     dplan = signal.lfilter(fk, 1, plan_add)\n     dplan = dplan[len(fk) - 1:]\n-    # dplan = dplan[np.size(fk) // 2:(np.size(dplan) - np.size(fk) // 2)]\n \n     return leigenv1, leigenv2, leigenv3, rect, plan, dleigenv, drect, dplan\n+\n+\n+def flinn(stream, noise_thres=0):\n+    \"\"\"\n+    Computes the azimuth, incidence, rectilinearity and planarity after the\n+    eigenstructure decomposition method of [Flinn1965b]_.\n+\n+    :param stream: ZNE sorted trace data\n+    :type stream: :class:`~obspy.core.stream.Stream`\n+    :param noise_tresh: Variance of the noise sphere; data points are excluded\n+        when falling within the sphere with radius sqrt(noise_thres),\n+        default is set to 0.\n+    :type noise_thres: float\n+    :returns:  azimuth, incidence, rectilinearity, and planarity\n+    \"\"\"\n+    Z = []\n+    N = []\n+    E = []\n+    comp, npts = np.shape(stream)\n+\n+    for i in range(0, npts):","path":"obspy/signal/polarization.py","position":207,"original_position":207,"commit_id":"59bc3d37457fdaf6056d638545cb93972235948d","original_commit_id":"59bc3d37457fdaf6056d638545cb93972235948d","user":{"login":"QuLogic","id":302469,"avatar_url":"https://avatars.githubusercontent.com/u/302469?v=3","gravatar_id":"","url":"https://api.github.com/users/QuLogic","html_url":"https://github.com/QuLogic","followers_url":"https://api.github.com/users/QuLogic/followers","following_url":"https://api.github.com/users/QuLogic/following{/other_user}","gists_url":"https://api.github.com/users/QuLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/QuLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuLogic/subscriptions","organizations_url":"https://api.github.com/users/QuLogic/orgs","repos_url":"https://api.github.com/users/QuLogic/repos","events_url":"https://api.github.com/users/QuLogic/events{/privacy}","received_events_url":"https://api.github.com/users/QuLogic/received_events","type":"User","site_admin":false},"body":"Can use some vector operations here.","created_at":"2015-02-27T02:13:55Z","updated_at":"2015-02-27T02:13:55Z","html_url":"https://github.com/obspy/obspy/pull/505#discussion_r25483948","pull_request_url":"https://api.github.com/repos/obspy/obspy/pulls/505","_links":{"self":{"href":"https://api.github.com/repos/obspy/obspy/pulls/comments/25483948"},"html":{"href":"https://github.com/obspy/obspy/pull/505#discussion_r25483948"},"pull_request":{"href":"https://api.github.com/repos/obspy/obspy/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/obspy/obspy/pulls/505","id":3888857,"html_url":"https://github.com/obspy/obspy/pull/505","diff_url":"https://github.com/obspy/obspy/pull/505.diff","patch_url":"https://github.com/obspy/obspy/pull/505.patch","issue_url":"https://api.github.com/repos/obspy/obspy/issues/505","number":505,"state":"open","locked":false,"title":"3 c analysis","user":{"login":"jwassermann","id":2551876,"avatar_url":"https://avatars.githubusercontent.com/u/2551876?v=3","gravatar_id":"","url":"https://api.github.com/users/jwassermann","html_url":"https://github.com/jwassermann","followers_url":"https://api.github.com/users/jwassermann/followers","following_url":"https://api.github.com/users/jwassermann/following{/other_user}","gists_url":"https://api.github.com/users/jwassermann/gists{/gist_id}","starred_url":"https://api.github.com/users/jwassermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwassermann/subscriptions","organizations_url":"https://api.github.com/users/jwassermann/orgs","repos_url":"https://api.github.com/users/jwassermann/repos","events_url":"https://api.github.com/users/jwassermann/events{/privacy}","received_events_url":"https://api.github.com/users/jwassermann/received_events","type":"User","site_admin":false},"body":"Added several techniques to compute polarization properties of 3C seismic records...","created_at":"2013-01-29T16:35:01Z","updated_at":"2015-02-27T02:13:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a6c9bcd289a5ea8243f9e798a306b5173a0f26a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/obspy/obspy/pulls/505/commits","review_comments_url":"https://api.github.com/repos/obspy/obspy/pulls/505/comments","review_comment_url":"https://api.github.com/repos/obspy/obspy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/obspy/obspy/issues/505/comments","statuses_url":"https://api.github.com/repos/obspy/obspy/statuses/59bc3d37457fdaf6056d638545cb93972235948d","head":{"label":"jwassermann:3C-analysis","ref":"3C-analysis","sha":"59bc3d37457fdaf6056d638545cb93972235948d","user":{"login":"jwassermann","id":2551876,"avatar_url":"https://avatars.githubusercontent.com/u/2551876?v=3","gravatar_id":"","url":"https://api.github.com/users/jwassermann","html_url":"https://github.com/jwassermann","followers_url":"https://api.github.com/users/jwassermann/followers","following_url":"https://api.github.com/users/jwassermann/following{/other_user}","gists_url":"https://api.github.com/users/jwassermann/gists{/gist_id}","starred_url":"https://api.github.com/users/jwassermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwassermann/subscriptions","organizations_url":"https://api.github.com/users/jwassermann/orgs","repos_url":"https://api.github.com/users/jwassermann/repos","events_url":"https://api.github.com/users/jwassermann/events{/privacy}","received_events_url":"https://api.github.com/users/jwassermann/received_events","type":"User","site_admin":false},"repo":{"id":6334040,"name":"obspy","full_name":"jwassermann/obspy","owner":{"login":"jwassermann","id":2551876,"avatar_url":"https://avatars.githubusercontent.com/u/2551876?v=3","gravatar_id":"","url":"https://api.github.com/users/jwassermann","html_url":"https://github.com/jwassermann","followers_url":"https://api.github.com/users/jwassermann/followers","following_url":"https://api.github.com/users/jwassermann/following{/other_user}","gists_url":"https://api.github.com/users/jwassermann/gists{/gist_id}","starred_url":"https://api.github.com/users/jwassermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwassermann/subscriptions","organizations_url":"https://api.github.com/users/jwassermann/orgs","repos_url":"https://api.github.com/users/jwassermann/repos","events_url":"https://api.github.com/users/jwassermann/events{/privacy}","received_events_url":"https://api.github.com/users/jwassermann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwassermann/obspy","description":"ObsPy: A Python Toolbox for seismology/seismological observatories.","fork":true,"url":"https://api.github.com/repos/jwassermann/obspy","forks_url":"https://api.github.com/repos/jwassermann/obspy/forks","keys_url":"https://api.github.com/repos/jwassermann/obspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwassermann/obspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwassermann/obspy/teams","hooks_url":"https://api.github.com/repos/jwassermann/obspy/hooks","issue_events_url":"https://api.github.com/repos/jwassermann/obspy/issues/events{/number}","events_url":"https://api.github.com/repos/jwassermann/obspy/events","assignees_url":"https://api.github.com/repos/jwassermann/obspy/assignees{/user}","branches_url":"https://api.github.com/repos/jwassermann/obspy/branches{/branch}","tags_url":"https://api.github.com/repos/jwassermann/obspy/tags","blobs_url":"https://api.github.com/repos/jwassermann/obspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwassermann/obspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwassermann/obspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwassermann/obspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwassermann/obspy/statuses/{sha}","languages_url":"https://api.github.com/repos/jwassermann/obspy/languages","stargazers_url":"https://api.github.com/repos/jwassermann/obspy/stargazers","contributors_url":"https://api.github.com/repos/jwassermann/obspy/contributors","subscribers_url":"https://api.github.com/repos/jwassermann/obspy/subscribers","subscription_url":"https://api.github.com/repos/jwassermann/obspy/subscription","commits_url":"https://api.github.com/repos/jwassermann/obspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwassermann/obspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwassermann/obspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwassermann/obspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwassermann/obspy/contents/{+path}","compare_url":"https://api.github.com/repos/jwassermann/obspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwassermann/obspy/merges","archive_url":"https://api.github.com/repos/jwassermann/obspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwassermann/obspy/downloads","issues_url":"https://api.github.com/repos/jwassermann/obspy/issues{/number}","pulls_url":"https://api.github.com/repos/jwassermann/obspy/pulls{/number}","milestones_url":"https://api.github.com/repos/jwassermann/obspy/milestones{/number}","notifications_url":"https://api.github.com/repos/jwassermann/obspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwassermann/obspy/labels{/name}","releases_url":"https://api.github.com/repos/jwassermann/obspy/releases{/id}","created_at":"2012-10-22T11:45:46Z","updated_at":"2015-02-25T17:19:05Z","pushed_at":"2015-02-25T20:37:20Z","git_url":"git://github.com/jwassermann/obspy.git","ssh_url":"git@github.com:jwassermann/obspy.git","clone_url":"https://github.com/jwassermann/obspy.git","svn_url":"https://github.com/jwassermann/obspy","homepage":"https://github.com/obspy/obspy/wiki","size":41652,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"obspy:master","ref":"master","sha":"dd029094e5153f4798e9f939fd96fc1228d02c8a","user":{"login":"obspy","id":1701221,"avatar_url":"https://avatars.githubusercontent.com/u/1701221?v=3","gravatar_id":"","url":"https://api.github.com/users/obspy","html_url":"https://github.com/obspy","followers_url":"https://api.github.com/users/obspy/followers","following_url":"https://api.github.com/users/obspy/following{/other_user}","gists_url":"https://api.github.com/users/obspy/gists{/gist_id}","starred_url":"https://api.github.com/users/obspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obspy/subscriptions","organizations_url":"https://api.github.com/users/obspy/orgs","repos_url":"https://api.github.com/users/obspy/repos","events_url":"https://api.github.com/users/obspy/events{/privacy}","received_events_url":"https://api.github.com/users/obspy/received_events","type":"Organization","site_admin":false},"repo":{"id":5731348,"name":"obspy","full_name":"obspy/obspy","owner":{"login":"obspy","id":1701221,"avatar_url":"https://avatars.githubusercontent.com/u/1701221?v=3","gravatar_id":"","url":"https://api.github.com/users/obspy","html_url":"https://github.com/obspy","followers_url":"https://api.github.com/users/obspy/followers","following_url":"https://api.github.com/users/obspy/following{/other_user}","gists_url":"https://api.github.com/users/obspy/gists{/gist_id}","starred_url":"https://api.github.com/users/obspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obspy/subscriptions","organizations_url":"https://api.github.com/users/obspy/orgs","repos_url":"https://api.github.com/users/obspy/repos","events_url":"https://api.github.com/users/obspy/events{/privacy}","received_events_url":"https://api.github.com/users/obspy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/obspy/obspy","description":"ObsPy: A Python Toolbox for seismology/seismological observatories.","fork":false,"url":"https://api.github.com/repos/obspy/obspy","forks_url":"https://api.github.com/repos/obspy/obspy/forks","keys_url":"https://api.github.com/repos/obspy/obspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/obspy/obspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/obspy/obspy/teams","hooks_url":"https://api.github.com/repos/obspy/obspy/hooks","issue_events_url":"https://api.github.com/repos/obspy/obspy/issues/events{/number}","events_url":"https://api.github.com/repos/obspy/obspy/events","assignees_url":"https://api.github.com/repos/obspy/obspy/assignees{/user}","branches_url":"https://api.github.com/repos/obspy/obspy/branches{/branch}","tags_url":"https://api.github.com/repos/obspy/obspy/tags","blobs_url":"https://api.github.com/repos/obspy/obspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/obspy/obspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/obspy/obspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/obspy/obspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/obspy/obspy/statuses/{sha}","languages_url":"https://api.github.com/repos/obspy/obspy/languages","stargazers_url":"https://api.github.com/repos/obspy/obspy/stargazers","contributors_url":"https://api.github.com/repos/obspy/obspy/contributors","subscribers_url":"https://api.github.com/repos/obspy/obspy/subscribers","subscription_url":"https://api.github.com/repos/obspy/obspy/subscription","commits_url":"https://api.github.com/repos/obspy/obspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/obspy/obspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/obspy/obspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/obspy/obspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/obspy/obspy/contents/{+path}","compare_url":"https://api.github.com/repos/obspy/obspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/obspy/obspy/merges","archive_url":"https://api.github.com/repos/obspy/obspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/obspy/obspy/downloads","issues_url":"https://api.github.com/repos/obspy/obspy/issues{/number}","pulls_url":"https://api.github.com/repos/obspy/obspy/pulls{/number}","milestones_url":"https://api.github.com/repos/obspy/obspy/milestones{/number}","notifications_url":"https://api.github.com/repos/obspy/obspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/obspy/obspy/labels{/name}","releases_url":"https://api.github.com/repos/obspy/obspy/releases{/id}","created_at":"2012-09-08T19:17:46Z","updated_at":"2015-02-26T20:11:15Z","pushed_at":"2015-02-26T20:11:15Z","git_url":"git://github.com/obspy/obspy.git","ssh_url":"git@github.com:obspy/obspy.git","clone_url":"https://github.com/obspy/obspy.git","svn_url":"https://github.com/obspy/obspy","homepage":"http://www.obspy.org","size":70407,"stargazers_count":111,"watchers_count":111,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":69,"forks":89,"open_issues":69,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/obspy/obspy/pulls/505"},"html":{"href":"https://github.com/obspy/obspy/pull/505"},"issue":{"href":"https://api.github.com/repos/obspy/obspy/issues/505"},"comments":{"href":"https://api.github.com/repos/obspy/obspy/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/obspy/obspy/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/obspy/obspy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/obspy/obspy/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/obspy/obspy/statuses/59bc3d37457fdaf6056d638545cb93972235948d"}}}}